File: rules

package info (click to toggle)
maelstrom 1.4.3-L3.0.6%2Bmain-8
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 4,364 kB
  • ctags: 2,284
  • sloc: cpp: 10,822; ansic: 2,779; sh: 2,680; makefile: 196
file content (96 lines) | stat: -rwxr-xr-x 2,881 bytes parent folder | download | duplicates (2)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/make -f

TMPDIR=maelstrom
BINDIR=debian/${TMPDIR}/usr/games
LIBDIR=debian/${TMPDIR}/usr/lib/games/maelstrom
BMPDIR=debian/${TMPDIR}/usr/share/games/maelstrom
DOCDIR=debian/${TMPDIR}/usr/share/doc/maelstrom
MANDIR=debian/${TMPDIR}/usr/share/man
DESKTOPDIR=debian/${TMPDIR}/usr/share/applications

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_BUILD_HARDENING=1

CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wall
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) -Wall
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

build-arch: build
build-indep: build

build:
	cp /usr/share/misc/config.guess .
	cp /usr/share/misc/config.sub .
	./configure CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
	$(MAKE)
	touch build

clean:
	rm -f build
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f config.guess
	rm -f config.sub
	dh_clean

binary-indep:

binary-arch: build
	dh_prep
	dh_installdirs
	$(MAKE) install prefix=`pwd`/debian/maelstrom/usr
#move lib files
	mv ${BINDIR}/Images ${BMPDIR}
	mv ${BINDIR}/icon.* ${BMPDIR}
	mv ${BINDIR}/Maelstrom_* ${LIBDIR}
	cp icon32.* ${BMPDIR}
	sh debian/handle_underscores ${BMPDIR}
	sh debian/handle_underscores ${LIBDIR}
#these are not needed
	rm -f ${BINDIR}/macres
	rm -f ${BINDIR}/playwave
	rm -f ${BINDIR}/snd2wav
# highscores should be in /var/games this is handled by postinst and
# postrm as highscore files shouldn't be overwritten during updates etc.
	mv ${BINDIR}/Maelstrom-Scores ${LIBDIR}/Maelstrom-Scores.debian
	chmod 644 ${LIBDIR}/Maelstrom-Scores.debian
	rm -f ${BMPDIR}/Images/Makefile*
# menu entry
	dh_installmenu
	install -p -m 644 debian/maelstrom.desktop ${DESKTOPDIR}
# documentation
	install -p -m 644 Docs/*FAQ ${DOCDIR}
	install -p -m 644 Docs/Maelstrom-Announce ${DOCDIR}
	install -p -m 644 Docs/MaelstromGPL_press_release ${DOCDIR}
	install -p -m 644 Docs/Quotes ${DOCDIR}
	install -p -m 644 Docs/RSA.README ${DOCDIR}
	install -p -m 644 Docs/*.Paper ${DOCDIR}
	install -p -m 644 Docs/Technical_Notes* ${DOCDIR}
	install -p -m 644 Changelog ${DOCDIR}/changelog
	install -p -m 644 CREDITS ${DOCDIR}
	install -p -m 644 debian/changelog ${DOCDIR}/changelog.Debian
	gzip -9n ${DOCDIR}/*
	install -p -m 644 README ${DOCDIR}
	install -p -m 644 README.options ${DOCDIR}
	install -p -m 644 README.network ${DOCDIR}
	install -p -m 644 README.joystick ${DOCDIR}
	install -p -m 644 debian/copyright ${DOCDIR}
# man pages
	install -p -m 644 debian/maelstrom.6 ${MANDIR}/man6/Maelstrom.6
	gzip -9n ${MANDIR}/man6/Maelstrom.6
# install scripts
	dh_installdeb
	dh_link
	dh_fixperms
	chown root:games ${BINDIR}/Maelstrom
	chmod 2755 ${BINDIR}/Maelstrom
	dh_strip
# generate dependencies
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean