File: rules

package info (click to toggle)
gnubg 1.06.002-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 26,604 kB
  • sloc: ansic: 97,578; xml: 15,136; sh: 4,919; yacc: 700; makefile: 581; python: 573; lex: 297; sql: 238; awk: 26
file content (124 lines) | stat: -rwxr-xr-x 4,771 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/make -f

# Get SOURCE_DATE_EPOCH.
include /usr/share/dpkg/pkg-info.mk

# Enable compiler hardening flags.
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Add --as-needed to drop a few unnecessary dependencies.
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

# Determine the build date from SOURCE_DATE_EPOCH, putting it back into the
# same format as the __DATE__ C preprocessor define.
BUILD_DATE := $(shell LC_ALL=C date -d'@$(SOURCE_DATE_EPOCH)' +'%b %e %Y')

# Replace the following upstream-supplied GCC probes with the latest
# versions from the autoconf-archive package, since otherwise i386 CPU
# detection fails on the buildds and the package can't be built.  Replace
# upstream glib-gettext.m4 for compatibility with newer glib.
REPLACE_M4 = ax_ext.m4 ax_gcc_x86_avx_xgetbv.m4 ax_gcc_x86_cpuid.m4 \
	glib-gettext.m4

# Only build with SSE on amd64.  We can't assume that processor for i386,
# and it fails to build on ia64 since GCC there doesn't support -msse or
# -msse2 (as of 2010-01-17).
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
ifeq ($(DEB_HOST_ARCH_CPU),amd64)
    SSE = --enable-simd=sse2
else
    SSE = --enable-simd=no
endif

%:
	dh $@

# Replace the upstream-supplied GCC probes with the latest versions from the
# autoconf-archive package, since otherwise i386 CPU detection fails on the
# buildds and the package can't be built.
override_dh_autoreconf:
	set -e; for m4 in $(REPLACE_M4); do		\
	    mv m4/"$$m4" m4/"$$m4".old;			\
	    cp /usr/share/aclocal/"$$m4" m4/"$$m4";	\
	done
	dh_autoreconf --as-needed

# Override BUILD_DATE based on the debian/changelog date so that we have
# reproducible builds.
override_dh_auto_configure:
	dh_auto_configure -- --with-gtk --with-board3d --with-sqlite \
	    --with-python=/usr/bin/python3 --enable-threads $(SSE)
	echo '#define BUILD_DATE $(BUILD_DATE)' >> config.h

# Disable building the rollout databases during an architecture-specific
# build.  It takes too long and is too large.  We'll instead build the
# one-sided database only during an arch-independent build and buid the
# two-sided database during installation.
override_dh_auto_build-arch:
	echo 'stop' > gnubg_ts0.bd
	echo 'stop' > gnubg_os0.bd
	dh_auto_build

override_dh_auto_build-indep:
	echo 'stop' > gnubg_ts0.bd
	rm -f gnubg_os0.bd
	dh_auto_build

override_dh_auto_install:
	$(MAKE) install DESTDIR=$(CURDIR)/debian/gnubg
	rm debian/gnubg/usr/share/gnubg/gnubg_ts0.bd
	rm -r debian/gnubg/usr/share/gnubg/fonts
	gunzip debian/gnubg/usr/share/man/man6/*.6.gz
	perl -i -pe 's/^(gnubg\s+)-(bcd\S+)/$$1\\fB\\-$$2\\fR/' \
	    debian/gnubg/usr/share/man/man6/gnubg.6
	mv debian/gnubg/usr/bin debian/gnubg/usr/games
	install -d debian/gnubg/usr/share/applications
	install -m 644 debian/gnubg.desktop \
	    debian/gnubg/usr/share/applications/gnubg.desktop
	install -d debian/gnubg/var/lib/gnubg
	install -d debian/gnubg/usr/lib/gnubg
	install -d debian/gnubg-data/usr/share
	mv debian/gnubg/usr/share/gnubg debian/gnubg-data/usr/share/
	mv debian/gnubg/usr/share/doc debian/gnubg-data/usr/share/
	mv debian/gnubg-data/usr/share/gnubg/gnubg.wd \
	    debian/gnubg/usr/lib/gnubg/gnubg.wd
	install -d debian/gnubg/usr/share/gnubg
	ln -s /usr/lib/gnubg/gnubg.wd \
	    debian/gnubg/usr/share/gnubg/gnubg.wd
	mv debian/gnubg/usr/share/locale debian/gnubg-data/usr/share/
	install -d debian/gnubg-data/usr/share/gnubg/fonts
	ln -s ../../fonts/truetype/dejavu/DejaVuSans.ttf \
	    debian/gnubg-data/usr/share/gnubg/fonts/Vera.ttf
	ln -s ../../fonts/truetype/dejavu/DejaVuSans-Bold.ttf \
	    debian/gnubg-data/usr/share/gnubg/fonts/VeraBd.ttf
	ln -s ../../fonts/truetype/dejavu/DejaVuSerif-Bold.ttf \
	    debian/gnubg-data/usr/share/gnubg/fonts/VeraSeBd.ttf
	install -d debian/gnubg/usr/share/doc/gnubg/examples
	mv debian/gnubg-data/usr/share/gnubg/scripts/query_player.sh \
	    debian/gnubg/usr/share/doc/gnubg/examples/

override_dh_installmenu:
	mkdir -p debian/gnubg/usr/share/pixmaps
	gm convert debian/gnubg/usr/share/icons/hicolor/16x16/apps/gnubg.png \
	    debian/gnubg/usr/share/pixmaps/gnubg_16x16.xpm
	gm convert debian/gnubg/usr/share/icons/hicolor/32x32/apps/gnubg.png \
	    debian/gnubg/usr/share/pixmaps/gnubg_32x32.xpm
	dh_installmenu

override_dh_installchangelogs:
	dh_installchangelogs -i ChangeLog
	dh_installchangelogs -a -XChangeLog
	[ ! -f debian/gnubg-data/usr/share/doc/gnubg-data/changelog ] \
	    || mv debian/gnubg-data/usr/share/doc/gnubg-data/changelog \
		debian/gnubg-data/usr/share/doc/gnubg/changelog

# Do not compress the PDF documentation.
override_dh_compress:
	dh_compress -X.pdf

# Replace the upstream M4 files.
override_dh_clean:
	dh_clean
	set -e; for m4 in $(REPLACE_M4); do				\
	    [ ! -f m4/"$$m4".old ] || mv m4/"$$m4".old m4/"$$m4";	\
	done