1 # A library of shell functions for building of Debian packages
2 # (c) 2008--2009 Martin Mares <mj@ucw.cz>
3 # (c) 2009--2017 Pavel Charvat <pchar@ucw.cz>
6 # PKG name of the package
7 # ROOT absolute path to the root of the source tree
8 # PKGVER custom package version
10 unset PKG ROOT SRCVER VER PKG_NO_CHECKOUT
12 function pkg-git-version {
13 if [ -z "$PKG_NO_CHECKOUT" ] ; then
14 TREEVER=`git describe --tags | sed 's/^v//;s/[a-f]$/&-0/'`
15 TREEHASH=`git rev-parse --verify HEAD`
20 VER=${PKGVER:-$TREEVER}
21 SRCVER=${PKGVER:-$VER}
24 ### Source tree version: $TREEVER
25 ### Source tree hash: $TREEHASH
26 ### Debian binary package version: $VER
27 ### Debian source package version: $SRCVER
29 ### Hey, did you commit everything? Or added it to the index?
35 function pkg-git-checkout {
36 BUILDDIR=debian-tmp/$PKG-$SRCVER
37 if [ -z "$PKG_NO_CHECKOUT" ] ; then
40 git checkout-index -a --prefix=$BUILDDIR/
44 function pkg-fake-changelog {
45 echo "Creating automatic changelogs for package $PKG version $VER"
50 dch --changelog $CL --create --package $PKG --newversion $VER "Automatic release. See /usr/share/doc/$PKG/changelog for the true story."
51 dch --changelog $CL --release
52 sed -i '/Initial release/d' $CL
56 function pkg-cleanup {
57 echo -n "Press return to delete temp files... "
59 rm -rf $ROOT/debian-tmp
62 function pkg-get-files {
64 echo "Generated files:"
69 FILES="$FILES${FILES:+,}$F"
70 FILES_ARY[${#FILES_ARY[@]}]="$F"
74 if [ -z "$FILES" ] ; then