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.
6 # build in verbose mode by default to make it easy to diangose issues
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 export PARALLEL
= $(or
$(patsubst parallel
=%,%,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
))),1)
14 # FOR AUTOCONF 2.52 AND NEWER ONLY
15 ifeq ($(DEB_BUILD_GNU_TYPE
), $(DEB_HOST_GNU_TYPE
))
16 confflags
+= --build
$(DEB_HOST_GNU_TYPE
)
18 confflags
+= --build
$(DEB_BUILD_GNU_TYPE
) --host
$(DEB_HOST_GNU_TYPE
)
21 # Set the number of procs to be run in parallel from the options.
22 confflags
+= --with-procs
=$(PARALLEL
)
25 -include build
/environment.mak
27 ifneq (,$(shell which dpkg-buildflags
))
28 # make does not export to $(shell) so we need to workaround
29 # (http://savannah.gnu.org/bugs/?10593)
30 dpkg_buildflags
= DEB_BUILD_MAINT_OPTIONS
=hardening
=+all dpkg-buildflags
31 export CXXFLAGS
= $(shell $(dpkg_buildflags
) --get CXXFLAGS
)
32 export LDFLAGS
= $(shell $(dpkg_buildflags
) --get LDFLAGS
)
33 export CPPFLAGS
= $(shell $(dpkg_buildflags
) --get CPPFLAGS
)
35 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
36 export CXXFLAGS
= -O0
-g
-Wall
38 export CXXFLAGS
= -O2
-g
-Wall
45 # Determine the build directory to use
47 override BLD
:= $(BASE
)/build
49 # When building without <nocheck>, the header is available and thus the test is
50 # successful. When building with <nocheck>, the header is missing, but we still
51 # pretend it to be available, because configure would fail otherwise.
52 export ac_cv_header_gtest_gtest_h
=yes
54 # APT Programs in apt-utils
55 APT_UTILS
=ftparchive sortpkgs extracttemplates
57 # Uncomment this to turn on verbose mode.
60 # Find the libapt-pkg major version for use in other control files
61 include buildlib
/libversion.mak
63 # Determine which library package names to use
64 LIBAPT_PKG
=libapt-pkg
$(LIBAPTPKG_MAJOR
)
65 LIBAPT_INST
=libapt-inst
$(LIBAPTINST_MAJOR
)
67 # do not fail as we are just experimenting with symbol files for now
68 export DPKG_GENSYMBOLS_CHECK_LEVEL
=0
70 build-binary
: build
/build-binary-stamp
71 build-docbook
: build
/build-docbook-stamp
72 build-manpages
: build
/build-manpages-stamp
74 # Note that this is unconditionally done first as part of loading environment.mak
75 # The true is needed to force make to reload environment.mak after running
76 # configure-stamp. Otherwise we can get stale or invalid, or missing config data.
77 build
/environment.mak
: build
/configure-stamp
80 configure
: configure.ac
81 build
/configure-stamp
: configure buildlib
/config.sub buildlib
/config.guess
84 cp COPYING debian
/copyright
85 cd build
&& CXXFLAGS
="$(CXXFLAGS)" LDFLAGS
="$(LDFLAGS)" CPPFLAGS
="$(CPPFLAGS)" ..
/configure
$(confflags
)
88 build
/build-binary-stamp
: build
/configure-stamp
89 # Add here commands to compile the package.
91 # compat symlink for the locale split
92 mkdir
-p build
/usr
/share
93 cd build
/usr
/share
&& ln
-f
-s ..
/..
/locale .
94 # compile and run tests
95 ifeq (,$(findstring nocheck
, $(DEB_BUILD_OPTIONS
)))
98 @echo
"Tests DISABLED"
102 build
/build-docbook-stamp
: build
/configure-stamp
103 # Add here commands to compile the package.
107 build
/build-manpages-stamp
: build
/configure-stamp
108 # Add here commands to compile the package.
116 [ ! -f Makefile
] ||
$(MAKE
) clean distclean
118 rm -f debian
/$(LIBAPT_PKG
).
install debian
/$(LIBAPT_INST
).
install \
119 debian
/libapt-pkg-dev.
install debian
/apt.
install
120 test ! -L buildlib
/config.guess ||
rm -f buildlib
/config.guess
121 test ! -L buildlib
/config.sub ||
rm -f buildlib
/config.sub
123 debian
/%.
install: debian
/%.
install.in
124 sed
's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
126 # Build architecture-independent files here.
127 libapt-pkg-doc
: build-docbook
133 # libapt-pkg-doc install
135 rm -f
$(BLD
)/doc
/doxygen
/html
/*.map
$(BLD
)/doc
/doxygen
/html
/*.md5
137 dh_installexamples
-p
$@
139 dh_installchangelogs
-p
$@
141 dh_compress
-p
$@
-X.xhtml
148 apt-doc
: build-docbook
157 dh_installchangelogs
-p
$@
167 # Build architecture-dependent files here.
169 apt_MANPAGES
= apt apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list
170 apt
: build-binary build-manpages debian
/apt.
install
178 cp debian
/apt.conf.autoremove debian
/$@
/etc
/apt
/apt.conf.d
/01autoremove
179 cp debian
/apt.auto-removal.sh debian
/$@
/etc
/kernel
/postinst.d
/apt-auto-removal
180 chmod
755 debian
/$@
/etc
/kernel
/postinst.d
/apt-auto-removal
181 # install vendor specific apt confs
182 find
-L vendor
/current
-name
'apt.conf-*' | while read conf
; do cp
"$${conf}" "debian/$@/etc/apt/apt.conf.d/$${conf#*-}"; done
184 # make rosetta happy and remove pot files in po/ (but leave stuff
185 # in po/domains/* untouched) and cp *.po into each domain dir
189 dh_install
-p
$@
--sourcedir
=$(BLD
)
191 # Remove the bits that are in apt-utils
192 rm $(addprefix debian
/$@
/usr
/bin
/apt-
,$(APT_UTILS
) dump-solver internal-solver internal-planner
)
193 cp
$(BLD
)/bin
/apt-dump-solver debian
/$@
/usr
/lib
/apt
/solvers
/dump
194 ln
-s ..
/solvers
/dump debian
/$@
/usr
/lib
/apt
/planners
/dump
196 # https has its own package
197 rm debian
/$@
/usr
/lib
/apt
/methods
/https
199 # move the mirror failure script in place
200 #mv debian/$@/usr/bin/apt-report-mirror-failure \
201 # debian/$@/usr/lib/apt/apt-report-mirror-failure \
203 # move the apt-helper in place
204 mv debian
/$@
/usr
/bin
/apt-helper debian
/$@
/usr
/lib
/apt
/apt-helper
205 # install apt.systemd.daily helper in the right place
206 install -m755 debian
/apt.systemd.daily debian
/$@
/usr
/lib
/apt
/
210 dh_installexamples
-p
$@
211 dh_installman
-p
$@
$(wildcard $(patsubst %,doc
/en
/%.
[158],$(apt_MANPAGES
)) $(patsubst %,doc
/*/%.
*.
[158],$(apt_MANPAGES
)))
212 dh_installcron
-p
$@
--name
=apt-compat
213 dh_systemd_enable
-p
$@ apt-daily.timer
214 dh_systemd_start
-p
$@ apt-daily.timer
216 dh_installchangelogs
-p
$@
217 dh_installlogrotate
-p
$@
224 dh_gencontrol
-p
$@
-- -Vapt
:keyring
="$(shell ./vendor/getinfo keyring-package)"
228 libapt-pkg-dev
: build-binary debian
/libapt-pkg-dev.
install
234 # libapt-pkg-dev install
236 dh_install
-p
$@
--sourcedir
=$(BLD
)
238 dh_installchangelogs
-p
$@
243 dh_gencontrol
-p
$@
-- -Vlibapt-pkg-name
=$(LIBAPT_PKG
) -Vlibapt-inst-name
=$(LIBAPT_INST
)
247 apt-utils_MANPAGES
= apt-sortpkgs apt-ftparchive apt-extracttemplates
248 apt-utils
: build-binary build-manpages
254 cp
$(addprefix $(BLD
)/bin
/apt-
,$(APT_UTILS
)) debian
/$@
/usr
/bin
/
255 cp
$(BLD
)/bin
/apt-internal-solver debian
/$@
/usr
/lib
/apt
/solvers
/apt
256 cp
$(BLD
)/bin
/apt-internal-planner debian
/$@
/usr
/lib
/apt
/planners
/apt
258 dh_install
-p
$@
--sourcedir
=$(BLD
)
261 dh_installexamples
-p
$@
263 # Install the man pages..
264 dh_installman
-p
$@
$(wildcard $(patsubst %,doc
/en
/%.
[158],$(apt-utils_MANPAGES
)) $(patsubst %,doc
/*/%.
*.
[158],$(apt-utils_MANPAGES
)))
266 dh_installchangelogs
-p
$@
277 $(LIBAPT_PKG
): build-binary debian
/$(LIBAPT_PKG
).
install
283 dh_install
-p
$@
--sourcedir
=$(BLD
)
285 dh_installchangelogs
-p
$@
296 $(LIBAPT_INST
): build-binary debian
/$(LIBAPT_INST
).
install
302 dh_install
-p
$@
--sourcedir
=$(BLD
)
304 dh_installchangelogs
-p
$@
315 apt-transport-https
: build-binary libapt-pkg-dev
321 dh_install
-p
$@
--sourcedir
=$(BLD
)
323 dh_installexamples
-p
$@
325 # Install the man pages..
328 dh_installchangelogs
-p
$@
338 buildlib
/config.guess buildlib
/config.sub
:
344 # translate targets to targets required by debian-policy
345 binary-arch
: $(LIBAPT_PKG
) $(LIBAPT_INST
) apt libapt-pkg-dev apt-utils apt-transport-https
346 binary-indep
: apt-doc libapt-pkg-doc
347 binary
: binary-indep binary-arch
348 build-arch
: build-binary
349 build-indep
: build-manpages build-docbook
350 build
: build-indep build-arch
352 .PHONY
: build
clean binary-indep binary-arch binary