File: rules

package info (click to toggle)
pachi 1%3A1.0-7
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 16,552 kB
  • ctags: 370
  • sloc: ansic: 2,739; sh: 353; makefile: 186; cpp: 69
file content (97 lines) | stat: -rwxr-xr-x 3,275 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/make -f

testdir   = test -f src/faes.cpp && test -f debian/rules
testroot  = test x`whoami` = xroot

# FOR AUTOCONF 2.13 ONLY
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	CONFFLAGS += $(DEB_HOST_GNU_TYPE)
else
	CONFFLAGS += --host $(DEB_BUILD_GNU_TYPE) --build $(DEB_HOST_GNU_TYPE)
endif

CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS  = $(shell dpkg-buildflags --get LDFLAGS)
export CPPFLAGS
export CXXFLAGS
export LDFLAGS

clean:
	$(testdir)
	rm -f build-stamp debian/files debian/substvars
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -rf debian/pachi debian/pachi-data

build: build-arch build-indep

build-arch: build-stamp

build-indep: build-stamp

build-stamp: configure
	$(testdir)
	SCOREDIR=/var/games/pachi ./configure $(CONFFLAGS) --prefix=/usr --bindir=/usr/games
	$(MAKE)
	touch $@

binary: binary-arch binary-indep

binary-arch: build
	$(testdir)
	$(testroot)
	rm -rf debian/pachi

	$(MAKE) install DESTDIR=$(CURDIR)/debian/pachi
	rm -rf debian/pachi/var/games/pachi/data/scores.dat \
		debian/pachi/usr/share/pachi \
		debian/pachi/usr/share/doc/pachi/ChangeLog \
		debian/pachi/usr/share/doc/pachi/License.txt

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	strip -R .comment -R .note debian/pachi/usr/games/pachi
endif

	install -D -p -m 0644 debian/menu      debian/pachi/usr/share/menu/pachi
	install -D -p -m 0644 debian/pachi.6   debian/pachi/usr/share/man/man6/pachi.6
	install -D -p -m 0644 debian/changelog debian/pachi/usr/share/doc/pachi/changelog.Debian
	install -D -p -m 0644 ChangeLog        debian/pachi/usr/share/doc/pachi/changelog
	install    -p -m 0644 debian/copyright debian/pachi/usr/share/doc/pachi
	install -D -p -m 0644 debian/control   debian/pachi/DEBIAN/control
	install    -p -m 0755 debian/postinst debian/postrm debian/pachi/DEBIAN

	gzip -9 debian/pachi/usr/share/doc/pachi/changelog* debian/pachi/usr/share/man/man6/pachi.6
	cd debian/pachi && find usr -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums

	dpkg-shlibdeps debian/pachi/usr/games/pachi
	dpkg-gencontrol -isp -ppachi -Pdebian/pachi
	chown -R root:root debian/pachi
	chmod -R go=u-w debian/pachi
	chown root:games debian/pachi/usr/games/pachi
	chmod 2755 debian/pachi/usr/games/pachi
	dpkg --build debian/pachi ..

binary-indep: build
	$(testdir)
	$(testroot)
	rm -rf debian/pachi-data

	$(MAKE) install DESTDIR=$(CURDIR)/debian/pachi-data
	rm -rf debian/pachi-data/var \
		debian/pachi-data/usr/games \
		debian/pachi-data/usr/share/doc

	install -D -p -m 0644 debian/changelog debian/pachi-data/usr/share/doc/pachi-data/changelog.Debian
	install -D -p -m 0644 ChangeLog        debian/pachi-data/usr/share/doc/pachi-data/changelog
	install    -p -m 0644 debian/copyright debian/pachi-data/usr/share/doc/pachi-data
	install -D -p -m 0644 debian/control   debian/pachi-data/DEBIAN/control

	gzip -9 debian/pachi-data/usr/share/doc/pachi-data/changelog*
	cd debian/pachi-data && find usr -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums

	dpkg-gencontrol -isp -ppachi-data -Pdebian/pachi-data
	chown -R root:root debian/pachi-data
	chmod -R go=u-w debian/pachi-data
	dpkg --build debian/pachi-data ..

.PHONY: clean build build-arch build-indep binary binary-arch binary-indep