diff options
author | Harel Ben-Attia <harelba@gmail.com> | 2014-02-21 11:28:45 -0500 |
---|---|---|
committer | Harel Ben-Attia <harelba@gmail.com> | 2014-02-21 11:28:45 -0500 |
commit | 0e7ab22ba8cd2fc9a5bfdab7275bcb322a64d87e (patch) | |
tree | 3afe05e28bf9d3162b5cbc691caaf808d06994f5 /create-rpm | |
parent | b90da7a36942e8667cefdad6991cd1befa2e6d1c (diff) |
more robust create-rpm guards + added misc. in rpm spec
Diffstat (limited to 'create-rpm')
-rwxr-xr-x | create-rpm | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 |