summaryrefslogtreecommitdiffstats
path: root/create-rpm
diff options
context:
space:
mode:
authorHarel Ben-Attia <harelba@gmail.com>2014-02-21 11:28:45 -0500
committerHarel Ben-Attia <harelba@gmail.com>2014-02-21 11:28:45 -0500
commit0e7ab22ba8cd2fc9a5bfdab7275bcb322a64d87e (patch)
tree3afe05e28bf9d3162b5cbc691caaf808d06994f5 /create-rpm
parentb90da7a36942e8667cefdad6991cd1befa2e6d1c (diff)
more robust create-rpm guards + added misc. in rpm spec
Diffstat (limited to 'create-rpm')
-rwxr-xr-xcreate-rpm21
1 files changed, 21 insertions, 0 deletions
diff --git a/create-rpm b/create-rpm
index 9ec007f..e6d1a3a 100755
--- a/create-rpm
+++ b/create-rpm
@@ -1,11 +1,30 @@
#!/bin/bash
+#
+# Simplistic RPM creation logic. See q.spec.template for actual spec
+#
+# Version number should be provided as input in the command line
+#
+# requires:
+# * installation of ronn
+# * installation of rpmbuild
+#
+# Output rpm is generated inside build/rpm/RPMS/noarch/
+#
+
if [ $# -ne 1 ];
then
echo 'create-rpm <version>'
exit 1
fi
+command -v ronn &>/dev/null || { echo >&2 "ronn needs to be installed."; exit 1; }
+command -v rpmbuild &>/dev/null || { echo >&2 "rpmbuild needs to be installed."; exit 1; }
+
+base_folder=$(dirname $0)
+
+pushd ${base_folder}
+
VERSION=$1
REAL_PACKAGE_NAME=q
RPM_PACKAGE_NAME=q
@@ -29,3 +48,5 @@ rpmbuild --define "_topdir `pwd`/build/rpm" -ta ${TAR_NAME}
rm ${RPM_PACKAGE_NAME}.spec
rm ${TAR_NAME}
rm ${REAL_PACKAGE_NAME}.1
+
+popd