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 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
)
8 export DEB_HOST_MULTIARCH ?
= $(shell dpkg-architecture
-qDEB_HOST_MULTIARCH
)
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
)
14 confflags
+= --build
$(DEB_BUILD_GNU_TYPE
) --host
$(DEB_HOST_GNU_TYPE
)
18 -include build
/environment.mak
20 ifneq (,$(shell which dpkg-buildflags
))
21 export CXXFLAGS
= $(shell dpkg-buildflags
--get CXXFLAGS
)
23 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
24 export CXXFLAGS
= -O0
-g
-Wall
26 export CXXFLAGS
= -O2
-g
-Wall
34 DEB_BUILD_PROG
:=debuild
--preserve-envvar PATH
--preserve-envvar CCACHE_DIR
-us
-uc
$(DEB_BUILD_PROG_OPTS
)
35 APT_DEBVER
=$(shell dpkg-parsechangelog |sed
-n
-e
'/^Version:/s/^Version: //p' | sed
-e
's/\+.*$$//')
36 APT_CONFVER
=$(shell sed
-n
-e
's/^AC_DEFINE_UNQUOTED(VERSION,"\(.*\)")/\1/p' configure.in
)
37 APT_CVSTAG
=$(shell echo
"$(APT_DEBVER)" | sed
-e
's/^/v/' -e
's/\./_/g')
39 # Determine the build directory to use
42 BUILD_POSSIBLE
:= $(BUILD
) $(BASE
)/$(BUILD
)
44 BUILD_POSSIBLE
:= $(BASE
) $(BASE
)/build-
$(shell uname
--machine
) $(BASE
)/build
46 BUILDX
:= $(foreach i
,$(BUILD_POSSIBLE
),$(wildcard $(i
)/environment.mak
*))
47 BUILDX
:= $(patsubst %/,%,$(firstword $(dir $(BUILDX
))))
48 override BLD
:= $(BUILDX
)
50 ifeq ($(words $(BLD
)),0)
51 override BLD
:= .
/build
54 # Rebuild configure.in to have the correct version from the change log
55 ifneq ($(APT_DEBVER
),$(APT_CONFVER
))
56 ifneq ($(APT_DEBVER
),)
59 sed
-e
's/$(APT_CONFVER)/$(APT_DEBVER)/' $@
> $@.
$$$$ && mv
$@.
$$$$ $@
65 # APT Programs in apt-utils
66 APT_UTILS
=ftparchive sortpkgs extracttemplates internal-solver
68 # Uncomment this to turn on verbose mode.
71 # Find the libapt-pkg major version for use in other control files
72 include buildlib
/libversion.mak
74 # Determine which library package names to use
75 LIBAPT_PKG
=libapt-pkg
$(LIBAPTPKG_MAJOR
)
76 LIBAPT_INST
=libapt-inst
$(LIBAPTINST_MAJOR
)
78 # do not fail as we are just experimenting with symbol files for now
79 export DPKG_GENSYMBOLS_CHECK_LEVEL
=0
81 build
: build
/build-stamp
82 build-doc
: build
/build-doc-stamp
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
90 configure
: configure.in
91 build
/configure-stamp
: configure
94 cp COPYING debian
/copyright
95 cd build
&& CXXFLAGS
="$(CXXFLAGS)" ..
/configure
$(confflags
)
98 build
/build-stamp
: build
/configure-stamp
99 # Add here commands to compile the package.
101 # compat symlink for the locale split
102 mkdir
-p build
/usr
/share
103 cd build
/usr
/share
&& ln
-f
-s ..
/..
/locale .
104 # compile and run tests
105 ifeq (,$(findstring nocheck
, $(DEB_BUILD_OPTIONS
)))
108 @echo
"Tests DISABLED"
112 build
/build-doc-stamp
: build
/configure-stamp
113 # Add here commands to compile the package.
120 [ ! -f Makefile
] ||
$(MAKE
) clean distclean
122 rm -f debian
/$(LIBAPT_PKG
).
install debian
/$(LIBAPT_INST
).
install \
123 debian
/libapt-pkg-dev.
install
125 debian
/%.
install: debian
/%.
install.in
126 sed
's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
128 binary-indep
: apt-doc libapt-pkg-doc
129 # Build architecture-independent files here.
130 libapt-pkg-doc
: build-doc
136 # libapt-pkg-doc install
138 dh_installdocs
-p
$@
$(BLD
)/docs
/design
* \
139 $(BLD
)/docs
/dpkg-tech
* \
141 $(BLD
)/docs
/method
* \
142 doc
/libapt-pkg2_to_3.txt \
144 $(BLD
)/doc
/doxygen
/html
145 dh_installexamples
-p
$@
147 dh_installchangelogs
-p
$@
164 dh_installdocs
-p
$@
$(BLD
)/docs
/guide
*.text \
165 $(BLD
)/docs
/guide
*.html \
166 $(BLD
)/docs
/offline
*.text \
167 $(BLD
)/docs
/offline
*.html
168 dh_installchangelogs
-p
$@
178 # Build architecture-dependent files here.
180 binary-arch
: $(LIBAPT_PKG
) $(LIBAPT_INST
) apt libapt-pkg-dev apt-utils apt-transport-https
181 apt_MANPAGES
= apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list
190 cp debian
/apt.conf.autoremove debian
/$@
/etc
/apt
/apt.conf.d
/01autoremove
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
197 dh_install
-p
$@
--sourcedir
=$(BLD
)
199 # Remove the bits that are in apt-utils
200 rm $(addprefix debian
/$@
/usr
/bin
/apt-
,$(APT_UTILS
) dump-solver
)
202 # https has its own package
203 rm debian
/$@
/usr
/lib
/apt
/methods
/https
205 # move the mirror failure script in place
206 #mv debian/$@/usr/bin/apt-report-mirror-failure \
207 # debian/$@/usr/lib/apt/apt-report-mirror-failure \
211 dh_installexamples
-p
$@
$(BLD
)/docs
/examples
/*
212 dh_installman
-p
$@
$(wildcard $(patsubst %,doc
/%.
[158],$(apt_MANPAGES
)) $(patsubst %,doc
/*/%.
*.
[158],$(apt_MANPAGES
)))
215 dh_installchangelogs
-p
$@
216 dh_installlogrotate
-p
$@
226 libapt-pkg-dev
: build debian
/libapt-pkg-dev.
install
232 # libapt-pkg-dev install
234 dh_install
-p
$@
--sourcedir
=$(BLD
)
236 dh_installchangelogs
-p
$@
241 dh_gencontrol
-p
$@
-- -Vlibapt-pkg-name
=$(LIBAPT_PKG
) -Vlibapt-inst-name
=$(LIBAPT_INST
)
245 apt-utils_MANPAGES
= apt-sortpkgs apt-ftparchive apt-extracttemplates
252 cp
$(addprefix $(BLD
)/bin
/apt-
,$(APT_UTILS
)) debian
/$@
/usr
/bin
/
253 cp
$(BLD
)/bin
/apt-dump-solver debian
/$@
/usr
/lib
/apt
/solvers
/dump
255 dh_install
-p
$@
--sourcedir
=$(BLD
)
258 dh_installexamples
-p
$@
260 # Install the man pages..
261 dh_installman
-p
$@
$(wildcard $(patsubst %,doc
/%.
[158],$(apt-utils_MANPAGES
)) $(patsubst %,doc
/*/%.
*.
[158],$(apt-utils_MANPAGES
)))
263 dh_installchangelogs
-p
$@
274 $(LIBAPT_PKG
): build debian
/$(LIBAPT_PKG
).
install
280 dh_install
-p
$@
--sourcedir
=$(BLD
)
282 dh_installchangelogs
-p
$@
293 $(LIBAPT_INST
): build debian
/$(LIBAPT_INST
).
install
299 dh_install
-p
$@
--sourcedir
=$(BLD
)
301 dh_installchangelogs
-p
$@
312 apt-transport-https
: build libapt-pkg-dev
318 dh_install
-p
$@
--sourcedir
=$(BLD
)
319 dh_installdocs
-p
$@ debian
/apt-transport-https.README
320 dh_installexamples
-p
$@
322 # Install the man pages..
325 dh_installchangelogs
-p
$@
339 -find .
-name Makefile.in
-print0 | xargs
--null
--no-run-if-empty
-- rm -f
340 find
-name ChangeLog | xargs
rm -f
343 binary
: binary-indep binary-arch
344 .PHONY
: build
clean binary-indep binary-arch binary