Skip to content

Commit

Permalink
rpmbuild.sh: Add arguments support and --nodebuginfo
Browse files Browse the repository at this point in the history
Signed-off-by: Rong Tao <[email protected]>
  • Loading branch information
Rtoax committed Jun 20, 2024
1 parent f20c79a commit 083ef76
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions rpmbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,44 @@
# Use half of CPU cores
np=$(( $(nproc) / 2 ))

nodebuginfo=

__usage__() {
echo -e "
--nodebuginfo skip debuginfo and debugsource packages
-h, --help print this info
"
exit ${1-0}
}

TEMP=$( getopt --options h \
--long help \
--long nodebuginfo \
--name rpmbuild-ulpatch -- "$@" )
test $? != 0 && __usage__ 1

eval set -- "${TEMP}"

while true ; do
case $1 in
-h | --help)
shift
__usage__
;;
--nodebuginfo)
shift
nodebuginfo=YES
;;
--)
shift
break
;;
esac
done

rpmbuild -ba \
--define "_topdir $PWD" \
--define "_sourcedir $PWD" \
--define "_smp_mflags -j${np}" \
${nodebuginfo:+--nodebuginfo} \
ulpatch.spec

0 comments on commit 083ef76

Please sign in to comment.