]>
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 | ||
386566e3 | 128 | binary-indep: apt-doc libapt-pkg-doc |
2d18d44e | 129 | # Build architecture-independent files here. |
149daa16 | 130 | libapt-pkg-doc: build-doc |
c64bcd92 AL |
131 | dh_testdir -p$@ |
132 | dh_testroot -p$@ | |
af7a92c3 | 133 | dh_prep -p$@ |
c64bcd92 | 134 | dh_installdirs -p$@ |
3a42cc3c AL |
135 | # |
136 | # libapt-pkg-doc install | |
70371bc8 DK |
137 | # |
138 | dh_installdocs -p$@ $(BLD)/docs/design* \ | |
139 | $(BLD)/docs/dpkg-tech* \ | |
140 | $(BLD)/docs/files* \ | |
141 | $(BLD)/docs/method* \ | |
142 | doc/libapt-pkg2_to_3.txt \ | |
d1aa9162 | 143 | doc/style.txt \ |
dc1e2a06 | 144 | $(BLD)/doc/doxygen/html |
c64bcd92 | 145 | dh_installexamples -p$@ |
c64bcd92 | 146 | |
c64bcd92 AL |
147 | dh_installchangelogs -p$@ |
148 | dh_strip -p$@ | |
149 | dh_compress -p$@ | |
150 | dh_fixperms -p$@ | |
c64bcd92 | 151 | dh_installdeb -p$@ |
782486e8 | 152 | dh_gencontrol -p$@ |
c64bcd92 AL |
153 | dh_md5sums -p$@ |
154 | dh_builddeb -p$@ | |
2d18d44e | 155 | |
16c76dd2 AL |
156 | apt-doc: build-doc |
157 | dh_testdir -p$@ | |
158 | dh_testroot -p$@ | |
af7a92c3 | 159 | dh_prep -p$@ |
16c76dd2 AL |
160 | # |
161 | # apt-doc install | |
162 | # | |
163 | # Copy the guides | |
70371bc8 DK |
164 | dh_installdocs -p$@ $(BLD)/docs/guide*.text \ |
165 | $(BLD)/docs/guide*.html \ | |
166 | $(BLD)/docs/offline*.text \ | |
167 | $(BLD)/docs/offline*.html | |
16c76dd2 AL |
168 | dh_installchangelogs -p$@ |
169 | dh_compress -p$@ | |
170 | dh_fixperms -p$@ | |
171 | dh_installdeb -p$@ | |
172 | dh_gencontrol -p$@ | |
173 | dh_md5sums -p$@ | |
174 | dh_builddeb -p$@ | |
175 | ||
176 | ||
2d18d44e | 177 | |
3a42cc3c | 178 | # Build architecture-dependent files here. |
3a42cc3c | 179 | |
7eee083a | 180 | binary-arch: $(LIBAPT_PKG) $(LIBAPT_INST) apt libapt-pkg-dev apt-utils apt-transport-https |
2a52e8c5 | 181 | apt_MANPAGES = apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list |
149daa16 | 182 | apt: build build-doc |
c64bcd92 AL |
183 | dh_testdir -p$@ |
184 | dh_testroot -p$@ | |
af7a92c3 | 185 | dh_prep -p$@ |
503a2291 | 186 | dh_installdirs -p$@ |
3a42cc3c AL |
187 | # |
188 | # apt install | |
189 | # | |
9d2938d4 | 190 | cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove |
2d18d44e | 191 | |
be2d3759 MV |
192 | # make rosetta happy and remove pot files in po/ (but leave stuff |
193 | # in po/domains/* untouched) and cp *.po into each domain dir | |
194 | rm -f build/po/*.pot | |
195 | rm -f po/*.pot | |
196 | ||
2cf8c58b DK |
197 | dh_install -p$@ --sourcedir=$(BLD) |
198 | ||
199 | # Remove the bits that are in apt-utils | |
7f471354 | 200 | rm $(addprefix debian/$@/usr/bin/apt-,$(APT_UTILS) dump-solver) |
2cf8c58b DK |
201 | |
202 | # https has its own package | |
203 | rm debian/$@/usr/lib/apt/methods/https | |
204 | ||
3f599bb7 | 205 | # move the mirror failure script in place |
23c5897c MV |
206 | #mv debian/$@/usr/bin/apt-report-mirror-failure \ |
207 | # debian/$@/usr/lib/apt/apt-report-mirror-failure \ | |
3f599bb7 | 208 | |
304c041b | 209 | dh_bugfiles -p$@ |
063a17d7 | 210 | dh_lintian -p$@ |
3fb71b27 | 211 | dh_installexamples -p$@ $(BLD)/docs/examples/* |
2a52e8c5 | 212 | dh_installman -p$@ $(wildcard $(patsubst %,doc/%.[158],$(apt_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt_MANPAGES))) |
0c132682 | 213 | dh_installcron -p$@ |
9e980be8 | 214 | dh_installdocs -p$@ |
c64bcd92 | 215 | dh_installchangelogs -p$@ |
2cf8c58b | 216 | dh_installlogrotate -p$@ |
c64bcd92 AL |
217 | dh_strip -p$@ |
218 | dh_compress -p$@ | |
219 | dh_fixperms -p$@ | |
c64bcd92 | 220 | dh_installdeb -p$@ |
bd5e34e8 | 221 | dh_shlibdeps -p$@ |
782486e8 | 222 | dh_gencontrol -p$@ |
c64bcd92 AL |
223 | dh_md5sums -p$@ |
224 | dh_builddeb -p$@ | |
225 | ||
cb1a690c | 226 | libapt-pkg-dev: build debian/libapt-pkg-dev.install |
c64bcd92 AL |
227 | dh_testdir -p$@ |
228 | dh_testroot -p$@ | |
af7a92c3 | 229 | dh_prep -p$@ |
c64bcd92 AL |
230 | dh_installdirs -p$@ |
231 | # | |
232 | # libapt-pkg-dev install | |
233 | # | |
2cf8c58b | 234 | dh_install -p$@ --sourcedir=$(BLD) |
c64bcd92 | 235 | dh_installdocs -p$@ |
c64bcd92 AL |
236 | dh_installchangelogs -p$@ |
237 | dh_strip -p$@ | |
238 | dh_compress -p$@ | |
239 | dh_fixperms -p$@ | |
c64bcd92 | 240 | dh_installdeb -p$@ |
ceab242d | 241 | dh_gencontrol -p$@ -- -Vlibapt-pkg-name=$(LIBAPT_PKG) -Vlibapt-inst-name=$(LIBAPT_INST) |
b2e465d6 AL |
242 | dh_md5sums -p$@ |
243 | dh_builddeb -p$@ | |
244 | ||
2a52e8c5 | 245 | apt-utils_MANPAGES = apt-sortpkgs apt-ftparchive apt-extracttemplates |
149daa16 | 246 | apt-utils: build |
b2e465d6 AL |
247 | dh_testdir -p$@ |
248 | dh_testroot -p$@ | |
af7a92c3 | 249 | dh_prep -p$@ |
b2e465d6 AL |
250 | dh_installdirs -p$@ |
251 | ||
b2e465d6 | 252 | cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/ |
66b6fe05 | 253 | cp $(BLD)/bin/apt-dump-solver debian/$@/usr/lib/apt/solvers/dump |
2cf8c58b DK |
254 | |
255 | dh_install -p$@ --sourcedir=$(BLD) | |
66b6fe05 | 256 | dh_link -p$@ |
b2e465d6 | 257 | dh_installdocs -p$@ |
53cd7e2b | 258 | dh_installexamples -p$@ |
201eaabd | 259 | |
b2e465d6 | 260 | # Install the man pages.. |
2a52e8c5 | 261 | dh_installman -p$@ $(wildcard $(patsubst %,doc/%.[158],$(apt-utils_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt-utils_MANPAGES))) |
90ebe30c | 262 | |
b2e465d6 AL |
263 | dh_installchangelogs -p$@ |
264 | dh_strip -p$@ | |
265 | dh_compress -p$@ | |
266 | dh_fixperms -p$@ | |
149daa16 | 267 | dh_makeshlibs -p$@ |
b2e465d6 | 268 | dh_installdeb -p$@ |
bd5e34e8 | 269 | dh_shlibdeps -p$@ |
782486e8 MV |
270 | dh_gencontrol -p$@ |
271 | dh_md5sums -p$@ | |
272 | dh_builddeb -p$@ | |
273 | ||
cb1a690c | 274 | $(LIBAPT_PKG): build debian/$(LIBAPT_PKG).install |
782486e8 MV |
275 | dh_testdir -p$@ |
276 | dh_testroot -p$@ | |
277 | dh_prep -p$@ | |
278 | dh_installdirs -p$@ | |
279 | ||
280 | dh_install -p$@ --sourcedir=$(BLD) | |
08c9b191 | 281 | dh_installdocs -p$@ |
782486e8 MV |
282 | dh_installchangelogs -p$@ |
283 | dh_strip -p$@ | |
284 | dh_compress -p$@ | |
285 | dh_fixperms -p$@ | |
f521559b | 286 | dh_makeshlibs -p$@ |
08c9b191 | 287 | dh_installdeb -p$@ |
782486e8 MV |
288 | dh_shlibdeps -p$@ |
289 | dh_gencontrol -p$@ | |
290 | dh_md5sums -p$@ | |
291 | dh_builddeb -p$@ | |
292 | ||
cb1a690c | 293 | $(LIBAPT_INST): build debian/$(LIBAPT_INST).install |
782486e8 MV |
294 | dh_testdir -p$@ |
295 | dh_testroot -p$@ | |
296 | dh_prep -p$@ | |
297 | dh_installdirs -p$@ | |
298 | ||
299 | dh_install -p$@ --sourcedir=$(BLD) | |
08c9b191 | 300 | dh_installdocs -p$@ |
782486e8 MV |
301 | dh_installchangelogs -p$@ |
302 | dh_strip -p$@ | |
303 | dh_compress -p$@ | |
304 | dh_fixperms -p$@ | |
f521559b | 305 | dh_makeshlibs -p$@ |
08c9b191 | 306 | dh_installdeb -p$@ |
bd5e34e8 | 307 | dh_shlibdeps -p$@ |
782486e8 | 308 | dh_gencontrol -p$@ |
c64bcd92 AL |
309 | dh_md5sums -p$@ |
310 | dh_builddeb -p$@ | |
2d18d44e | 311 | |
149daa16 | 312 | apt-transport-https: build libapt-pkg-dev |
d546f98d MV |
313 | dh_testdir -p$@ |
314 | dh_testroot -p$@ | |
af7a92c3 | 315 | dh_prep -p$@ |
d546f98d MV |
316 | dh_installdirs -p$@ |
317 | ||
2cf8c58b | 318 | dh_install -p$@ --sourcedir=$(BLD) |
370ad5e1 | 319 | dh_installdocs -p$@ debian/apt-transport-https.README |
d546f98d MV |
320 | dh_installexamples -p$@ |
321 | ||
322 | # Install the man pages.. | |
323 | dh_installman -p$@ | |
324 | ||
325 | dh_installchangelogs -p$@ | |
326 | dh_strip -p$@ | |
327 | dh_compress -p$@ | |
328 | dh_fixperms -p$@ | |
329 | dh_installdeb -p$@ | |
bd5e34e8 | 330 | dh_shlibdeps -p$@ |
d546f98d MV |
331 | dh_gencontrol -p$@ |
332 | dh_md5sums -p$@ | |
333 | dh_builddeb -p$@ | |
334 | ||
2d18d44e | 335 | configure: |
1d9fd7a2 | 336 | $(MAKE) configure |
2d18d44e | 337 | |
2d18d44e | 338 | really-clean: clean |
70371bc8 | 339 | -find . -name Makefile.in -print0 | xargs --null --no-run-if-empty -- rm -f |
2d18d44e AL |
340 | find -name ChangeLog | xargs rm -f |
341 | rm -f l33ch-stamp | |
342 | ||
343 | binary: binary-indep binary-arch | |
149daa16 | 344 | .PHONY: build clean binary-indep binary-arch binary |