2 # A script for building of LibUCW packages
3 # (c) 2013--2014 Pavel Charvat <pchar@ucw.cz>
12 --archonly Build only binary packages
13 --cleanup Cleanup temporary files when finished
14 --version=<ver> Custom version number of resulting packages (default: autodetect from git-describe)
15 --abi-version=<ver> Custom version number of the LibUCW's ABI (default: defined in ucw/default.cfg)
16 --gen-script=<script> Custom script to postprocess
21 function pkg-gen-debian {(
24 ./configure debian/config VER="$VER" TREEHASH="$TREEHASH" $CONF \
26 INSTALL_INCLUDE_DIR=/usr/include/libucw \
27 INSTALL_DOC_DIR=/usr/share/doc/libucw/html \
28 INSTALL_CONFIG_DIR=/usr/share/doc/libucw/examples/etc
30 echo "Creating debian/control"
31 build/genconf debian/control.in debian/control obj/config.mk
33 if [ -n "$GEN_SCRIPT" ] ; then
34 echo "Executing $GEN_SCRIPT"
38 echo "Creating debian/changelog"
42 dch --changelog=$CL --create --package=$PKG --newversion=$VER "Automatic release."
43 dch --changelog=$CL --release
44 sed -i '/Initial release/d' $CL
53 while [ -n "$1" ] ; do
55 --archonly) ARCHONLY=1
59 --version=*) PKGVER="${1:10}"
61 --abi-version=*)CONF="$CONF UCW_ABI_SUFFIX=-${1:14}"
63 --gen-script=*) GEN_SCRIPT="${1:13}"
74 echo $TREEVER >$BUILDDIR/UCW_VERSION
76 (cd $BUILDDIR && dpkg-buildpackage -rfakeroot -us -uc ${ARCHONLY:+"-B"})
77 [ -z "$ARCHONLY" ] || rm -f debian-tmp/*_all.deb
78 pkg-get-files debian-tmp/*.{deb,dsc,changes}
80 [ -z "$CLEANUP" ] || pkg-cleanup