File: rules

package info (click to toggle)
alsa-driver 0.9%2B0beta12-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,524 kB
  • ctags: 29
  • sloc: sh: 982; makefile: 283
file content (222 lines) | stat: -rwxr-xr-x 6,739 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
#!/usr/bin/make -f

include debian/scripts/vars
BUILD_DIR=$(SOURCE_DIR)/$(TAR_DIR)

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

VERSION=

conf=debian/modules.d/control$(VERSION).normal

basepkg=$(shell grep alsa-base $(conf) |grep Package: | cut -d' ' -f 2)
srcpkg=$(shell grep alsa-source $(conf) |grep Package: | cut -d' ' -f 2)
headerpkg=$(shell grep alsa-headers $(conf) |grep Package: | cut -d' ' -f 2)

# Check ALSA version.
ALSA_MAJOR_VERSION=0.9

CONFIGURE_OPT=--prefix=/usr --with-kernel=$(KSRC) \
		 --with-moddir=/lib/modules/$(KVERS)/alsa \
		 --with-sequencer=yes

# ad-hoc solution for evil versioning to alsa-modules-2.2.17
ifndef DEBEPOCH
  ifeq ($(KVERS),2.2.17)
    export DEBEPOCH=2
  endif
endif


########################################################################
ifeq ($(HOME)/.$(srcpkg).conf, $(wildcard $(HOME)/.$(srcpkg).conf))
include $(HOME)/.$(srcpkg).conf
else
ifeq (/etc/alsa/$(srcpkg).conf,$(wildcard /etc/alsa/$(srcpkg).conf))
include /etc/alsa/$(srcpkg).conf
endif
endif

ifeq ($(ALSA_NOPNP),y)
CONFIGURE_OPT := $(CONFIGURE_OPT) --with-isapnp=no
else
CONFIGURE_OPT := $(CONFIGURE_OPT) --with-isapnp=yes
endif

ifeq ($(ALSA_DEBUG),y)
CONFIGURE_OPT := $(CONFIGURE_OPT) --with-debug=detect
endif

ifneq ($(ALSA_CARDS),"")
CONFIGURE_OPT := $(CONFIGURE_OPT) --with-cards=$(ALSA_CARDS)
endif

IARCH_OPT = $(shell sh debian/modules-tools.d/build_processor $(KSRC))

########################################################################
# Includes kernel module pacakge common target
include debian/modules-tools.d/rules

config:
	$(checkdir)
	sh debian/modules-tools.d/check-debian-rules-pkg
	./configure $(IARCH_OPT) $(CONFIGURE_OPT)
	echo $(shell cat version) > config

build:
	@echo Will build only for modules, sorry.

clean: debian
	test -f debian/rules
	test `id -u` = "0"
	rm -f debian/substvars debian/*.debhelper debian/*.substvars
	rm -rf debian/tmp
	rm -rf debian/$(modulepkg)
	rm -rf debian/$(srcpkg)
	rm -rf debian/$(headerpkg)
	rm -f debian/files
	rm -f debian/snddevices
	find . -type f -a \( -name \#\*\# -o -name \*\~ -o -name DEADJOE \
		-o -name \*.orig -o -name \*.rej -o -name \*.bak -o -name \
		.\*.orig -o -name .\*.rej -o -name .SUMS -o -name TAGS \
		-o -name core -o \( -path \*/.deps/\* -a -name \*.P \) \) \
		-exec rm -f {} \;
	-rm -f config build debian/VERSION debian/KVERS compile
	-rm -f include/isapnp.h
	-make mrproper
	-cd debian/debconf && $(MAKE) clean
	-rm -f debian/$(srcpkg).postinst
	-rm -f debian/$(srcpkg).config
	-rm -f debian/$(srcpkg).templates
	-rm -f debian/templates
	-rm -f `cat stamp-debian`
	-rm -f stamp-debian
	dh_clean -k
	-make -f debian/sys-build.mk source.clean
# clean obsolete debian files.
	-rm -f debian/conffiles

binary: debian binary-indep binary-arch

binary-indep: DH_OPTIONS=-i
binary-indep: install-source install-base
	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_installdocs $(BUILD_DIR)/doc/SOUNDCARDS $(BUILD_DIR)/FAQ \
	  $(BUILD_DIR)/README $(BUILD_DIR)/WARNING
	dh_installexamples 
	dh_installmenu
	DH_OPTIONS= dh_installinit -r -palsa-base --init-script=alsa
	dh_installcron
	dh_installmanpages
	dh_installinfo
	dh_installchangelogs 
	dh_compress
	dh_fixperms
# You may want to make some executables suid here.
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:
	echo "nothing to do"

#################### ALSA module specifie stuff ########################


$(BUILD_DIR):
	make -f debian/sys-build.mk source.make
	find debian | grep -v CVS | cpio -admp $(BUILD_DIR)
	sh debian/modules-tools.d/build_makefile

#debian/source.files:
#	find . \( -name \*.o -o -path ./debian/$(srcpkg) -o -path \*/CVS \) -prune -o -print > debian/source.files

install-source-config:
#	$(MAKE) -C utils update-deps

install-source-misc:
	cd debian/debconf && $(MAKE) install
#	cat debian/alsa-source$(VERSION).postinst.in | \
#	sed -e "s/#CARDS#/`cat debian/debconf/cards | cut -f 1 | awk -F'\n' '{ printf $$z \" \";} '`/" > debian/$(srcpkg).postinst
#	install -d debian/$(srcpkg)/usr/src/modules/$(package)/include/sound
	install debian/$(srcpkg)/usr/src/modules/$(package)/snddevices debian/
#	( for f in `cat debian/header-files`; do \
#	  ln -s ../$$f debian/$(srcpkg)/usr/src/modules/$(package)/include/sound/;\
#	  done \
#	)
	install -d debian/$(srcpkg)/etc/alsa
	install -p -o root -g src -m 664 debian/debconf/$(srcpkg).conf debian/$(srcpkg)/etc/alsa

	install -p -o root -g root -m 755 \
		-d debian/$(srcpkg)/usr/share/$(srcpkg)

	-cd $(BUILD_DIR) && rm -f `cat $(topdir)/stamp-debian`

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

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

# Setup everything first
	-rm -rf debian/tmp debian/substvars debian/$(basepkg)
	install debian/modules.d/control$(VERSION).source debian/control
	cat $(conf) >> debian/control
	dh_installdirs

# Include-files
	install -d -o root -g root -m 755 debian/$(basepkg)/usr/include/sound
	( for f in `cat debian/header-files`; do \
		install -p -o root -g root -m 644 $(BUILD_DIR)/alsa-kernel/include/$$f debian/$(basepkg)/usr/include/sound/; \
	  done \
	)

#	install -o root -g audio -m 644 debian/alsa.modutils \
#		debian/tmp/etc/modutils/alsa
	install -o root -g audio -m 755 debian/apm \
		debian/$(basepkg)/etc/apm/event.d/alsa
	install -o root -g audio -m 664 debian/alsa-base.conf \
		debian/$(basepkg)/etc/alsa/alsa-base.conf
	install -o root -g audio -m 644 debian/snd-dev-utils \
		debian/$(basepkg)/usr/share/alsa-base/snd-dev-utils
	install -o root -g audio -m 755 debian/program-wrapper \
		debian/$(basepkg)/usr/share/alsa-base/program-wrapper
	install -o root -g audio -m 644 debian/devfs.conf \
		debian/$(basepkg)/etc/devfs/conf.d/alsa		
	install -o root -g audio -m 644 debian/alsa-path \
		debian/$(basepkg)/etc/modutils/alsa-path

	dh_movefiles --sourcedir=debian/$(basepkg)


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

install-modules: config debian
	$(MAKE)
	touch compile
	touch build

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

# Setup everything first
	-rm -rf debian/$(srcpkg) debian/$(modulepkg) debian/substvars
	install -d debian/$(srcpkg)

# Install the software
	install -d -o root -g root -m 755 debian/$(modulepkg)/usr/include/sound
	mkdir -p debian/$(modulepkg)/lib/modules/$(KVERS)/alsa
	-$(MAKE) DESTDIR=`pwd`/debian/$(modulepkg) install-modules
	install -d -o root -g root -m 755 debian/$(modulepkg)/usr/share/doc/
	ln -sf alsa-base debian/$(modulepkg)/usr/share/doc/alsa-modules$(VERSION)-$(KVERS)
     
	rm -rf debian/$(modulepkg)/usr/include

.PHONY: binary binary-arch binary-indep install-source install-base binary-modules kdist_image clean dep