~jon-raiford/mythbuntu/lirc

1 by Mario Limonciello
add hardy's debian/ directory
1
#!/usr/bin/make -f
2
67 by Mario Limonciello
merge debian/rules with debian
3
include /usr/share/quilt/quilt.make
1 by Mario Limonciello
add hardy's debian/ directory
4
5
# Uncomment this to turn on verbose mode.
6
#export DH_VERBOSE=1
7
8
ifneq ($(findstring debug,$(DEB_BUILD_OPTIONS)),)
9
CFLAGS += -g
10
endif
11
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
12
INSTALL_PROGRAM += -s
13
endif
14
48 by Mario Limonciello
merge a LOT of debian/rules from debian
15
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
16
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
17
UVERS := $(shell dpkg-parsechangelog | sed -n 's/^Version: \(.*\)-.*/\1/p')
18
19
configure_flags := \
20
		--prefix=/usr \
21
		--mandir=\$${prefix}/share/man \
22
		--infodir=\$${prefix}/share/info \
23
		--libdir=\$${prefix}/lib \
24
		--sysconfdir=/etc/lirc/ \
25
		--with-driver=userspace \
26
		--with-syslog=LOG_DAEMON \
27
		--enable-sandboxed \
28
		--build=$(DEB_BUILD_GNU_TYPE)
29
30
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
31
	configure_flags += --host=$(DEB_HOST_GNU_TYPE)
32
endif
1 by Mario Limonciello
add hardy's debian/ directory
33
34
clean: unpatch
35
	dh_testdir
36
	dh_testroot
37
	rm -f debian/po/messages.mo
38
	rm -f configure-stamp build-stamp
94 by Mario Limonciello
* debian/rules:
39
	rm -f debian/modules-source/dkms.conf
1 by Mario Limonciello
add hardy's debian/ directory
40
	debconf-updatepo
114.1.7 by Jeremy Yoder
* Merge changes from Mario Limonciello on the main branch
41
	[ ! -f doc/lirc.hwdb.orig ] || mv -f doc/lirc.hwdb.orig doc/lirc.hwdb
1 by Mario Limonciello
add hardy's debian/ directory
42
	[ ! -f Makefile ] || $(MAKE) distclean
48 by Mario Limonciello
merge a LOT of debian/rules from debian
43
	@if [ ! "$(UVERS)" = "$(shell sed -n 's/^Version: \(.*\)/\1/p' debian/liblircclient0.pc)" ]; then \
44
		echo "ERROR: debian/liblircclient0.pc out of date."; \
45
		false; \
46
	fi
1 by Mario Limonciello
add hardy's debian/ directory
47
	dh_clean
48
11 by Mario Limonciello
start to convert to dkms
49
configure: patch configure-stamp
1 by Mario Limonciello
add hardy's debian/ directory
50
configure-stamp:
51
	dh_testdir
114.1.7 by Jeremy Yoder
* Merge changes from Mario Limonciello on the main branch
52
	[ ! -f doc/lirc.hwdb.orig ] && mv -f doc/lirc.hwdb doc/lirc.hwdb.orig && sed 's/lirc_dev lirc_gpio/devinput/' doc/lirc.hwdb.orig > doc/lirc.hwdb
48 by Mario Limonciello
merge a LOT of debian/rules from debian
53
	-test -r config.sub && test -r /usr/share/misc/config.sub && \
54
		cp -f /usr/share/misc/config.sub config.sub
55
	-test -r config.guess && test -r /usr/share/misc/config.guess && \
56
		cp -f /usr/share/misc/config.guess config.guess
57
	./configure $(configure_flags)
58
	touch $@
1 by Mario Limonciello
add hardy's debian/ directory
59
60
build: configure build-stamp
11 by Mario Limonciello
start to convert to dkms
61
build-stamp:
1 by Mario Limonciello
add hardy's debian/ directory
62
	dh_testdir
63
	$(MAKE)
48 by Mario Limonciello
merge a LOT of debian/rules from debian
64
	touch $@
1 by Mario Limonciello
add hardy's debian/ directory
65
66
install: build-stamp
67
	dh_testdir
68
	dh_testroot
69
	dh_clean -k
70
	dh_installdirs
94 by Mario Limonciello
* debian/rules:
71
1 by Mario Limonciello
add hardy's debian/ directory
72
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
73
	install --mode=755 contrib/irman2lirc debian/tmp/usr/bin/
94 by Mario Limonciello
* debian/rules:
74
48 by Mario Limonciello
merge a LOT of debian/rules from debian
75
	# allow building even if vgalib is not available
1 by Mario Limonciello
add hardy's debian/ directory
76
	if [ -e tools/smode2 ]; then \
77
		install --mode=755 tools/smode2 debian/tmp/usr/bin/ ; \
78
	fi
94 by Mario Limonciello
* debian/rules:
79
1 by Mario Limonciello
add hardy's debian/ directory
80
	mkdir -p debian/tmp/etc/lirc/
81
	mkdir -p debian/tmp/usr/share/lirc/
32 by Mario Limonciello
copy fdi file properly
82
	mkdir -p debian/tmp/usr/share/hal/fdi/preprobe/20thirdparty
67 by Mario Limonciello
merge debian/rules with debian
83
	install --mode=644 debian/conf.placeholder \
1 by Mario Limonciello
add hardy's debian/ directory
84
		debian/tmp/etc/lirc/lircd.conf
85
	install --mode=644 debian/conf.placeholder \
86
		debian/tmp/etc/lirc/lircmd.conf
87
	install --mode=644 debian/hardware.conf debian/tmp/etc/lirc/
26 by Mario Limonciello
Add FDI file to make saa7134 work OOTB w/ devinput (LP: #204960)
88
	install --mode=644 debian/lirc.fdi \
32 by Mario Limonciello
copy fdi file properly
89
                debian/tmp/usr/share/hal/fdi/preprobe/20thirdparty/lirc.fdi
48 by Mario Limonciello
merge a LOT of debian/rules from debian
90
	mkdir -p debian/tmp/usr/src/lirc-${UVERS}
91
	cp -dpR drivers debian/tmp/usr/src/lirc-${UVERS}/
92
	find debian/tmp/usr/src/lirc-${UVERS} -name "*.o" -o -name Makefile.in \
1 by Mario Limonciello
add hardy's debian/ directory
93
		-o -name Makefile.am  -o -name "*.ko"| xargs rm
11 by Mario Limonciello
start to convert to dkms
94
48 by Mario Limonciello
merge a LOT of debian/rules from debian
95
	for file in `find debian/tmp/usr/src/lirc-${UVERS} -name Makefile`; \
1 by Mario Limonciello
add hardy's debian/ directory
96
		do sed -e 's/^Makefile:.*/Makefile:/g' \
97
			-e'/^CC *=/d' -e '/^KERNEL_LOCATION *=/d' \
98
				$$file > $$file.tmp && \
99
			mv $$file.tmp $$file; \
100
		done
101
	sed -n \
102
		-e'/define *DEV_LIRC\>/p' \
103
		-e'/define *LIRC_MAJOR\>/p' \
48 by Mario Limonciello
merge a LOT of debian/rules from debian
104
		config.h > debian/tmp/usr/src/lirc-${UVERS}/config.h
11 by Mario Limonciello
start to convert to dkms
105
106
	#Create dkms.conf
94 by Mario Limonciello
* debian/rules:
107
	sed s/LIRC_VERSION/${UVERS}/ debian/dkms.conf.in > debian/modules-source/dkms.conf
11 by Mario Limonciello
start to convert to dkms
108
48 by Mario Limonciello
merge a LOT of debian/rules from debian
109
	cp -dpR debian/modules-source/* debian/tmp/usr/src/lirc-${UVERS}/
1 by Mario Limonciello
add hardy's debian/ directory
110
	mkdir -p debian/liblircclient-dev/usr/share/aclocal
111
	cp contrib/lirc.m4 debian/liblircclient-dev/usr/share/aclocal/
94 by Mario Limonciello
* debian/rules:
112
48 by Mario Limonciello
merge a LOT of debian/rules from debian
113
	# install logcheck files
1 by Mario Limonciello
add hardy's debian/ directory
114
	install -d debian/tmp/etc/logcheck/ignore.d.paranoid
115
	install -o root -g root -m 644 debian/logcheck.ignore \
116
			debian/tmp/etc/logcheck/ignore.d.paranoid/lirc
117
	install -d debian/tmp/etc/logcheck/ignore.d.server
118
	install -o root -g root -m 644 debian/logcheck.ignore \
119
			debian/tmp/etc/logcheck/ignore.d.server/lirc
120
	install -d debian/tmp/etc/logcheck/ignore.d.workstation
121
	install -o root -g root -m 644 debian/logcheck.ignore \
122
			debian/tmp/etc/logcheck/ignore.d.workstation/lirc
94 by Mario Limonciello
* debian/rules:
123
48 by Mario Limonciello
merge a LOT of debian/rules from debian
124
	# install pkg-config file
125
	install -d debian/tmp/usr/lib/pkgconfig
126
	install -o root -g root -m644 debian/liblircclient0.pc debian/tmp/usr/lib/pkgconfig/liblircclient0.pc
1 by Mario Limonciello
add hardy's debian/ directory
127
128
# Build architecture-independent files here.
129
binary-indep: build install
130
	dh_installdocs -i
122 by Mario Limonciello
* rules:
131
	dh_installchangelogs -i ChangeLog
1 by Mario Limonciello
add hardy's debian/ directory
132
	dh_install -i --sourcedir=debian/tmp --list-missing
133
	dh_compress -i
134
	dh_fixperms -i
135
	dh_installdeb -i
136
	dh_gencontrol -i
137
	dh_md5sums -i
138
	dh_builddeb -i
139
140
# Build architecture-dependent files here.
141
binary-arch: build install
142
	dh_testdir
143
	dh_testroot
144
	dh_installchangelogs -s ChangeLog
145
	dh_installdocs -s
146
	cp -dpR doc/html doc/images doc/irxevent.keys \
48 by Mario Limonciello
merge a LOT of debian/rules from debian
147
		debian/lirc/usr/share/doc/lirc/
1 by Mario Limonciello
add hardy's debian/ directory
148
	mkdir debian/lirc/usr/share/lirc
122 by Mario Limonciello
* rules:
149
	cp -dpR remotes debian/lirc/usr/share/lirc/remotes
114.1.8 by Jeremy Yoder
Added the extra "Debian-only" remotes and transmitters back
150
	cp -dpR debian/extras debian/lirc/usr/share/lirc/extras
114.1.7 by Jeremy Yoder
* Merge changes from Mario Limonciello on the main branch
151
	cp -dpR doc/lirc.hwdb debian/lirc/usr/share/lirc
152
	#sed 's/lirc_dev lirc_gpio/devinput/' doc/lirc.hwdb > debian/lirc/usr/share/lirc.hwdb
1 by Mario Limonciello
add hardy's debian/ directory
153
	dh_installexamples -s
154
	dh_install -s --sourcedir=debian/tmp --list-missing
155
	dh_installmenu -s
156
	dh_installdebconf -plirc
48 by Mario Limonciello
merge a LOT of debian/rules from debian
157
	dh_installinit -s --update-rcd-params="defaults 19"
79 by Mario Limonciello
commit changes that were uploaded by keybuk directly to the archive
158
	dh_installudev --priority=85
1 by Mario Limonciello
add hardy's debian/ directory
159
	dh_installcron -s
160
	dh_installinfo -s
161
	dh_installmodules -s
162
	dh_installman -s
48 by Mario Limonciello
merge a LOT of debian/rules from debian
163
	@for i in lirc-x lirc-svga; do \
164
	    rm -rf debian/$${i}/usr/share/doc/$${i} ;\
1 by Mario Limonciello
add hardy's debian/ directory
165
	done
166
	dh_link -s
167
	dh_strip -s
168
	dh_compress -s -X irxevent.keys
169
	dh_fixperms -s
170
	dh_makeshlibs -s
171
	dh_installdeb -s
172
	dh_shlibdeps -s
173
	dh_gencontrol -s
174
	dh_md5sums -s
175
	dh_builddeb -s
176
177
binary: binary-indep binary-arch
178
.PHONY: build clean binary-indep binary-arch binary install autotools