!/bin/sh TAG="$1" VERSION="$(echo "$TAG" | sed -e 's/^[^0-9]*-//; s/_/./g;')" ARCHIVE="/APT" BUILD_DIR="$(mktemp -t -d hylafax-deb-XXXXXXXXXXX)" cd "$BUILD_DIR" git archive --format=tar --remote=git://git.hylafax.org/HylaFAX --prefix=source/ "$TAG" | tar xvf - cd source cat <<_END_OF_PATCH_ | patch debian/changelog 0a1,6 > hylafax (2:$VERSION) unstable; urgency=low > > * Automatically built from GIT > > -- Aidan Van Dyk $TSTAMP > _END_OF_PATCH_ cat <<_END_OF_PATCH_ | patch debian/control 2c2 < Maintainer: Giuseppe Sacco --- > Maintainer: Aidan Van Dyk _END_OF_PATCH_ echo "$VERSION" > VERSION make -f debian/rules configure make -f debian/rules build fakeroot make -f debian/rules binary cp ../hylafax*_$VERSION_*.deb "$ARCHIVE" rm -Rf "$BUILD_DIR"