1 # A library of shell functions for building of Debian packages
2 # (c) 2008--2009 Martin Mares <mj@ucw.cz>
3 # (c) 2009--2013 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
12 function pkg-git-version {
13 TREEVER=`git describe | sed 's/^v//;s/[a-f]$/&-0/'`
14 TREEHASH=`git rev-parse --verify HEAD`
15 VER=${PKGVER:-$TREEVER}
16 SRCVER=${PKGVER:-$VER}
19 ### Source tree version: $TREEVER
20 ### Source tree hash: $TREEHASH
21 ### Debian binary package version: $VER
22 ### Debian source package version: $SRCVER
24 ### Hey, did you commit everything? Or added it to the index?
30 function pkg-git-checkout {
31 BUILDDIR=debian-tmp/$PKG-$SRCVER
34 git checkout-index -a --prefix=$BUILDDIR/
37 function pkg-fake-changelog {
38 echo "Creating automatic changelogs for package $PKG version $VER"
43 dch --changelog $CL --create --package $PKG --newversion $VER "Automatic release. See /usr/share/doc/$PKG/changelog for the true story."
44 dch --changelog $CL --release
45 sed -i '/Initial release/d' $CL
49 function pkg-cleanup {
50 echo -n "Press return to delete temp files... "
52 rm -rf $ROOT/debian-tmp
55 function pkg-get-files {
57 echo "Generated files:"
62 FILES="$FILES${FILES:+,}$F"
63 FILES_ARY[${#FILES_ARY[@]}]="$F"
67 if [ -z "$FILES" ] ; then