Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
4 include /usr/share/dpkg/pkg-info.mk
5
6 export deb_systemdsystemunitdir = $(shell pkgconf --variable=systemdsystemunitdir systemd | sed s,^/,,)
7 export deb_systemduserunitdir = $(shell pkgconf --variable=systemduserunitdir systemd | sed s,^/,,)
8
9 # NAS is in universe in Ubuntu
10 ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
11 ifneq (,$(filter speech-dispatcher-festival,$(shell dh_listpackages)))
12 ifeq (${DEB_HOST_ARCH},i386)
13 builddeb_overrides = -Nspeech-dispatcher-festival
14 endif
15 endif
16 endif
17
18 CONFIGURE=--with-module-bindir=\$${prefix}/lib/speech-dispatcher-modules \
19 pidpath=/run/speech-dispatcher/
20
21 ifeq ($(DEB_SOURCE),speech-dispatcher)
22 # disable non-free syntheses
23 CONFIGURE += --with-pico=no --with-baratinoo=no --with-kali=no --with-ibmtts=no --with-voxin=no --with-ivona=no
24 endif
25
26 ifneq (,$(filter cross,$(DEB_BUILD_PROFILES))$(filter speech-dispatcher-contrib,$(DEB_SOURCE)))
27 # ignore non-installed files
28 override_dh_missing:
29 :
30 endif
31
32 # Disable python discovery in binary-arch builds, so we can cross-compile
33 CONFIGURE_ARCH=--disable-python
34
35 %:
36 dh $@
37
38 config/modules/espeak-ng-mbrola-generic.conf:
39 for i in espeak-ng-mbrola-generic.conf \
40 espeak-mbrola-generic.conf ; do \
41 sed < config/modules/$$i.in > config/modules/$$i -e "s/\$$DEB_HOST_MULTIARCH/$(DEB_HOST_MULTIARCH)/" ; \
42 done
43
44 override_dh_auto_configure-arch: config/modules/espeak-ng-mbrola-generic.conf
45 dh_auto_configure -- $(CONFIGURE) $(CONFIGURE_ARCH)
46
47 override_dh_auto_configure-indep: config/modules/espeak-ng-mbrola-generic.conf
48 dh_auto_configure -- $(CONFIGURE)
49
50 override_dh_auto_build:
51 # Bug#950793
52 # Bug#996741
53 @echo blhc: ignore-line-regexp: '.* "sd_.*S.c".*'
54 @echo blhc: ignore-line-regexp: '.* -o .libs/libspeechd_module.so.*'
55 @echo blhc: ignore-line-regexp: '.* -o .libs/sd_.*'
56 dh_auto_build
57
58 ifeq ($(DEB_SOURCE),speech-dispatcher)
59 override_dh_installinit:
60 dh_installinit -a --error-handler=true --no-enable --no-start
61
62 override_dh_makeshlibs:
63 dh_makeshlibs -plibspeechd2 -plibspeechd-module0
64 endif
65
66 override_dh_builddeb:
67 dh_builddeb ${builddeb_overrides}
68
69 override_dh_gencontrol:
70 dh_gencontrol ${builddeb_overrides}
71
72 override_dh_installsystemd:
73 dh_installsystemd --no-enable --no-start
74
75 # Switch to main rules
76 main:
77 sed -i 's/^speech-dispatcher-contrib /speech-dispatcher /' debian/changelog
78 sed -i '1s/^Source: speech-dispatcher-contrib$$/Source: speech-dispatcher/' debian/control
79 sed -i 's/^ libttspico-dev/# libttspico-dev/' debian/control
80 sed -i 's/^ speech-dispatcher (>= 0/# speech-dispatcher (>= 0/' debian/control
81 sed -i 's/^# help2man/ help2man/' debian/control
82 sed -i '/^#start-contrib$$/,/^#end-contrib$$/s/^/#/' debian/control
83 sed -i '/Package: speech-dispatcher$$/,$$s/^#*//' debian/control
84 sed -i '1,/^$$/s_^Section: contrib/_Section: _' debian/control
85
86 # Switch to contrib rules
87 contrib:
88 sed -i 's/^speech-dispatcher /speech-dispatcher-contrib /' debian/changelog
89 sed -i '1s/^Source: speech-dispatcher$$/Source: speech-dispatcher-contrib/' debian/control
90 sed -i 's/^#* libttspico-dev/ libttspico-dev/' debian/control
91 sed -i 's/^#* speech-dispatcher (>= 0/ speech-dispatcher (>= 0/' debian/control
92 sed -i 's/^ help2man/# help2man/' debian/control
93 sed -i '/^##start-contrib$$/,/^##end-contrib$$/s/^#//' debian/control
94 sed -i '/Package: speech-dispatcher$$/,$$s/^/#/' debian/control
95 sed -i '1,/^$$/s_^Section: \([^/]*\)$$_Section: contrib/\1_' debian/control