File: rules

package info (click to toggle)
brltty 3.4.1-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,268 kB
  • ctags: 4,537
  • sloc: ansic: 54,295; sh: 3,470; makefile: 793; tcl: 398; yacc: 300; awk: 57; python: 29
file content (157 lines) | stat: -rwxr-xr-x 4,622 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
#!/usr/bin/make -f

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

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

PACKAGE=brltty
VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
DEB_HOST_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
UDEB_CFLAGS=-Os -fomit-frame-pointer
UDEB_CONFIGURE_OPTIONS=--with-braille-driver=-vh,all --disable-speech-support \
	--disable-pcm-tunes --disable-midi-tunes --disable-fm-tunes \
	--disable-contracted-braille --disable-preferences-menu --disable-api \
	--disable-learn-mode --disable-pm-configfile \
	--with-braille-device=/dev/tts/0 --without-init-path
UDEB_FILENAME=$(PACKAGE)-udeb_$(VERSION)_$(DEB_HOST_ARCH).udeb
PRIORITY=$(shell grep '^Package: brltty-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)

binary: binary-indep binary-arch

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp

	-$(MAKE) -C Documents clean
	-$(MAKE) distclean
	-rm configure-stamp configure-udeb-stamp build-stamp Programs/genlist
	-test -r /usr/share/misc/config.sub && \
	  cp -f /usr/share/misc/config.sub aux/config.sub
	-test -r /usr/share/misc/config.guess && \
	  cp -f /usr/share/misc/config.guess aux/config.guess

	dh_clean

configure: configure-stamp
configure-stamp:
	./configure --bindir=/sbin --without-viavoice --without-theta \
		--without-flite

	rm -f configure-udeb-stamp
	touch $@

configure-udeb: configure-udeb-stamp
configure-udeb-stamp:
	-$(MAKE) distclean
	CFLAGS="$(UDEB_CFLAGS)" ./configure --bindir=/sbin \
		$(UDEB_CONFIGURE_OPTIONS)
	rm -f configure-stamp
	touch $@

build: configure build-stamp
build-stamp:
	dh_testdir

	$(MAKE)
	$(MAKE) -C Documents

	rm -f build-udeb-stamp
	touch $@

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

	$(MAKE)

	rm -f build-stamp
	touch $@

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) install INSTALL_ROOT=`pwd`/debian/$(PACKAGE)
	dh_install	
	dh_installman -plibbrlapi-dev Documents/man3/*.3
	rm -Rf debian/brltty/usr/include debian/brltty/usr/lib \
		debian/brltty/usr/share/man/man3/
	rm -f debian/brltty/sbin/brltty-install debian/brltty/lib/libbrlapi*

	# fix up permissions
	chmod -x debian/brltty/lib/brltty/brltty-spk.lst debian/brltty/lib/brltty/brltty-brl.lst
	cp debian/lintian.override debian/brltty/usr/share/lintian/overrides/brltty
	gzip -9 debian/brltty/usr/share/man/man1/brltty.1

install-udeb: build-udeb
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs -pbrltty-udeb

	$(MAKE) install INSTALL_ROOT=`pwd`/debian/brltty-udeb

	cp debian/brltty-udeb.prebaseconfig debian/brltty-udeb/usr/lib/prebaseconfig.d/50brltty
	chmod 0755 debian/brltty-udeb/usr/lib/prebaseconfig.d/50brltty
	rm -f debian/brltty-udeb/sbin/brltty-*
	rm -Rf debian/brltty-udeb/usr/share
	# It is sad, but help files are not really essential, but they are
	# fairly large.
	rm debian/brltty-udeb/etc/brltty/*.hlp
	rm -Rf debian/brltty-udeb/lib
	# fix up permissions

# Build architecture-independent files here.
binary-indep: configure build install
# We have nothing to do here.

# Build architecture-dependent files here.
binary-arch: brltty brltty-udeb

brltty: build install
#	dh_testversion
	dh_testdir
	dh_testroot
	dh_installdebconf -p$@	
	dh_installdocs
	dh_installexamples -p$@
	for file in Drivers/*/README*; \
		do cp $$file `pwd`/debian/$(PACKAGE)/usr/share/doc/brltty/`basename $$(dirname $$file)`.`basename $$file`; \
		done
	# -r because we don't want to lose the console on an upgrade
	dh_installinit -p$@ -r -- start 25 S .
	dh_installchangelogs Documents/ChangeLog
	dh_link -p$@ -plibbrlapi -plibbrlapi-dev
	dh_strip -p$@ -plibbrlapi -plibbrlapi-dev
	dh_compress -p$@ -plibbrlapi -plibbrlapi-dev
	dh_fixperms -p$@ -plibbrlapi -plibbrlapi-dev
	dh_makeshlibs -n -p$@
	dh_makeshlibs -plibbrlapi
	dh_installdeb -p$@ -plibbrlapi -plibbrlapi-dev
	dh_shlibdeps -p$@ -plibbrlapi -plibbrlapi-dev
	dh_gencontrol -p$@ -plibbrlapi -plibbrlapi-dev
	dh_md5sums -p$@ -plibbrlapi -plibbrlapi-dev
	dh_builddeb -p$@ -plibbrlapi -plibbrlapi-dev

brltty-udeb: install-udeb
	dh_testdir
	dh_testroot
	cp debian/brltty-udeb.init debian/$@/etc/rcS.d/S02brltty
	chmod +x debian/$@/etc/rcS.d/S02brltty
	dh_strip -p$@
	dh_fixperms -p$@
	# If we pack now, mklibs will not work
#	upx-ucl -9 debian/$@/sbin/brltty
	DH_COMPAT=2 dh_installdeb -p$@
	dh_shlibdeps -p$@
	dh_gencontrol -p$@ -- -fdebian/files~
	# Register file manually.
	dpkg-distaddfile $(UDEB_FILENAME) debian-installer $(PRIORITY)
	dh_builddeb -p$@ --filename=$(UDEB_FILENAME)

.PHONY: brltty build clean final binary-indep binary-arch binary install