File: rules

package info (click to toggle)
crystalspace 0.94-20020412-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 62,276 kB
  • ctags: 52,843
  • sloc: cpp: 274,783; ansic: 6,608; perl: 6,276; objc: 3,952; asm: 2,942; python: 2,354; php: 542; pascal: 530; sh: 430; makefile: 370; awk: 193
file content (195 lines) | stat: -rwxr-xr-x 5,390 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. 
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.

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

# This is the debhelper compatability version to use.
export DH_COMPAT=3

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.
	# Activate all plugins
	perl -pi -e "s/^#PLUGINS/PLUGINS/" $(CURDIR)/CS/mk/user.mak
	cd CS; make linux
	# Make it not cpu specific (Intel)
	# CPU=i386 make linux (this was too intel specific)
	perl -pi -e "s/CFLAGS.SYSTEM.*mcpu.*\n//" $(CURDIR)/CS/config.mak
	# Force -fPIC as compiling/linking option
	perl -pi -e "s/(CC.*)/\1 -fPIC/" $(CURDIR)/CS/config.mak
	perl -pi -e "s/(CXX.*)/\1 -fPIC/" $(CURDIR)/CS/config.mak
	perl -pi -e "s/(LINK.*)/\1 -fPIC/" $(CURDIR)/CS/config.mak
	# Install as much as possible
	perl -pi -e "s/#TO_INSTALL/TO_INSTALL/" $(CURDIR)/CS/cache.mak
	# Activating scripts
	chmod +x $(CURDIR)/debian/createmenus
	chmod +x $(CURDIR)/debian/addmissing
	chmod +x $(CURDIR)/debian/automan
	# Creating menus
	$(CURDIR)/debian/createmenus $(CURDIR)

	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir

	# Add here commands to compile the package.
	cd CS; $(MAKE) all

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	-cd $(CURDIR)/CS; $(MAKE) clean
	-cd $(CURDIR)/CS; $(MAKE) distclean
	rm -f $(CURDIR)/CS/cache.mak
	rm -f $(CURDIR)/CS/config.mak

	dh_clean

DEVBIN=3ds2lev map2cs mdl2spr \
	csfedit csfgen cslight picview scfreg viewmesh vsh \
	cs-config

install: DH_OPTIONS=
install: build 
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/crystalspace.
	mkdir -p $(CURDIR)/debian/tmp/usr/lib/crystalspace
	cd CS; $(MAKE) install INSTALL_DIR=$(CURDIR)/debian/tmp/usr/lib/crystalspace
	# Let's fix some things
	$(CURDIR)/debian/addmissing $(CURDIR)

	find $(CURDIR)/debian/tmp/usr/lib/crystalspace/include -type f \
		-exec chmod 644 {} \;
	chmod +x \
	$(CURDIR)/debian/tmp/usr/lib/crystalspace/scripts/python/cssh.py
	chmod +x \
	$(CURDIR)/debian/tmp/usr/lib/crystalspace/scripts/python/pysimp.py
	
	# Move to respect Debian Policy

	# dev binaries in /usr/bin
	mkdir -p $(CURDIR)/debian/tmp/usr/bin
	mv $(addprefix $(CURDIR)/debian/tmp/usr/lib/crystalspace/bin/,\
		 $(DEVBIN))\
		$(CURDIR)/debian/tmp/usr/bin
	# renaming picview because of name conflict with picview package
	mv $(CURDIR)/debian/tmp/usr/bin/picview \
		$(CURDIR)/debian/tmp/usr/bin/cspicview
	# From Loic Dachary (fix for cs-config)
	perl -pi -e 's:^prefix=.*:prefix=/usr:' $(CURDIR)/debian/tmp/usr/bin/cs-config
	perl -pi -e 's:^includedir=.*:includedir=/usr/include/crystalspace:' $(CURDIR)/debian/tmp/usr/bin/cs-config
	perl -pi -e 's:libdir=.*:libdir=/usr/lib/crystalspace/lib:' $(CURDIR)/debian/tmp/usr/bin/cs-config

	# demos binaries in /usr/games
	mkdir -p $(CURDIR)/debian/tmp/usr/games
	mv $(CURDIR)/debian/tmp/usr/lib/crystalspace/bin/* \
		$(CURDIR)/debian/tmp/usr/games

	# includes in /usr/include/crystalspace
	mkdir -p $(CURDIR)/debian/tmp/usr/include
	mv $(CURDIR)/debian/tmp/usr/lib/crystalspace/include \
		$(CURDIR)/debian/tmp/usr/include/crystalspace

	dh_movefiles

	# Adding home made xpm
	cp $(CURDIR)/debian/xpm/*.xpm \
		$(CURDIR)/debian/crystalspace-demos/usr/share/pixmaps

	# Autogenerate man
	$(CURDIR)/debian/automan $(CURDIR)
	$(CURDIR)/debian/rules man
	rm -f $(CURDIR)/debian/man/*.sgml.?
	dh_installman -p crystalspace-demos $(CURDIR)/debian/man/*.6
	dh_installman -p crystalspace-dev $(CURDIR)/debian/man/*.1

%.xpm: %.jpg
	convert -size 32x32 $< $@
	mogrify -format xpm -geometry 32x32 -map /usr/X11R6/include/X11/pixmaps/cmap.xpm $@

man: $(subst .sgml,, $(wildcard $(CURDIR)/debian/man/*.sgml*))
%.1: %.sgml.1
	@echo "Creating $(notdir $@)"
	@docbook-to-man $< > $@
%.6: %.sgml.6
	@echo "Creating $(notdir $@)"
	@docbook-to-man $< > $@

# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
#	dh_installdebconf -i
	dh_installdocs -i
	dh_installexamples -i
	dh_installmenu -i
#	dh_installlogrotate -i
#	dh_installemacsen -i
#	dh_installpam -i
#	dh_installmime -i
#	dh_installinit -i
	dh_installcron -i
#	dh_installman -i
	dh_installinfo -i
#	dh_undocumented -i
	dh_installchangelogs  -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
#	dh_perl -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir 
	dh_testroot 
#	dh_installdebconf 
	dh_installdocs 
	dh_installexamples 
	dh_installmenu 
#	dh_installlogrotate 
#	dh_installemacsen
#	dh_installpam 
#	dh_installmime 
#	dh_installinit
#	dh_installcron
	dh_installman
	dh_installinfo
#	dh_undocumented
	dh_installchangelogs 
	dh_strip 
	dh_link
	dh_compress
	dh_fixperms 
	dh_makeshlibs 
	dh_installdeb 
#	dh_perl
	dh_shlibdeps -l$(CURDIR)/debian/usr/lib/crystalspace/lib
	dh_gencontrol
	dh_md5sums 
	dh_builddeb 

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