Fix error
[kdeaccessibility.git] / debian / rules
blob61296e4ca3301f03f4c25c9a42a82d54c311323e
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
6 # Modified to make a template file for a multi-binary package with separated
7 # build-arch and build-indep targets by Bill Allombert 2001
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
12 # This has to be exported to make some magic below work.
13 export DH_OPTIONS
15 # These are used for cross-compiling and for saving the configure script
16 # from having to guess our platform (since we know it already)
17 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
18 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
20 CFLAGS = -Wall -g
22 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
23 CFLAGS += -O0
24 else
25 CFLAGS += -O2
26 endif
27 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
28 INSTALL_PROGRAM += -s
29 endif
31 objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
33 -include debian/debiandirs
35 debian/debiandirs: admin/debianrules
36 perl -w admin/debianrules echodirs > debian/debiandirs
38 configure: configure-stamp
39 configure-stamp:
40 dh_testdir
42 # Apply Debian specific patches
43 if test -d $(CURDIR)/debian/patches ;\
44 then \
45 for i in $(CURDIR)/debian/patches/*.diff.uu ;\
46 do \
47 cd $(CURDIR)/debian/patches ;\
48 uudecode "$$i" ;\
49 cd $(CURDIR) ;\
50 done ;\
51 patches=$$(find $(CURDIR)/debian/patches -name *.diff | sort);\
52 fi ;\
53 if test ! -f patch-stamp; then \
54 for patch in $$patches ;\
55 do \
56 echo APPLYING PATCH\: "$${patch##*/}" ;\
57 patch -p1 < "$$patch" ;\
58 done ;\
59 touch patch-stamp ;\
62 # KDE CVS does not have aclocal.m4 or configure
63 if test ! -f configure; then \
64 $(MAKE) -f admin/Makefile.common ;\
67 # ensure configure is executable
68 chmod +x configure
70 # make build directory
71 mkdir $(objdir)
73 # run configure with build tree $(objdir)
74 cd $(objdir) && \
75 ../configure $(configkde) --enable-final
77 touch configure-stamp
79 #Architecture
80 build: build-arch build-indep
82 build-arch: build-arch-stamp
83 build-arch-stamp: configure-stamp
84 dh_testdir
86 cd $(objdir) && \
87 $(MAKE)
89 # generate manpages
90 #for i in debian/man/*.sgml; do \
91 docbook-to-man $$i > `dirname $$i`/`basename $$i .sgml`.1 ;\
92 done
94 # Generate man pages
95 set -e; while read package binary; do \
96 soelim -Idebian/man debian/man/$$binary.man \
97 >debian/man/$$binary.1; \
98 done <debian/man/manpages.in
100 touch build-arch-stamp
102 build-indep: build-indep-stamp
103 build-indep-stamp: configure-stamp
104 dh_testdir
106 cd $(objdir) && \
107 $(MAKE)
109 #cd $(objdir) && \
110 $(MAKE) apidox
112 touch build-indep-stamp
114 debian-clean:
115 dh_testdir
116 dh_testroot
118 dh_clean
120 clean:
121 dh_testdir
122 dh_testroot
123 rm -f build-arch-stamp build-indep-stamp configure-stamp \
124 debian/debiandirs debian/man/*.1
126 # Remove Debian specific patches
127 if test -d $(CURDIR)/debian/patches ;\
128 then \
129 patches=$$(find $(CURDIR)/debian/patches -name *.diff | sort -r);\
130 fi ;\
131 if test -f patch-stamp; then \
132 for patch in $$patches ;\
133 do \
134 echo REMOVING PATCH\: "$${patch##*/}" ;\
135 patch -p1 -R < "$$patch" ;\
136 done ;\
137 for i in $(CURDIR)/debian/patches/*.diff.uu ;\
138 do \
139 rm -f "$${i%%.uu}" ;\
140 done ;\
141 rm -f patch-stamp ;\
144 # Remove build tree
145 rm -rf $(objdir)
147 # if Makefile exists run distclean
148 if test -f Makefile; then \
149 $(MAKE) distclean; \
152 if test -d CVS; then \
153 $(MAKE) -f admin/Makefile.common cvs-clean ;\
156 dh_clean
158 install: install-arch install-indep
160 install-arch:
161 dh_testdir
162 dh_testroot
163 dh_clean -k -s
164 dh_installdirs -s
166 cd $(objdir) && \
167 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
169 dh_install -s
171 install-indep:
172 dh_testdir
173 dh_testroot
174 dh_clean -k -i
175 dh_installdirs -i
177 cd $(objdir) && \
178 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
180 #cd $(objdir) && \
181 $(MAKE) install-apidox DESTDIR=$(CURDIR)/debian/tmp
183 dh_install -i
185 # Must not depend on anything. This is to be called by
186 # binary-arch/binary-indep
187 # in another 'make' thread.
188 binary-common:
189 dh_testdir
190 dh_testroot
191 dh_installchangelogs
192 dh_installdocs
193 # dh_installexamples
194 dh_installmenu
195 # dh_installdebconf
196 # dh_installlogrotate
197 # dh_installemacsen
198 # dh_installpam
199 # dh_installmime
200 # dh_installinit
201 # dh_installcron
202 # dh_installinfo
203 dh_installman
204 dh_link
205 dh_strip
206 dh_compress -X.bz2 -X.css -X.dcl -X.docbook -X-license -X.tag
207 dh_fixperms
208 # dh_perl
209 # dh_python
210 dh_makeshlibs -V
211 dh_installdeb
212 dh_shlibdeps
213 dh_gencontrol
214 dh_md5sums
215 dh_builddeb
217 # Build architecture independant packages using the common target.
218 binary-indep: build-indep install-indep
219 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
221 # Build architecture dependant packages using the common target.
222 binary-arch: build-arch install-arch
223 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
225 binary: binary-arch binary-indep
226 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure