mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-24 22:50:39 +01:00
mkspec-wrapper.sh: Add file
This commit is contained in:
parent
008524ff8f
commit
f7064331c7
1 changed files with 67 additions and 0 deletions
67
scripts/mkspec-wrapper.sh
Normal file
67
scripts/mkspec-wrapper.sh
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
INSTALL_LOG=/var/tmp/%{name}-buildroot/install.log
|
||||||
|
MYNAME=`basename $0`
|
||||||
|
MKSPEC_SH="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
echo usage: $MYNAME /path/to/mkspec.sh -h [-N name] [-T topdir] [-V version] [-S source] [-R requires]
|
||||||
|
[ "$1" ] && exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
set -- `getopt T:V:S:N:hR: $*`
|
||||||
|
|
||||||
|
while [ $1 != -- ]; do
|
||||||
|
case $1 in
|
||||||
|
-h)
|
||||||
|
usage 0;;
|
||||||
|
-T)
|
||||||
|
TOPDIR="$2"
|
||||||
|
shift;;
|
||||||
|
-V)
|
||||||
|
V="$2"
|
||||||
|
shift;;
|
||||||
|
-S)
|
||||||
|
SOURCE="$2"
|
||||||
|
shift;;
|
||||||
|
-N)
|
||||||
|
NAME="$2"
|
||||||
|
shift;;
|
||||||
|
-R)
|
||||||
|
REQUIRES="$2"
|
||||||
|
shift;;
|
||||||
|
*)
|
||||||
|
usage 1;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
|
||||||
|
[ -z "$TOPDIR" ] && TOPDIR=.
|
||||||
|
|
||||||
|
if [ -z "$V" ]; then
|
||||||
|
if [ -f $TOPDIR/VERSION ]; then
|
||||||
|
VERSION="`cat $TOPDIR/VERSION | cut -d- -f1`"
|
||||||
|
RELEASE="`cat $TOPDIR/VERSION | cut -d- -f2-`"
|
||||||
|
else
|
||||||
|
VERSION=noversion
|
||||||
|
RELEASE=norelease
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
VERSION="`echo $V | cut -d- -f1`"
|
||||||
|
RELEASE="`echo $V | cut -d- -f2-`"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$NAME" ]; then
|
||||||
|
NAME=`pwd | xargs basename`
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$REQUIRES" ]; then
|
||||||
|
REQUIRES_RUN=`echo $REQUIRES | sed -e 's/,/ /g; s/-[0-9-\.]*\b/-run&/g'`
|
||||||
|
REQUIRES_DEVEL=`echo $REQUIRES | sed -e 's/,/ /g; s/-[0-9-\.]*\b/-devel&/g'`
|
||||||
|
fi
|
||||||
|
|
||||||
|
. $MKSPEC_SH
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue