]> git.saurik.com Git - apt.git/blob - debian/rules
releasing version 0.8.16~exp12ubuntu7
[apt.git] / debian / rules
1 #!/usr/bin/make -f
2 # Made with the aid of dh_make, by Craig Small
3 # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
4 # Some lines taken from debmake, by Christoph Lameter.
5
6 # build in verbose mode by default to make it easy to diangose issues
7 export NOISY=1
8
9 export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11 export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
12
13 # FOR AUTOCONF 2.52 AND NEWER ONLY
14 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
15 confflags += --build $(DEB_HOST_GNU_TYPE)
16 else
17 confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
18 endif
19
20 # See below
21 -include build/environment.mak
22
23 ifneq (,$(shell which dpkg-buildflags))
24 export CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS)
25 export LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
26 export CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
27 else
28 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
29 export CXXFLAGS = -O0 -g -Wall
30 else
31 export CXXFLAGS = -O2 -g -Wall
32 endif
33 endif
34
35 # Default rule
36 build:
37
38 PKG=apt
39 DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS)
40 APT_DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p' | sed -e 's/\+.*$$//')
41 APT_CONFVER=$(shell sed -n -e 's/^AC_DEFINE_UNQUOTED(VERSION,"\(.*\)")/\1/p' configure.in)
42 APT_CVSTAG=$(shell echo "$(APT_DEBVER)" | sed -e 's/^/v/' -e 's/\./_/g')
43
44 # Determine the build directory to use
45 BASE=.
46 ifdef BUILD
47 BUILD_POSSIBLE := $(BUILD) $(BASE)/$(BUILD)
48 else
49 BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname --machine) $(BASE)/build
50 endif
51 BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
52 BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
53 override BLD := $(BUILDX)
54
55 ifeq ($(words $(BLD)),0)
56 override BLD := ./build
57 endif
58
59 # Rebuild configure.in to have the correct version from the change log
60 ifneq ($(APT_DEBVER),$(APT_CONFVER))
61 ifneq ($(APT_DEBVER),)
62 .PHONY: configure.in
63 configure.in:
64 sed -e 's/$(APT_CONFVER)/$(APT_DEBVER)/' $@ > $@.$$$$ && mv $@.$$$$ $@
65 endif
66 else
67 configure.in:
68 endif
69
70 # APT Programs in apt-utils
71 APT_UTILS=ftparchive sortpkgs extracttemplates internal-solver
72
73 # Uncomment this to turn on verbose mode.
74 #export DH_VERBOSE=1
75
76 # Find the libapt-pkg major version for use in other control files
77 include buildlib/libversion.mak
78
79 # Determine which library package names to use
80 LIBAPT_PKG=libapt-pkg$(LIBAPTPKG_MAJOR)
81 LIBAPT_INST=libapt-inst$(LIBAPTINST_MAJOR)
82
83 # do not fail as we are just experimenting with symbol files for now
84 export DPKG_GENSYMBOLS_CHECK_LEVEL=0
85
86 build: build/build-stamp
87 build-doc: build/build-doc-stamp
88
89 # Note that this is unconditionally done first as part of loading environment.mak
90 # The true is needed to force make to reload environment.mak after running
91 # configure-stamp. Otherwise we can get stale or invalid, or missing config data.
92 build/environment.mak: build/configure-stamp
93 @true
94
95 configure: configure.in
96 build/configure-stamp: configure
97 dh_testdir
98 -mkdir build
99 cp COPYING debian/copyright
100 cd build && CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" ../configure $(confflags)
101 touch $@
102
103 build/build-stamp: build/configure-stamp
104 # Add here commands to compile the package.
105 $(MAKE) binary
106 # compat symlink for the locale split
107 mkdir -p build/usr/share
108 cd build/usr/share && ln -f -s ../../locale .
109 # compile and run tests
110 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
111 $(MAKE) test
112 else
113 @echo "Tests DISABLED"
114 endif
115 touch $@
116
117 build/build-doc-stamp: build/configure-stamp
118 # Add here commands to compile the package.
119 $(MAKE) doc
120 touch $@
121
122 clean:
123 dh_testdir
124
125 [ ! -f Makefile ] || $(MAKE) clean distclean
126 rm -rf build
127 rm -f debian/$(LIBAPT_PKG).install debian/$(LIBAPT_INST).install \
128 debian/libapt-pkg-dev.install
129
130 debian/%.install: debian/%.install.in
131 sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
132
133 binary-indep: apt-doc libapt-pkg-doc
134 # Build architecture-independent files here.
135 libapt-pkg-doc: build-doc
136 dh_testdir -p$@
137 dh_testroot -p$@
138 dh_prep -p$@
139 dh_installdirs -p$@
140 #
141 # libapt-pkg-doc install
142 #
143 dh_installdocs -p$@ $(BLD)/docs/design* \
144 $(BLD)/docs/dpkg-tech* \
145 $(BLD)/docs/files* \
146 $(BLD)/docs/method* \
147 doc/libapt-pkg2_to_3.txt \
148 doc/style.txt \
149 $(BLD)/doc/doxygen/html
150 dh_installexamples -p$@
151
152 dh_installchangelogs -p$@
153 dh_strip -p$@
154 dh_compress -p$@
155 dh_fixperms -p$@
156 dh_installdeb -p$@
157 dh_gencontrol -p$@
158 dh_md5sums -p$@
159 dh_builddeb -p$@
160
161 apt-doc: build-doc
162 dh_testdir -p$@
163 dh_testroot -p$@
164 dh_prep -p$@
165 #
166 # apt-doc install
167 #
168 # Copy the guides
169 dh_installdocs -p$@ $(BLD)/docs/guide*.text \
170 $(BLD)/docs/guide*.html \
171 $(BLD)/docs/offline*.text \
172 $(BLD)/docs/offline*.html
173 dh_installchangelogs -p$@
174 dh_compress -p$@
175 dh_fixperms -p$@
176 dh_installdeb -p$@
177 dh_gencontrol -p$@
178 dh_md5sums -p$@
179 dh_builddeb -p$@
180
181
182
183 # Build architecture-dependent files here.
184
185 binary-arch: $(LIBAPT_PKG) $(LIBAPT_INST) apt libapt-pkg-dev apt-utils apt-transport-https
186 apt_MANPAGES = apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list
187 apt: build build-doc
188 dh_testdir -p$@
189 dh_testroot -p$@
190 dh_prep -p$@
191 dh_installdirs -p$@
192 #
193 # apt install
194 #
195 cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove
196 cp debian/apt.conf.changelog debian/$@/etc/apt/apt.conf.d/20changelog
197 cp share/ubuntu-archive.gpg debian/$@/usr/share/$@
198
199 # make rosetta happy and remove pot files in po/ (but leave stuff
200 # in po/domains/* untouched) and cp *.po into each domain dir
201 rm -f build/po/*.pot
202 rm -f po/*.pot
203
204 dh_install -p$@ --sourcedir=$(BLD)
205
206 # Remove the bits that are in apt-utils
207 rm $(addprefix debian/$@/usr/bin/apt-,$(APT_UTILS) dump-solver)
208
209 # https has its own package
210 rm debian/$@/usr/lib/apt/methods/https
211
212 # move the mirror failure script in place
213 #mv debian/$@/usr/bin/apt-report-mirror-failure \
214 # debian/$@/usr/lib/apt/apt-report-mirror-failure \
215
216 dh_bugfiles -p$@
217 dh_lintian -p$@
218 dh_installexamples -p$@ $(BLD)/docs/examples/*
219 dh_installman -p$@ $(wildcard $(patsubst %,doc/%.[158],$(apt_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt_MANPAGES)))
220 dh_installcron -p$@
221 dh_installdocs -p$@
222 dh_installchangelogs -p$@
223 dh_installlogrotate -p$@
224 dh_strip -p$@
225 dh_compress -p$@
226 dh_fixperms -p$@
227 dh_installdeb -p$@
228 dh_shlibdeps -p$@
229 dh_gencontrol -p$@
230 dh_md5sums -p$@
231 dh_builddeb -p$@
232
233 libapt-pkg-dev: build debian/libapt-pkg-dev.install
234 dh_testdir -p$@
235 dh_testroot -p$@
236 dh_prep -p$@
237 dh_installdirs -p$@
238 #
239 # libapt-pkg-dev install
240 #
241 dh_install -p$@ --sourcedir=$(BLD)
242 dh_installdocs -p$@
243 dh_installchangelogs -p$@
244 dh_strip -p$@
245 dh_compress -p$@
246 dh_fixperms -p$@
247 dh_installdeb -p$@
248 dh_gencontrol -p$@ -- -Vlibapt-pkg-name=$(LIBAPT_PKG) -Vlibapt-inst-name=$(LIBAPT_INST)
249 dh_md5sums -p$@
250 dh_builddeb -p$@
251
252 apt-utils_MANPAGES = apt-sortpkgs apt-ftparchive apt-extracttemplates
253 apt-utils: build
254 dh_testdir -p$@
255 dh_testroot -p$@
256 dh_prep -p$@
257 dh_installdirs -p$@
258
259 cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/
260 cp $(BLD)/bin/apt-dump-solver debian/$@/usr/lib/apt/solvers/dump
261
262 dh_install -p$@ --sourcedir=$(BLD)
263 dh_link -p$@
264 dh_installdocs -p$@
265 dh_installexamples -p$@
266
267 # Install the man pages..
268 dh_installman -p$@ $(wildcard $(patsubst %,doc/%.[158],$(apt-utils_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt-utils_MANPAGES)))
269
270 dh_installchangelogs -p$@
271 dh_strip -p$@
272 dh_compress -p$@
273 dh_fixperms -p$@
274 dh_makeshlibs -p$@
275 dh_installdeb -p$@
276 dh_shlibdeps -p$@
277 dh_gencontrol -p$@
278 dh_md5sums -p$@
279 dh_builddeb -p$@
280
281 $(LIBAPT_PKG): build debian/$(LIBAPT_PKG).install
282 dh_testdir -p$@
283 dh_testroot -p$@
284 dh_prep -p$@
285 dh_installdirs -p$@
286
287 dh_install -p$@ --sourcedir=$(BLD)
288 dh_installdocs -p$@
289 dh_installchangelogs -p$@
290 dh_strip -p$@
291 dh_compress -p$@
292 dh_fixperms -p$@
293 dh_makeshlibs -p$@
294 dh_installdeb -p$@
295 dh_shlibdeps -p$@
296 dh_gencontrol -p$@
297 dh_md5sums -p$@
298 dh_builddeb -p$@
299
300 $(LIBAPT_INST): build debian/$(LIBAPT_INST).install
301 dh_testdir -p$@
302 dh_testroot -p$@
303 dh_prep -p$@
304 dh_installdirs -p$@
305
306 dh_install -p$@ --sourcedir=$(BLD)
307 dh_installdocs -p$@
308 dh_installchangelogs -p$@
309 dh_strip -p$@
310 dh_compress -p$@
311 dh_fixperms -p$@
312 dh_makeshlibs -p$@
313 dh_installdeb -p$@
314 dh_shlibdeps -p$@
315 dh_gencontrol -p$@
316 dh_md5sums -p$@
317 dh_builddeb -p$@
318
319 apt-transport-https: build libapt-pkg-dev
320 dh_testdir -p$@
321 dh_testroot -p$@
322 dh_prep -p$@
323 dh_installdirs -p$@
324
325 dh_install -p$@ --sourcedir=$(BLD)
326 dh_installdocs -p$@ debian/apt-transport-https.README
327 dh_installexamples -p$@
328
329 # Install the man pages..
330 dh_installman -p$@
331
332 dh_installchangelogs -p$@
333 dh_strip -p$@
334 dh_compress -p$@
335 dh_fixperms -p$@
336 dh_installdeb -p$@
337 dh_shlibdeps -p$@
338 dh_gencontrol -p$@
339 dh_md5sums -p$@
340 dh_builddeb -p$@
341
342 configure:
343 $(MAKE) configure
344
345 really-clean: clean
346 -find . -name Makefile.in -print0 | xargs --null --no-run-if-empty -- rm -f
347 find -name ChangeLog | xargs rm -f
348 rm -f l33ch-stamp
349
350 binary: binary-indep binary-arch
351 .PHONY: build clean binary-indep binary-arch binary