File: rules

package info (click to toggle)
alsadriver 0.2.0-pre8-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,808 kB
  • ctags: 6,550
  • sloc: ansic: 43,490; sh: 916; makefile: 759; perl: 54
file content (182 lines) | stat: -rwxr-xr-x 5,846 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
#!/usr/bin/make -f

package=alsadriver
KSRC=/usr/src/linux
MODDIR=.

config:
	$(checkdir)
	./configure --prefix=/usr
	touch config

build: config
	make
	touch build

clean: 
	test -f debian/rules
	test `id -u` = "0"
	cp -f debian/control.normal debian/control
	-rm -f config build debian/VERSION
	-rm -rf debian/files debian/tmp
	-make clean
	-rm -f config.cache config.log config.status Makefile.conf
	-rm -f utils/alsadriver.spec

binary: binary-indep binary-arch

binary-indep: binary-source binary-common

binary-arch:

kdist_image: build 
	$(MAKE) $(MFLAGS) -f debian/rules MODDIR=$(KSRC)/.. binary-modules

############################ source stuff #################################
binary-source:
# Perform some tests
	test -f debian/rules
	test `id -u` = "0"

# Setup everything first
	-rm -rf debian/tmp debian/substvars
	install -d debian/tmp

# Clean up the sources	
	install -d debian/tmp/usr/src/modules/alsadriver
	find . \( -name \*.o -path ./debian/tmp \) -prune -o -print | \
		cpio -admp debian/tmp/usr/src/modules/alsadriver
	( cd debian/tmp/usr/src/modules/alsadriver; $(MAKE) -f debian/rules clean )

# Documentation
	install -d -o root -g root -m 755 debian/tmp/usr/doc/alsa-source/
	install -p -o root -g root -m 644 README TODO INSTALL \
		debian/tmp/usr/doc/alsa-source
	install -p -o root -g root -m 644 debian/README \
		debian/tmp/usr/doc/alsa-source/README.Debian
	install -p -o root -g root -m 644 CHANGELOG \
		debian/tmp/usr/doc/alsa-source/changelog

# Install control files
	install -d -o root -g root -m 755 debian/tmp/DEBIAN
	install -p -o root -g root -m 755 debian/control debian/tmp/DEBIAN

# And now.. for the final packaging!
	find debian/tmp -type f | grep -v "./DEBIAN" | xargs md5sum | \
		sed -e 's#debian/tmp/##' > debian/tmp/DEBIAN/md5sums

	dpkg-gencontrol -palsa-source
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
	dpkg --build debian/tmp ..

############################ common stuff #################################

binary-common:
# Perform some tests
	test -f debian/rules
	test `id -u` = "0"

# Setup everything first
	-rm -rf debian/tmp debian/substvars
	install -d debian/tmp

# Device stuff
	install -d debian/tmp/dev
	ln -s /proc/asound/dev debian/tmp/dev/snd

# Include-files
	install -d -o root -g root -m 755 debian/tmp/usr/include
	install -p -o root -g root -m 755 include/asound.h debian/tmp/usr/include
	install -p -o root -g root -m 755 include/asoundid.h debian/tmp/usr/include

# Install documentation
	install -d -o root -g root -m 755 debian/tmp/usr/doc/alsa-modules/
	install -p -o root -g root -m 644 README README.kernel \
		FAQ TODO WARNING doc/SOUNDCARDS doc/*txt \
		debian/tmp/usr/doc/alsa-modules
	gzip -9 debian/tmp/usr/doc/alsa-modules/coding.txt
	install -p -o root -g root -m 644 CHANGELOG \
		debian/tmp/usr/doc/alsa-modules/changelog
	gzip -9 debian/tmp/usr/doc/alsa-modules/changelog

# Install the manual
	install -d -o root -g root -m 755 debian/tmp/usr/doc/alsa-modules/html
	install -p -o root -g root -m 644 doc/*html \
			debian/tmp/usr/doc/alsa-modules/html
	gzip -9 debian/tmp/usr/doc/alsa-modules/html/*

# Install Debian-specific items
	# Manpages for undocumented stuff
	install -d -o root -g root -m 755 debian/tmp/usr/man/man8
	ln -s ../man7/undocumented.7.gz debian/tmp/usr/man/man8/alsaconfig.8.gz
	# Menu support
	install -d -o root -g root -m 755 debian/tmp/usr/lib/menu
	install -p -o root -g root -m 644 debian/menu debian/tmp/usr/lib/menu/alsa
	# Documentation
	install -d -o root -g root -m 755 debian/tmp/usr/doc/alsa-modules
	install -p -o root -g root -m 644 debian/changelog \
		debian/tmp/usr/doc/alsa-modules/changelog.Debian
	gzip -9	debian/tmp/usr/doc/alsa-modules/changelog.Debian
	install -p -o root -g root -m 644 debian/copyright \
		debian/tmp/usr/doc/alsa-modules
	# Init-stuff
	install -d -o root -g root -m 755 debian/tmp/etc/init.d
	install -p -o root -g root -m 755 debian/init debian/tmp/etc/init.d/alsa

# Install our own extra's
	install -d -o root -g root -m 755 debian/tmp/usr/sbin
	install -p -o root -g root -m 755 debian/alsaconfig debian/tmp/usr/sbin

# Install control files
	install -d -o root -g root -m 755 debian/tmp/DEBIAN
	install -p -o root -g root -m 755 debian/control debian/tmp/DEBIAN
	install -p -o root -g root -m 755 debian/conffiles debian/tmp/DEBIAN
	install -p -o root -g root -m 755 debian/postinst debian/tmp/DEBIAN
	install -p -o root -g root -m 755 debian/preinst debian/tmp/DEBIAN
	install -p -o root -g root -m 755 debian/prerm debian/tmp/DEBIAN

# And now.. for the final packaging!
	find debian/tmp -type f | grep -v "./DEBIAN" | xargs md5sum | \
		sed -e 's#debian/tmp/##' > debian/tmp/DEBIAN/md5sums

	dpkg-gencontrol -palsa-modules
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
	dpkg --build debian/tmp ..

############################ modules stuff #################################

binary-modules:
# Perform some tests
	test -f debian/rules
	test `id -u` = "0"

# Setup everything first
	-rm -rf debian/tmp debian/substvars
	install -d debian/tmp

# Install the software
	install -d -o root -g root -m 755 debian/tmp/usr/include/linux
	make INSTROOT=debian/tmp install

# Fix some stuff up
	install -d -o root -g root -m 755 debian/tmp/usr/doc
	rm -rf debian/tmp/usr/include
	sh debian/prep-modules $(KSRC)

# Install control files
	install -d -o root -g root -m 755 debian/tmp/DEBIAN
	install -p -o root -g root -m 755 debian/postinst.mod debian/tmp/DEBIAN

# And now.. for the final packaging!
	find debian/tmp -type f | grep -v "./DEBIAN" | xargs md5sum | \
		sed -e 's#debian/tmp/##' > debian/tmp/DEBIAN/md5sums

	dpkg-gencontrol -p`ls -1 debian/tmp/usr/doc` -v`cat debian/VERSION`
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
	dpkg --build debian/tmp $(MODDIR)

.PHONY: binary binary-arch binary-indep binary-modules kdist_image clean