File: rules

package info (click to toggle)
dvb 0.9.4.20020321-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,068 kB
  • ctags: 5,791
  • sloc: ansic: 32,844; cpp: 13,679; xml: 9,017; makefile: 567; sh: 330; asm: 92
file content (258 lines) | stat: -rwxr-xr-x 8,642 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
#!/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

SHELL=/bin/bash

configure: configure-stamp
configure-stamp:
	dh_testdir
	cd debian; cp control.big control
	# Add here commands to configure the package.
	touch configure-stamp

docs-stamp:
	cd doc/dvbapi ; yes "" | make
	touch docs-stamp

mpegtools-stamp:
	cd apps/mpegtools/; make
	touch docs-stamp

szap-stamp:
	cd libdvb ; make
	cd apps/szap/; make
	touch docs-stamp

tuxzap-stamp: szap-stamp
	cd apps/tuxzap/; ./autogen.sh --prefix=/usr  --with-dvb-path=$(CURDIR)/libdvb ; make
	touch tuxzap-stamp


build: configure-stamp build-stamp
build-stamp: docs-stamp mpegtools-stamp szap-stamp tuxzap-stamp
	dh_testdir
	# Add here commands to compile the package.
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f *-stamp

	# Add here commands to clean up after the build process.
	cd debian; cp control.big control
	-$(MAKE) clean
	-cd driver ; make clean
	-cd apps/tuxzap ; make distclean
	rm -rf apps/tuxzap/{config.guess,config.sub,config.cache,install-sh,missing,mkinstalldirs} libdvb/merge_dvb libdvb/conv driver/*.o driver/dvb_firm.h driver/fdump apps/tuxzap/src/Makefile.in apps/tuxzap/aclocal.m4 apps/tuxzap/config.h.in apps/tuxzap/Makefile.in apps/tuxzap/configure
	-cd doc/dvbapi ; make clean
	-cd apps/szap ; make clean
	find apps/tuxzap/depcomp debian/ -type l | xargs rm -f

	dh_clean

install: DH_OPTIONS=
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	# apparently bug in debhelper
	DH_COMPAT=1; dh_installdirs

	# install stuff into debian/dvb-dev.
	cp -a libdvb/include debian/dvb-dev/usr
	cp -a ost/include debian/dvb-dev/usr
	cp -a libdvb/*.a debian/dvb-dev/usr/lib

	# install stuff into debian/dvb-zapping.
	cd apps/tuxzap/src; make install prefix=../../../debian/dvb-zapping/usr
	cp -a apps/szap/szap debian/dvb-zapping/usr/bin

	# install stuff into debian/dvb-mpegtools.
	cp -a $$(find apps/mpegtools/ -type l) apps/mpegtools/mpegtools  apps/mpegtools/mplex debian/dvb-mpegtools/usr/bin
	(cd debian/dvb-mpegtools/usr/bin; for x in analyze cut_mpg es_demux mpegtools mplex pes2aud pes2aud_es pes2ts pes2ts2 pes2vid pes2vid_es pes_demux pesplot pes_repack ps2vid remux split_mpg streamtype ts2es ts2pes ts2ps ts_demux ts_es_demux tspids ; do ln -s mplex $x || true; done)


	# create the -src package.
#	cd driver && make dvb_firm.h-build
	cp -a driver debian/dvb-driver-source/usr/src/modules/dvb-driver/
#	rm debian/dvb-driver-source/usr/src/modules/dvb-driver/dvb_firm.h
	cat debian/patch-* | (cd debian/dvb-driver-source/usr/src/modules/dvb-driver/ ; patch -p1)
#	rm debian/dvb-driver-source/usr/src/modules/dvb-driver/driver/Root debian/dvb-driver-source/usr/src/modules/dvb-driver/driver/Dpram
	cp -a debian/dvb-driver.debian/* debian/dvb-driver-source/usr/src/modules/dvb-driver/debian/
	ln -s /usr/include/ost debian/dvb-driver-source/usr/src/modules/dvb-driver
	cp -a debian/copyright* debian/rules debian/dvb-driver-source/usr/src/modules/dvb-driver/debian/
	dh_installdebconf -pdvb-driver debian/copyright*
	chmod +x debian/dvb-driver-source/usr/src/modules/dvb-driver/debian/rules
#	sed -e 's/^dvb /dvb-driver-source /' < debian/changelog > debian/dvb-driver-source/usr/src/modules/dvb-driver/debian/changelog
	cp debian/changelog debian/dvb-driver-source/usr/src/modules/dvb-driver/debian/changelog
	cd  debian/dvb-driver-source/usr/src/ ; tar -c modules/dvb-driver | gzip -9 > dvb-driver.tgz
	rm -rf debian/dvb-driver-source/usr/src/modules/dvb-driver
	
	dh_movefiles

	find debian | grep -i CVS | xargs rm -rf
	find debian/dvb-dev debian/dvb-driver-source/usr/src/modules/ -type f |grep -v rules| xargs chmod -x

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
#	dh_installdebconf -a
	dh_installdocs -a
	dh_installdocs -p dvb-mpegtools apps/mpegtools/README
	# use a different name
	cp apps/tuxzap/README debian/tmp/README.tuxzap
	dh_installdocs -p dvb-zapping debian/tmp/README.tuxzap
	# install the README from dvb-driver.debian
	cp driver/gnufirm/README debian/tmp/README.gnufirm
	dh_installdocs -p dvb-driver-source debian/dvb-driver.debian/README.Debian debian/tmp/README.gnufirm
	cat doc/README.* > debian/dvb-driver.debian/README
	dh_installexamples -p dvb-zapping apps/dvb* apps/lir* apps/szap/{vdr*,channels.conf*}
	dh_installmenu -a
	dh_installcron -a
	dh_installinfo -a
	dh_installman -p dvb-zapping debian/tuxzap.1
	for x in ntuxplayer ntuxzap rtuxzap szap tuxplayer tuxview ; do ln -s tuxzap.1 debian/dvb-zapping/usr/share/man/man1/$$x.1; done
	dh_installman -p dvb-mpegtools debian/mpegtools.1
	for x in mplex `find apps/mpegtools/ -type l | cut -f3 -d"/"` ; do ln -s mpegtools.1 debian/dvb-mpegtools/usr/share/man/man1/$$x.1; done
	dh_installchangelogs  -a
	dh_strip -a
	dh_link -a
	dh_compress -a
	dh_fixperms -a
	dh_fixperms -p dvb-dev
#	dh_makeshlibs -a
	dh_installdeb -a
#	dh_perl -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

#ifneq ($(KSRC), )
#binary: kdist_image
#else
binary: binary-indep binary-arch
#binary: binary-arch
#endif
.PHONY: build clean binary-indep binary-arch binary install configure

.PHONY: configure_mod
configure_mod:
	-cd debian; cp -s dvb-driver.debian/* .
	sed 's/#KVERS#/$(KVERS)/g' debian/control.template | sed 's/#KDREV#/$(KDREV)/g' > $(CURDIR)/debian/control
	sed 's/#KVERS#/$(KVERS)/g' debian/dvb-driver.config.template > $(CURDIR)/debian/dvb-driver-$(KVERS).config
	sed 's/#KVERS#/$(KVERS)/g' debian/templates.template > $(CURDIR)/debian/templates
	sed 's/#KVERS#/$(KVERS)/g' debian/prerm.template > $(CURDIR)/debian/prerm
	sed 's/#KVERS#/$(KVERS)/g' debian/postinst.01.template > $(CURDIR)/debian/postinst.01
	sed 's/#KVERS#/$(KVERS)/g' debian/postinst.04.template > $(CURDIR)/debian/postinst.04
	cat driver/makedev.napi > debian/postinst.02
	cat debian/postinst.0? > debian/postinst
	dh_testdir
	dh_testroot
	touch configure_mod-stamp


.PHONY: build_mod
build_mod:
	dh_testdir
	dh_testroot
	cd driver ; $(MAKE) -f Makefile.debian

	touch build_mod-stamp


.PHONY: install_mod
install_mod:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs -p dvb-driver-$(KVERS) usr/lib/dvd lib/modules/$(KVERS)/misc lib/modules/$(KVERS)-dvb etc/modutils
	-rm driver/dvb_firm.o
	mv driver/tuner.o driver/dvb_tuner.o
	cp -a driver/*.o debian/dvb-driver-$(KVERS)/lib/modules/$(KVERS)/misc
	cp driver/modules.conf debian/dvb-driver-$(KVERS)/etc/modutils/dvb-$(KVERS)
	-rm debian/dvb-driver-$(KVERS)/lib/modules/$(KVERS)/misc/dvb_firm.o
	cp -a driver/Root driver/Dpram debian/dvb-driver-$(KVERS)/lib/modules/$(KVERS)-dvb/

.PHONY: binary_modules_mod
binary_modules_mod:
	dh_testdir
	dh_testroot
	cd $(CURDIR)
	dh_installdebconf	-n
#	dh_installexamples
#	dh_installmanpages
#	dh_installinit -n
	dh_installmodules
	dh_installchangelogs 
	dh_installdocs debian/README
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	# You may want to make some executables suid here.
#	dh_suidregister
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
#	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb --destdir=$(KSRC)/..


.PHONY: clean_mod
clean_mod:
	dh_testdir
	dh_testroot
	rm -f build_mod-stamp configure_mod-stamp

	# Add here commands to clean up after the build process.
	-cd driver ; $(MAKE) -f Makefile.debian clean
	rm -rf dvb_firm.h fdump debian/dvb-driver-*config debian/postinst

	-dh_clean

#	-rm $(CURDIR)/debian/control
#	-rm $(CURDIR)/debian/dirs
#	-rm $(CURDIR)/debian/override
#	-$(MAKE) clean


# The kdist_configure target is called by make-kpkg modules_config. It
# should configure the module so it is ready for compilation (mostly
# useful for calling configure)
.PHONY: kdist_config
kdist_config: configure_mod


# the kdist_image target is called by make-kpkg modules_image. It is
# responsible for compiling the module and creating the package. It
# should also clean up after making the module. Please note we use a
# seperate binary-modules target to make testing the package building
# easier
.PHONY: kdist_image
kdist_image: configure_mod build_mod install_mod binary_modules_mod clean_mod

.PHONY: kdist
kdist: kdist_image

# the kdist_clean target is called by make-kpkg modules_clean. It is
# responsible for cleaning up any changes that have been made by the
# other kdist_commands (except for the .deb files created).
.PHONY: kdist_clean
kdist_clean: clean_mod