2 # A script for building of LibUCW packages
3 # (c) 2013--2014 Pavel Charvat <pchar@ucw.cz>
12 --archonly Build only binary packages
13 --no-source Don't build source files
14 --cleanup Cleanup temporary files when finished
15 --version=<ver> Custom version number of resulting packages (default: autodetect from git-describe)
16 --abi-version=<ver> Custom version number of the LibUCW's ABI (default: defined in ucw/default.cfg)
17 --gen-script=<script> Custom script to postprocess
18 --extra-conf=<args> Add extra arguments to the configure script
23 function pkg-gen-debian {(
26 ./configure debian/config VER="$VER" TREEHASH="$TREEHASH" $CONF \
28 INSTALL_INCLUDE_DIR=/usr/include/libucw \
29 INSTALL_DOC_DIR=/usr/share/doc/libucw/html \
30 INSTALL_CONFIG_DIR=/usr/share/doc/libucw/examples/etc
32 echo "Creating debian/control"
33 build/genconf debian/control.in debian/control obj/config.mk
35 if [ -n "$GEN_SCRIPT" ] ; then
36 echo "Executing $GEN_SCRIPT"
40 echo "Creating debian/changelog"
44 dch --changelog=$CL --create --package=$PKG --newversion=$VER "Automatic release."
45 dch --changelog=$CL --release
46 sed -i '/Initial release/d' $CL
56 while [ -n "$1" ] ; do
58 --archonly) ARCHONLY=1
60 --no-source) NO_SOURCE=1
64 --version=*) PKGVER="${1:10}"
66 --abi-version=*)CONF="$CONF UCW_ABI_SUFFIX=-${1:14}"
68 --gen-script=*) GEN_SCRIPT="${1:13}"
70 --extra-conf=*) CONF="$CONF ${1:13}"
81 echo $TREEVER >$BUILDDIR/UCW_VERSION
85 if [ -n "$ARCHONLY" ] ; then
87 elif [ -n "$NO_SOURCE" ] ; then
90 (cd $BUILDDIR && dpkg-buildpackage -rfakeroot -us -uc $BUILDOPTS)
91 [ -z "$ARCHONLY" ] || rm -f debian-tmp/*_all.deb
92 pkg-get-files debian-tmp/*.{deb,dsc,changes,tar.gz}
94 [ -z "$CLEANUP" ] || pkg-cleanup