From e551413487ca2d5f8328e7b9148908613f6d48eb Mon Sep 17 00:00:00 2001 From: Fabiano FidĂȘncio Date: May 16 2018 02:56:15 +0000 Subject: MAKE_SRPM: Add --output parameter This parameter is being added as it makes our life easier when dealing with automated copr builds for this project. Signed-off-by: Fabiano FidĂȘncio Reviewed-by: Jakub Hrozek --- diff --git a/contrib/fedora/make_srpm.sh b/contrib/fedora/make_srpm.sh index d3b8b1b..cdc9ee5 100755 --- a/contrib/fedora/make_srpm.sh +++ b/contrib/fedora/make_srpm.sh @@ -26,6 +26,7 @@ usage(){ echo -e "\t-d, --debug Enable debugging." echo -e "\t-c, --clean Remove directory rpmbuild and exit." echo -e "\t-P, --patches Requires list of patches for SRPM." + echo -e "\t-o, --output Moves the created srpm to a specific output directory." echo -e "\t-h, --help Print this help and exit." echo -e "\t-?, --usage" @@ -86,6 +87,11 @@ case $i in patches=("$@") break ;; + -o|--output) + shift + OUTPUT=("$@") + break + ;; -h|--help|-\?|--usage) usage ;; @@ -164,3 +170,8 @@ add_patches "$RPMBUILD/SPECS/$PACKAGE_NAME.spec" \ cd $RPMBUILD rpmbuild --define "_topdir $RPMBUILD" \ -bs SPECS/$PACKAGE_NAME.spec + +if [ -n "$OUTPUT" ]; then + mv "$RPMBUILD/SRPMS/"*.src.rpm "$OUTPUT/" + echo "Package has been moved to the folder: $OUTPUT" +fi