File: rules

package info (click to toggle)
speech-dispatcher 0.7-6.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,224 kB
  • ctags: 2,250
  • sloc: ansic: 17,857; sh: 10,533; python: 1,148; lisp: 579; makefile: 333
file content (154 lines) | stat: -rwxr-xr-x 5,310 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
#!/usr/bin/make -f

.NOTPARALLEL:

package = speech-dispatcher
libpackage = libspeechd2
libpackagedev = libspeechd-dev
clcpackage = cl-speech-dispatcher

clc-source	:= usr/share/common-lisp/source
clc-systems	:= usr/share/common-lisp/systems
clc-pkg		:= ssip
clc-files	:= $(clc-source)/$(clc-pkg)

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  confflags += --build $(DEB_HOST_GNU_TYPE)
else
  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

CFLAGS = -Wall -g
INSTALL = install
INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
    CFLAGS += -O0
else
    CFLAGS += -O2
endif
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
    INSTALL_PROGRAM += -s
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    MAKEFLAGS += -j$(NUMJOBS)
endif

config.status: configure.in
	dh_testdir
	./build.sh
	rm -f ltmain.sh; cp /usr/share/libtool/config/ltmain.sh .
	./configure $(confflags) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc pidpath=/var/run/speech-dispatcher/

build: build-stamp

build-stamp: config.status
	dh_testdir
	$(MAKE) MAKEFLAGS="$(MAKEFLAGS)" CFLAGS="$(CFLAGS)"
	(cd doc; $(MAKE) MAKEFLAGS="$(MAKEFLAGS)" info)
	touch build-stamp

clean: config.status
	dh_testdir
	rm -f build-stamp
	[ ! -f Makefile ] || $(MAKE) MAKEFLAGS="$(MAKEFLAGS)" distclean
	find -name '.#*' -exec rm {} \;
	dh_clean
	-test -r /usr/share/misc/config.sub && \
	   cp -f /usr/share/misc/config.sub config.sub
	-test -r /usr/share/misc/config.guess && \
	   cp -f /usr/share/misc/config.guess config.guess

install: build
	dh_testdir
	dh_testroot
	dh_prep -A
	dh_installdirs -A
	find -name '*.la' -exec rm {} \; # to avoid invalid libtool paths
	$(MAKE) install DESTDIR=$(CURDIR)/debian/$(package) CFLAGS="$(CFLAGS)" \
		INSTALL="$(INSTALL)" INSTALL_FILE="$(INSTALL_FILE)" INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
		INSTALL_SCRIPT="$(INSTALL_SCRIPT)" INSTALL_DIR="$(INSTALL_DIR)"
# Install speech-dispatcher files
	find $(CURDIR)/debian/$(package)/usr/bin -type f -not -name speech-dispatcher -not -name spd-say -exec rm {} \;
	rm -f $(CURDIR)/debian/$(package)/usr/share/info/dir*
	rm -f $(CURDIR)/debian/$(package)/usr/share/info/speech-dispatcher-cs.*
	rm -rf $(CURDIR)/debian/$(package)/usr/lib/python*
	rm -f $(CURDIR)/debian/$(package)/usr/share/sounds/speech-dispatcher/test.wav # this is in speechd-python
# Install libpseechd files
	mv $(CURDIR)/debian/$(package)/usr/lib/libspeechd*[0-9]* $(CURDIR)/debian/$(libpackage)/usr/lib/
# Install libspeechd-dev files
	mv $(CURDIR)/debian/$(package)/usr/lib/lib* $(CURDIR)/debian/$(libpackagedev)/usr/lib/
	mv $(CURDIR)/debian/$(package)/usr/include/*.h $(CURDIR)/debian/$(libpackagedev)/usr/include
	rmdir $(CURDIR)/debian/$(package)/usr/include

install-indep: build
	dh_testdir
	dh_testroot
	dh_prep -A
	dh_installdirs -A
# Install python-speechd files
	( cd src/python; make install prefix=$(CURDIR)/debian/python-speechd/usr )
	rm -rf $(CURDIR)/debian/python-speechd/usr/share/speech-dispatcher/conf # this is in speech-dispatcher
	dh_pycentral -ppython-speechd
	chmod a+x $(CURDIR)/debian/python-speechd/usr/share/pyshared/speechd/_test.py
# Install cl-speech-dispatcher files
	dh_installdirs -p $(clcpackage) $(clc-systems) $(clc-files)
	dh_install -p $(clcpackage) src/cl/$(clc-pkg).asd src/cl/*.lisp $(clc-files)/
	dh_link -p $(clcpackage) $(clc-files)/$(clc-pkg).asd $(clc-systems)/$(clc-pkg).asd

# Build architecture-independent files here.
binary-indep: build install-indep
	dh_testdir
	dh_testroot
	dh_installdocs -i
	dh_installinfo -p$(package)-doc-cs doc/speech-dispatcher-cs.info*
	dh_installchangelogs -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installinit --error-handler=true
	dh_installman debian/speech-dispatcher.7
	dh_link usr/share/man/man7/speech-dispatcher.7 usr/share/man/man7/spd-say.7
	dh_installinfo doc/speech-dispatcher.info* doc/ssip.info* doc/spd-say.info*
	dh_installchangelogs -a
	dh_installchangelogs ChangeLog
	dh_installlogrotate
	install -m 644 debian/overrides.$(package) $(CURDIR)/debian/$(package)/usr/share/lintian/overrides/$(package)
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	chmod 700 $(CURDIR)/debian/$(package)/var/log/speech-dispatcher
	dh_makeshlibs -p$(libpackage)
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

patch: patch-stamp
patch-stamp:
	dpatch apply-all
	dpatch cat-all >patch-stamp
	touch patch-stamp

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