mkspec-wrapper.sh: Support for --provides-run and --provides-devel

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-01-07 13:36:28 +00:00
commit c6f81d4f4c

View file

@ -6,59 +6,74 @@ usage()
[ "$1" ] && exit $1 [ "$1" ] && exit $1
} }
set -x append()
{
local var=$1
shift
local tmp=`eval echo \\$$var $@ | sed 's/^[[:space:]]*//; s/[[:space:]]*$//'`
eval $var=\"$tmp\"
}
# -- here we go # -- here we go
MYNAME=`basename $0` #set -x
ID=`whoami`
if [ ! "$INSTALL_LOG" ]; then if [ ! "$INSTALL_LOG" ]; then
#INSTALL_LOG=/var/tmp/%{name}-buildroot/install.log #INSTALL_LOG=/var/tmp/%{name}-buildroot/install.log
INSTALL_LOG=/tmp/rpmbuild-$ID/install.log INSTALL_LOG=/tmp/rpmbuild-$ID/install.log
fi fi
MKSPEC_SH="$1"
shift
set -- `getopt -l "provides-run:" -o "P:T:V:S:N:hR:D:X:Y:d:" -- "$@"` MYNAME=`basename $0`
ID=`whoami`
eval set -- `getopt -l "provides-run:" -l "provides-devel:" -o "P:T:V:S:N:hR:D:X:Y:d:" -- "$@"`
while [ "$1" != -- ]; do while [ "$1" != -- ]; do
echo checking "$1=$2" >&2
case $1 in case $1 in
-h) -h)
usage 0;; usage 0;;
-T) -T)
eval TOPDIR="$2" TOPDIR="$2"
shift;; shift;;
-V) -V)
eval V="$2" V="$2"
shift;; shift;;
-S) -S)
eval SOURCE="$2" SOURCE="$2"
shift;; shift;;
-N) -N)
eval NAME="$2" NAME="$2"
shift;; shift;;
-R) -R)
eval REQUIRES_RUN="$REQUIRES_RUN $2" append REQUIRES_RUN "$2"
shift shift
;; ;;
-X) -X)
eval CONFLICTS_RUN="$CONFLICTS_RUN $2" append CONFLICTS_RUN "$2"
shift shift
;; ;;
-D) -D)
eval REQUIRES_DEVEL="$REQUIRES_DEVEL $2" append REQUIRES_DEVEL "$2"
shift shift
;; ;;
-Y) -Y)
eval CONFLICTS_DEVEL="$CONFLICTS_DEVEL $2" append CONFLICTS_DEVEL "$2"
shift
;;
--provides-run)
append PROVIDES_RUN "$2"
shift
;;
--provides-devel)
append PROVIDES_DEVEL "$2"
shift shift
;; ;;
-P) -P)
eval PROJECT="$2" PROJECT="$2"
shift;; shift;;
-d) -d)
eval DISTRIBUTION="$2" DISTRIBUTION="$2"
shift;; shift;;
*) *)
usage 1;; usage 1;;
@ -67,6 +82,9 @@ shift
done done
shift shift
MKSPEC_SH="$1"
shift
[ -z "$TOPDIR" ] && TOPDIR=. [ -z "$TOPDIR" ] && TOPDIR=.
if [ -z "$V" ]; then if [ -z "$V" ]; then