New upstream version.
[sgt-puzzles/ydirson.git] / debian / rules
blob30c4b34cdcfccaf823cf5717427e6c8e4b327dfb
1 #!/usr/bin/make -f
3 build : Makefile
4 DEBIAN_REVISION="$$(dpkg-parsechangelog | sed 's/^Version: [^-]*-//; t; d')" && \
5 [ -n "$$DEBIAN_REVISION" ] && \
6 make "VER=$$(cat version.def) -DDEBIAN_REVISION=\"\\\"$$DEBIAN_REVISION\\\"\""
7 make -f Makefile.doc
9 # We patch these sources and so must rebuild the Makefile.
10 Makefile : mkfiles.pl Recipe
11 ./mkfiles.pl
13 binary : binary-arch binary-indep
15 binary-arch : build
16 dh_testroot
17 mkdir -p debian/sgt-puzzles/usr/games
18 make DESTDIR=debian/sgt-puzzles install
19 dh_strip
20 dh_shlibdeps
21 mkdir -p debian/sgt-puzzles/usr/share/doc/sgt-puzzles
22 cat debian/copyright-prefix LICENCE \
23 > debian/sgt-puzzles/usr/share/doc/sgt-puzzles/copyright
24 dh_installchangelogs
25 dh_installdocs
26 mkdir -p debian/sgt-puzzles/usr/share/man/man6
27 install -m644 *.6 debian/sgt-puzzles/usr/share/man/man6
28 dh_compress
29 dh_fixperms
30 dh_installmenu
31 dh_installdeb
32 dh_gencontrol
33 dh_builddeb
35 binary-indep :
37 clean :
38 make clean
39 dh_clean *.6 debian/substvars
41 # The canonical source location is
42 # http://www.chiark.greenend.org.uk/~sgtatham/puzzles/puzzles.tar.gz
43 # but this redirects to puzzles-$version.tar.gz. We get the version
44 # number (really a Subversion revision number) by scanning wget's
45 # output.
46 get-orig-source :
47 revision=$$(wget http://www.chiark.greenend.org.uk/~sgtatham/puzzles/puzzles.tar.gz 2>&1 | sed 's/^ *=> `puzzles-r\([0-9]*\)\.tar\.gz'\''$$/\1/; t; d') && \
48 [ -n "$$revision" ] && \
49 echo "Creating sgt-puzzles_$$revision.orig.tar.gz" && \
50 tar xzf puzzles-r$$revision.tar.gz && \
51 mv puzzles-r$$revision sgt-puzzles-$$revision.orig && \
52 tar cf - sgt-puzzles-$$revision.orig | gzip -c -9 \
53 > sgt-puzzles_$$revision.orig.tar.gz && \
54 rm -rf puzzles-r$$revision.tar.gz sgt-puzzles-$$revision.orig
56 source : clean
57 dir=$$(basename $$PWD) && \
58 cd .. && \
59 dpkg-source -b -i'(^|/)(Makefile|puzzles\.(cnt|hlp|txt))$$' $$dir