build: bootstrap script has expected content

added CI specific 'bootstrap' script version: with parameters it creates the 'm4.version.ci' -- CI specific 'm4.version'
This commit is contained in:
Viktor Tarasov 2014-05-05 08:46:29 +02:00
parent 4bed397fbc
commit d4195e297c
4 changed files with 77 additions and 78 deletions

View File

@ -15,7 +15,7 @@ EXTRA_DIST = Makefile.mak
SUBDIRS = etc src win32 doc MacOSX
dist_noinst_SCRIPTS = bootstrap
dist_noinst_SCRIPTS = bootstrap bootstrap.ci
dist_noinst_DATA = README \
solaris/Makefile solaris/README solaris/checkinstall.in \
solaris/opensc.conf-dist solaris/pkginfo.in solaris/proto \

View File

@ -1,79 +1,3 @@
#!/bin/sh
usage()
{
cat << EOF
usage: $0 options
OpenSC bootstrap
OPTIONS:
-h Show this message
-s Package suffix
-S Use package suffix as 'g' appended with the date of last commit
-r Package version revision
-R Use package version revision as Git commit number from 'git describe' result
-b Package branch
-B Use package branch as current Git branch
EOF
}
SUFFIX=
REVISION=
VERBOSE=
while getopts “:hs:Sr:R” OPTION
do
case $OPTION in
h)
usage
exit 1
;;
s)
SUFFIX=$OPTARG
;;
S)
SUFFIX=g`git log -1 --pretty=fuller --date=iso | grep CommitDate: | sed -E 's/^CommitDate:\s(.*)/\1/' | sed -E 's/(.*)-(.*)-(.*) (.*):(.*):(.*)\s+.*/\1\2\3\4\5\6/'`
;;
r)
REVISION=$OPTARG
;;
R)
REVISION=`git describe | perl -ne 'print $1 if /^[\.0-9]*-([0-9]*)-g[a-z0-9]*$/;'`
;;
?)
usage
exit
;;
esac
done
set -e
set -x
if [ -f Makefile ]; then
make distclean
fi
rm -rf *~ *.cache config.guess config.log config.status config.sub depcomp ltmain.sh
if [ -n "$SUFFIX" ] || [ -n "$REVISION" ]
then
cp version.m4 version.m4.orig
if [ -n "$SUFFIX" ]
then
echo Set package suffix "$SUFFIX"
sed 's/^define(\[PACKAGE_SUFFIX\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_SUFFIX\], \['$SUFFIX'\])/g' version.m4.orig > version.m4
fi
if [ -n "$REVISION" ]
then
echo Set package revision "$REVISION"
sed 's/^define(\[PACKAGE_VERSION_REVISION\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_VERSION_REVISION\], \['$REVISION'\])/g' version.m4.orig > version.m4
fi
fi
autoreconf --verbose --install --force || true
if [ -f version.m4.orig ]; then
mv version.m4.orig version.m4
fi
autoreconf --verbose --install --force

74
bootstrap.ci Executable file
View File

@ -0,0 +1,74 @@
#!/bin/sh
usage()
{
cat << EOF
usage: $0 options
OpenSC bootstrap
OPTIONS:
-h Show this message
-s Package suffix
-S Use package suffix as 'g' appended with the date of last commit
-r Package version revision
-R Use package version revision as Git commit number from 'git describe' result
-b Package branch
-B Use package branch as current Git branch
EOF
}
SUFFIX=
REVISION=
VERBOSE=
KEEPVERSION=
while getopts “:hs:Sr:RK” OPTION
do
case $OPTION in
h)
usage
exit 1
;;
s)
SUFFIX=$OPTARG
;;
S)
SUFFIX=g`git log -1 --pretty=fuller --date=iso | grep CommitDate: | sed -E 's/^CommitDate:\s(.*)/\1/' | sed -E 's/(.*)-(.*)-(.*) (.*):(.*):(.*)\s+.*/\1\2\3\4\5\6/'`
;;
r)
REVISION=$OPTARG
;;
R)
REVISION=`git describe | perl -ne 'print $1 if /^[\.0-9]*-([0-9]*)-g[a-z0-9]*$/;'`
;;
?)
usage
exit
;;
esac
done
set -e
set -x
if [ -f Makefile ]; then
make distclean
fi
rm -rf *~ *.cache config.guess config.log config.status config.sub depcomp ltmain.sh version.m4.ci
if [ -n "$SUFFIX" ] || [ -n "$REVISION" ]
then
if [ -n "$SUFFIX" ]
then
echo Set package suffix "$SUFFIX"
sed 's/^define(\[PACKAGE_SUFFIX\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_SUFFIX\], \['$SUFFIX'\])/g' version.m4 > version.m4.ci
fi
if [ -n "$REVISION" ]
then
echo Set package revision "$REVISION"
sed 's/^define(\[PACKAGE_VERSION_REVISION\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_VERSION_REVISION\], \['$REVISION'\])/g' version.m4 > version.m4.ci
fi
fi
autoreconf --verbose --install --force || true

View File

@ -17,6 +17,7 @@ define([VS_FF_COMMENTS], [Provided under the terms of the GNU Lesser General Pub
define([VS_FF_PRODUCT_NAME], [OpenSC smartcard framework])
m4_include(version.m4)
m4_sinclude(version.m4.ci)
AC_INIT([PRODUCT_NAME],[PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX[]PACKAGE_SUFFIX],[PRODUCT_BUGREPORT],[PRODUCT_TARNAME])
AC_CONFIG_AUX_DIR([.])