File: rules

package info (click to toggle)
gnugo 3.8-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 17,312 kB
  • ctags: 4,228
  • sloc: ansic: 56,439; perl: 3,771; lisp: 2,789; sh: 730; makefile: 700; python: 682; awk: 113; sed: 22
file content (81 lines) | stat: -rwxr-xr-x 2,894 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
#!/usr/bin/make -f

testdir  = test -f engine/gnugo.h && test -f debian/rules
testroot = test x`whoami` = xroot

# FOR AUTOCONF 2.52 AND NEWER ONLY
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
else
	CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
CONFFLAGS += --with-readline

CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
export CFLAGS

clean:
	$(testdir)
	rm -f  build
	[ ! -f Makefile ] || $(MAKE) distclean
	-cat `ls -r debian/patches/*.diff` /dev/null | patch -RENtp1 -r debian/rejected --no-backup-if-mismatch
	rm -f  debian/files debian/rejected debian/substvars doc/gnugo.info* doc/*.html
	rm -fr debian/gnugo

build:
	$(testdir)
	-cat debian/patches/*.diff | patch -Ntp1 -r debian/rejected --no-backup-if-mismatch
	./configure $(CONFFLAGS) --prefix=/usr --bindir=/usr/games --infodir=/usr/share/info --mandir=/usr/share/man
	$(MAKE)
#ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
#	$(MAKE) check
#endif
# Add build-deps texinfo and tetex-bin if you enable this!
#	$(MAKE) -C doc gnugo.ps
	cd doc && texi2html --split=chapter --output=. --Verbose gnugo.texi
	touch $@

binary: binary-arch

binary-indep:

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

	$(MAKE) install DESTDIR=${CURDIR}/debian/gnugo
	rm -f debian/gnugo/usr/share/info/dir*
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	strip -R .comment -R .note debian/gnugo/usr/games/gnugo
endif
	install -D -p -m 0644 debian/gnugo.el-* debian/gnugo/usr/share/emacs/site-lisp/gnugo.el
	install -D -p -m 0644 ChangeLog debian/gnugo/usr/share/doc/gnugo/changelog
	install -D -p -m 0644 debian/changelog debian/gnugo/usr/share/doc/gnugo/changelog.Debian
	install -D -p -m 0644 debian/menu debian/gnugo/usr/share/menu/gnugo
	install    -p -m 0644 AUTHORS NEWS README THANKS TODO debian/copyright debian/gnugo/usr/share/doc/gnugo
#	install    -p -m 0644 doc/gnugo.ps debian/gnugo/usr/share/doc/gnugo
	install -d -p -m 0755 debian/gnugo/usr/share/doc/gnugo/html
	install    -p -m 0644 doc/*.html doc/*.png debian/gnugo/usr/share/doc/gnugo/html
	ln -s gnugo.html debian/gnugo/usr/share/doc/gnugo/html/index.html

	find debian/gnugo/usr/share/doc -type f \( -size +8 -o -name 'changelog*' \) ! -path '*/html/*' -print0 | xargs -0 gzip -9n
	find debian/gnugo/usr/share/info debian/gnugo/usr/share/man -type f -print0 | xargs -0 gzip -9n

	install -d -p -m 0755 debian/gnugo/DEBIAN
	install    -p -m 0755 debian/postinst debian/postrm debian/gnugo/DEBIAN
	cd debian/gnugo && find usr -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums

	chmod -R u+w,go=u-w debian/gnugo

	dpkg-shlibdeps debian/gnugo/usr/games/gnugo
	dpkg-gencontrol -pgnugo -Pdebian/gnugo
	chmod 0644 debian/gnugo/DEBIAN/control
	dpkg --build debian/gnugo ..

.PHONY: clean binary binary-arch binary-indep