Saner handling if config.mk doesn't exist: use a default config.defaults.mk.
[wvstreams.git] / debian / rules
blob8c7557419f13d0f4b1f6c4f938261cc13e158e05
1 #!/usr/bin/make -f
2 # debian/rules for WvStreams, using debhelper.
4 # Based on the sample debian/rules under GNU copyright 1997 to 1999 by
5 # Joey Hess, with revisions by Bill Allombert in 2001.
7 # Uncomment this to turn on verbose mode.
8 #export DH_VERBOSE=1
10 # This has to be exported to make some magic below work.
11 export DH_OPTIONS
13 # Don't rebuild the configure script
14 export WE_ARE_DIST=1
16 # These are used for cross-compiling and for saving the configure script
17 # from having to guess our platform (since we know it already)
18 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
19 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
21 version:=$(shell awk -F= '/SO_VERSION=/{print $$2}' $(CURDIR)/configure.ac)
22 base=libwvstreams$(version)
23 # This is used the wvstreams makefile to set the .so links
24 PKG=$(CURDIR)/debian/${base}
25 PKG_QT=$(CURDIR)/debian/${base}-qt
26 PKGDEV=$(CURDIR)/debian/libwvstreams-dev
27 PKGDOC=$(CURDIR)/debian/${base}-doc
28 DOCDIR=$(PKGDOC)/usr/share/doc/$(base)-doc
30 CFLAGS = -Wall
32 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
33 CFLAGS += -g
34 endif
35 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
36 CFLAGS += -O0
37 else
38 CFLAGS += -O2
39 endif
40 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
41 INSTALL_PROGRAM += -s
42 endif
44 config.status: configure
45 dh_testdir
46 # Add here commands to configure the package.
47 CFLAGS="$(CFLAGS)" ./configure \
48 --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
49 --prefix=/usr --mandir=\$${prefix}/share/man \
50 --infodir=\$${prefix}/share/info \
51 --sysconfdir=/etc --localstatedir=/var \
52 --disable-debug --disable-verbose \
53 --with-qt --with-openslp
56 #Architecture
57 build: build-arch build-indep
59 build-arch: build-arch-stamp
60 build-arch-stamp: config.status
62 # Add here commands to compile the arch part of the package.
63 $(MAKE) VERBOSE=1 CXXOPTS="-fPIC -DPIC" COPTS="-fPIC -DPIC"
64 $(MAKE) VERBOSE=1 CXXOPTS="-fPIC -DPIC" COPTS="-fPIC -DPIC" uniconf/tests/uni
65 touch build-arch-stamp
67 build-indep: build-stamp-indep
68 build-stamp-indep: config.status
70 # Add here commands to compile the indep part of the package.
71 #$(MAKE) doc
72 $(MAKE) doxygen
73 @# Don't build the SGML documentation, as it is uncompilable.
74 @#$(MAKE) -C Docs/sgmlmanual html ps pdf
75 touch build-stamp-indep
77 clean:
78 dh_testdir
79 dh_testroot
80 rm -f build-stamp build-stamp-indep #CONFIGURE-STAMP#
82 # Add here commands to clean up after the build process.
83 -$(MAKE) -C Docs/sgmlmanual clean
84 -rm -rf Docs/doxy-html
85 -$(MAKE) -C xplc distclean
86 -$(MAKE) distclean
88 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
89 cp -f /usr/share/misc/config.sub config.sub
90 endif
91 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
92 cp -f /usr/share/misc/config.guess config.guess
93 endif
95 dh_clean
97 install: install-indep install-arch
98 install-indep:
99 dh_testdir
100 dh_testroot
101 dh_clean -k -i
102 dh_installdirs -i
104 # Add here commands to install the indep part of the package into
105 # debian/<package>-doc.
106 #INSTALLDOC#
107 install -d $(DOCDIR)
108 install -d $(DOCDIR)/html-api
109 find Docs/doxy-html -type f -exec install -m644 '{}' $(DOCDIR)/html-api/ ';'
111 # @# Don't install the SGML documentation.
112 # @install -d $(DOCDIR)/html-manual
113 # @install -m644 Docs/sgmlmanual/wvstreams.html/*.html \
114 # $(DOCDIR)/html-manual/
115 # @install -m644 Docs/sgmlmanual/wvstreams.ps \
116 # Docs/sgmlmanual/wvstreams.pdf \
117 # $(DOCDIR)
119 dh_install -i
121 install-arch:
122 dh_testdir
123 dh_testroot
124 dh_clean -k -s
125 dh_installdirs -s
127 # Add here commands to install the arch part of the package into
128 # debian/tmp.
129 #$(MAKE) install prefix=$(CURDIR)/debian/wvstreams/usr
131 # Install library package
133 # $(MAKE) installshared PREFIX=$(PKG)/usr
134 # Temporary Fix to work around a bug in Debhelper
135 $(MAKE) install-shared DESTDIR=$(CURDIR)/debian/tmp
137 # Install development package
138 $(MAKE) install-dev DESTDIR=$(PKGDEV)
140 # Install a minimal XPLC
141 $(MAKE) install-xplc DESTDIR=$(PKGDEV)
142 rm -f $(PKGDEV)/usr/lib/libxplc.so*
144 # Install UniConf daemon
145 $(MAKE) install-uniconfd DESTDIR=$(CURDIR)/debian/tmp
146 install -d $(CURDIR)/debian/tmp/etc/default
147 install -m644 debian/uniconfd.default debian/tmp/etc/default/uniconfd
149 # Install lintian overrides
150 install -m644 debian/libwvstreams$(version)-base.lintian-override debian/libwvstreams$(version)-base/usr/share/lintian/overrides/libwvstreams$(version)-base
151 install -m644 debian/libwvstreams$(version)-extras.lintian-override debian/libwvstreams$(version)-extras/usr/share/lintian/overrides/libwvstreams$(version)-extras
152 install -m644 debian/libwvstreams$(version)-qt.lintian-override debian/libwvstreams$(version)-qt/usr/share/lintian/overrides/libwvstreams$(version)-qt
154 dh_install -s
156 # Must not depend on anything. This is to be called by
157 # binary-arch/binary-indep
158 # in another 'make' thread.
159 binary-common:
160 dh_testdir
161 dh_testroot
162 dh_installchangelogs ChangeLog
163 dh_installdocs
164 dh_installexamples
165 # dh_installmenu
166 # dh_installdebconf
167 # dh_installlogrotate
168 # dh_installemacsen
169 # dh_installpam
170 # dh_installmime
171 dh_installinit
172 # dh_installcron
173 # dh_installinfo
174 dh_installman
175 dh_link
176 dh_strip --exclude=libwvtest.a
177 dh_compress
178 dh_fixperms
179 # dh_perl
180 # dh_python
181 dh_makeshlibs -plibwvstreams$(version)-base \
182 -plibwvstreams$(version)-extras \
183 -plibwvstreams$(version)-qt \
184 -plibuniconf$(version) \
185 dh_installdeb
186 dh_installdeb
187 dh_shlibdeps -L libwvstreams$(version)-base \
188 -L libwvstreams$(version)-extras \
189 -L libuniconf$(version) \
190 -l debian/libwvstreams$(version)-base/usr/lib:debian/libwvstreams$(version)-extras/usr/lib:debian/libuniconf$(version)/usr/lib
191 dh_gencontrol
192 dh_md5sums
193 dh_builddeb
194 # Build architecture independant packages using the common target.
195 binary-indep: build-indep install-indep
196 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
198 # Build architecture dependant packages using the common target.
199 binary-arch: build-arch install-arch
200 $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
202 binary: binary-arch binary-indep
203 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch