2 # A script for building of LibUCW packages
3 # (c) 2013--2017 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
19 --no-checkout Expect manually checked out sources to build directory (useful for chrooted building; --version is mandatory)
24 function pkg-gen-debian {(
27 ./configure debian/config VER="$VER" TREEHASH="$TREEHASH" $CONF \
29 INSTALL_INCLUDE_DIR=/usr/include/libucw \
30 INSTALL_DOC_DIR=/usr/share/doc/libucw/html \
31 INSTALL_CONFIG_DIR=/usr/share/doc/libucw/examples/etc
33 echo "Creating debian/control"
34 build/genconf debian/control.in debian/control obj/config.mk
36 if [ -n "$GEN_SCRIPT" ] ; then
37 echo "Executing $GEN_SCRIPT"
41 echo "Creating debian/changelog"
45 dch --changelog=$CL --create --package=$PKG --newversion=$VER "Automatic release."
46 dch --changelog=$CL --release
47 sed -i '/Initial release/d' $CL
57 while [ -n "$1" ] ; do
59 --archonly) ARCHONLY=1
61 --no-source) NO_SOURCE=1
65 --version=*) PKGVER="${1:10}"
67 --abi-version=*)CONF="$CONF UCW_ABI_SUFFIX=-${1:14}"
69 --gen-script=*) GEN_SCRIPT="${1:13}"
71 --extra-conf=*) CONF="$CONF ${1:13}"
73 --no-checkout) PKG_NO_CHECKOUT=1
84 echo $VER >$BUILDDIR/UCW_VERSION
88 if [ -n "$ARCHONLY" ] ; then
90 elif [ -n "$NO_SOURCE" ] ; then
93 (cd $BUILDDIR && dpkg-buildpackage -rfakeroot -us -uc $BUILDOPTS)
94 [ -z "$ARCHONLY" ] || rm -f debian-tmp/*_all.deb
95 pkg-get-files debian-tmp/*.{deb,dsc,changes,tar.gz}
97 [ -z "$CLEANUP" ] || pkg-cleanup