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
22 function pkg-gen-debian {(
25 ./configure debian/config VER="$VER" TREEHASH="$TREEHASH" $CONF \
27 INSTALL_INCLUDE_DIR=/usr/include/libucw \
28 INSTALL_DOC_DIR=/usr/share/doc/libucw/html \
29 INSTALL_CONFIG_DIR=/usr/share/doc/libucw/examples/etc
31 echo "Creating debian/control"
32 build/genconf debian/control.in debian/control obj/config.mk
34 if [ -n "$GEN_SCRIPT" ] ; then
35 echo "Executing $GEN_SCRIPT"
39 echo "Creating debian/changelog"
43 dch --changelog=$CL --create --package=$PKG --newversion=$VER "Automatic release."
44 dch --changelog=$CL --release
45 sed -i '/Initial release/d' $CL
55 while [ -n "$1" ] ; do
57 --archonly) ARCHONLY=1
59 --no-source) NO_SOURCE=1
63 --version=*) PKGVER="${1:10}"
65 --abi-version=*)CONF="$CONF UCW_ABI_SUFFIX=-${1:14}"
67 --gen-script=*) GEN_SCRIPT="${1:13}"
78 echo $TREEVER >$BUILDDIR/UCW_VERSION
82 if [ -n "$ARCHONLY" ] ; then
84 elif [ -n "$NO_SOURCE" ] ; then
87 (cd $BUILDDIR && dpkg-buildpackage -rfakeroot -us -uc $BUILDOPTS)
88 [ -z "$ARCHONLY" ] || rm -f debian-tmp/*_all.deb
89 pkg-get-files debian-tmp/*.{deb,dsc,changes,tar.gz}
91 [ -z "$CLEANUP" ] || pkg-cleanup