File: rules

package info (click to toggle)
sgt-puzzles 7983-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,792 kB
  • ctags: 4,927
  • sloc: ansic: 65,310; perl: 1,527; objc: 1,206; makefile: 152; sh: 23
file content (76 lines) | stat: -rwxr-xr-x 2,525 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/make -f

include /usr/share/quilt/quilt.make

DEBIAN_VERSION := $(shell dpkg-parsechangelog | sed -r 's/^Version: //; t; d')
UPSTREAM_VERSION := $(shell echo $(DEBIAN_VERSION) | sed -r 's/^[0-9]*://; s/-[^-]*$$//')

build: build-indep build-arch

build-indep: build-indep-stamp
build-indep-stamp:
	touch build-indep-stamp

build-arch: build-arch-stamp
build-arch-stamp: Makefile
	make "VER=-DREVISION=$(UPSTREAM_VERSION)" \
	    "XFLAGS=-DDEBIAN_VERSION=\"\\\"$(DEBIAN_VERSION)\\\"\" -DHELP_BROWSER_PATH=\"\\\"yelp:khelpcenter:sensible-browser\\\"\""
	$(MAKE) -f Makefile.doc
	touch build-arch-stamp

# We patch these sources and so must rebuild the Makefile.
Makefile : $(QUILT_STAMPFN) mkfiles.pl Recipe
	./mkfiles.pl

binary : binary-arch binary-indep

binary-arch : build
	dh_testroot
	mkdir -p -m755 debian/sgt-puzzles/usr/games
	$(MAKE) DESTDIR=debian/sgt-puzzles install
	dh_strip
	dh_shlibdeps
	mkdir -p -m755 debian/sgt-puzzles/usr/share/sgt-puzzles/help
	install -m644 *.html debian/sgt-puzzles/usr/share/sgt-puzzles/help
	mkdir -p -m755 debian/sgt-puzzles/usr/share/doc/sgt-puzzles
	cp debian/copyright-prefix \
	    debian/sgt-puzzles/usr/share/doc/sgt-puzzles/copyright
	iconv -f iso8859-1 -t utf-8 < LICENCE \
	    >> debian/sgt-puzzles/usr/share/doc/sgt-puzzles/copyright
	ln -sf ../../sgt-puzzles/help \
	    debian/sgt-puzzles/usr/share/doc/sgt-puzzles/html
	dh_installchangelogs
	dh_installdocs
	mkdir -p -m755 debian/sgt-puzzles/usr/share/man/man6
	install -m644 *.6 debian/sgt-puzzles/usr/share/man/man6
	dh_compress
	dh_fixperms
	dh_installmenu
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-indep :

clean : unpatch

unpatch : delete

delete :
	! [ -f Makefile ] || $(MAKE) clean
	$(MAKE) -f Makefile.doc clean
	dh_clean list.c Makefile Makefile.cyg Makefile.osx Makefile.vc Makefile.wce wingames.lst debian/substvars

# The canonical source location is
# http://www.chiark.greenend.org.uk/~sgtatham/puzzles/puzzles.tar.gz
# but this redirects to puzzles-$version.tar.gz.  We get the version
# number (really a Subversion revision number) by scanning wget's
# output.
get-orig-source :
	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') && \
        [ -n "$$revision" ] && \
	echo "Creating sgt-puzzles_$$revision.orig.tar.gz" && \
	mv puzzles-r$$revision.tar.gz sgt-puzzles_$$revision.orig.tar.gz

.PHONY : build binary binary-arch binary-dep clean delete get-orig-source