File: rules

package info (click to toggle)
ppracer 0.3.1-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,900 kB
  • ctags: 3,046
  • sloc: cpp: 24,190; sh: 3,544; tcl: 2,450; makefile: 608; lisp: 87
file content (150 lines) | stat: -rwxr-xr-x 4,710 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)


CFLAGS = -Wall -g

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

.NOTPARALLEL: patch unpatch

config.status: patch configure
	dh_testdir
	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --with-data-dir=\$${prefix}/share/games/ppracer

build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp:  config.status
	# compile the binary
	$(MAKE)
	# create the manpages
	/usr/bin/docbook-to-man debian/ppracer.6.sgml > ppracer.6
	/usr/bin/docbook-to-man debian/ppracer.6.de.sgml > ppracer.de.6
	# uudecode the menuicons
	for icon in $(shell ls debian/icons/*.uu) ; do \
		/usr/bin/uudecode $$icon ; \
	done
	mv ppracer-*.png debian/icons/
	touch build-arch-stamp

build-indep: build-indep-stamp
build-indep-stamp:  config.status
	touch build-indep-stamp


clean:  clean-patched
#unpatch
clean-patched:
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#
	-$(MAKE) distclean
	# remove temporary directory used for the additional documentation in the -data package 
	rm -rf debian/docs-data/
	dh_clean ppracer.6 ppracer.de.6 icons/*.png


patch: patch-stamp
patch-stamp:
	dpatch apply-all

unpatch:
	dpatch deapply-all
	rm -rf patch-stamp debian/patched


install: install-indep install-arch
install-indep:
	dh_testdir
	dh_testroot
	dh_clean -k -i 
	dh_installdirs -i
	##
	## planetpenguin-racer-gimp-dev
	##
	# the scripts and paletes for the gimp-dev package
	dh_install -pplanetpenguin-racer-gimp-dev contrib/palettes/* /usr/share/gimp/2.0/palettes/
	dh_install -pplanetpenguin-racer-gimp-dev contrib/script-fu/* /usr/share/gimp/2.0/scripts/
	##
	## planetpenguin-racer-data
	##
	# install the game data
	dh_install -pplanetpenguin-racer-data --exclude=FreeSansBoldOblique.ttf --exclude=Makefile --exclude=README --exclude=readme data/* /usr/share/games/ppracer/
	# install link for the font
	dh_installdirs -pplanetpenguin-racer-data usr/share/games/ppracer/fonts/
	dh_link -pplanetpenguin-racer-data /usr/share/fonts/truetype/freefont/FreeSansBoldOblique.ttf usr/share/games/ppracer/fonts/FreeSansBoldOblique.ttf
	# installing linda overrides for the font
	dh_install -pplanetpenguin-racer-data debian/ppracer.linda-overrides usr/share/linda/overrides/
	mv debian/planetpenguin-racer-data/usr/share/linda/overrides/ppracer.linda-overrides debian/planetpenguin-racer-data/usr/share/linda/overrides/ppracer
	# the herring run event contains some addiontal documentation, let's install them, too
	# first in a temporary directory...
	mkdir -p debian/docs-data/herring_run
	for HAS_DOC in $(shell find data/courses/events/herring_run/ -iname readme | cut --delimiter=/ --fields=5) ; do \
		cp -af data/courses/events/herring_run/$$HAS_DOC/[rR][eE][aA][dD][mM][eE] debian/docs-data/herring_run/README.$$HAS_DOC ; \
	done
	# and a bit documentation about the ingame music. Put that in the temporary doc-dir, too
	cp -af data/music/readme debian/docs-data/README.music
	# and now install it to the -data package
	dh_installdocs -pplanetpenguin-racer-data debian/docs-data/*


install-arch:
	dh_testdir
	dh_testroot
	dh_clean -k -s 
	dh_installdirs -s
	##
	## planetpenguin-racer
	##
	dh_install -s src/ppracer /usr/games/
	dh_install -s debian/ppracer.desktop /usr/share/applications/
	dh_installman -s ppracer.6 ppracer.de.6
	dh_installdocs -s AUTHORS
	# now let's install all the icons...
	dh_install -s --exclude=.uu debian/icons/* /usr/share/pixmaps         


binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installmenu
	dh_desktop
	dh_installman
	dh_link
	dh_strip
	dh_compress 
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

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