Commit e551413 MAKE_SRPM: Add --output parameter

1 file Authored and Committed by fidencio 3 months ago
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 <fidencio@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

    
 1 @@ -26,6 +26,7 @@
 2       echo -e "\t-d, --debug        Enable debugging."
 3       echo -e "\t-c, --clean        Remove directory rpmbuild and exit."
 4       echo -e "\t-P, --patches      Requires list of patches for SRPM."
 5 +     echo -e "\t-o, --output       Moves the created srpm to a specific output directory."
 6       echo -e "\t-h, --help         Print this help and exit."
 7       echo -e "\t-?, --usage"
 8   
 9 @@ -86,6 +87,11 @@
10       patches=("$@")
11       break
12       ;;
13 +     -o|--output)
14 +     shift
15 +     OUTPUT=("$@")
16 +     break
17 +     ;;
18       -h|--help|-\?|--usage)
19       usage
20       ;;
21 @@ -164,3 +170,8 @@
22   cd $RPMBUILD
23   rpmbuild --define "_topdir $RPMBUILD" \
24            -bs SPECS/$PACKAGE_NAME.spec
25 + 
26 + if [ -n "$OUTPUT" ]; then
27 +     mv "$RPMBUILD/SRPMS/"*.src.rpm "$OUTPUT/"
28 +     echo "Package has been moved to the folder: $OUTPUT"
29 + fi