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