rules 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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. export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  6. export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  7. # FOR AUTOCONF 2.52 AND NEWER ONLY
  8. ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  9. confflags += --build $(DEB_HOST_GNU_TYPE)
  10. else
  11. confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
  12. endif
  13. # See below
  14. -include build/environment.mak
  15. ifneq (,$(shell which dpkg-buildflags))
  16. export CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS)
  17. else
  18. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  19. export CXXFLAGS = -O0 -g -Wall
  20. else
  21. export CXXFLAGS = -O2 -g -Wall
  22. endif
  23. endif
  24. # Default rule
  25. build:
  26. PKG=apt
  27. DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS)
  28. APT_DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p' | sed -e 's/\+.*$$//')
  29. APT_CONFVER=$(shell sed -n -e 's/^AC_DEFINE_UNQUOTED(VERSION,"\(.*\)")/\1/p' configure.in)
  30. APT_CVSTAG=$(shell echo "$(APT_DEBVER)" | sed -e 's/^/v/' -e 's/\./_/g')
  31. # Determine the build directory to use
  32. BASE=.
  33. ifdef BUILD
  34. BUILD_POSSIBLE := $(BUILD) $(BASE)/$(BUILD)
  35. else
  36. BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname --machine) $(BASE)/build
  37. endif
  38. BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
  39. BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
  40. override BLD := $(BUILDX)
  41. ifeq ($(words $(BLD)),0)
  42. override BLD := ./build
  43. endif
  44. # Rebuild configure.in to have the correct version from the change log
  45. ifneq ($(APT_DEBVER),$(APT_CONFVER))
  46. ifneq ($(APT_DEBVER),)
  47. .PHONY: configure.in
  48. configure.in:
  49. sed -e 's/$(APT_CONFVER)/$(APT_DEBVER)/' $@ > $@.$$$$ && mv $@.$$$$ $@
  50. endif
  51. else
  52. configure.in:
  53. endif
  54. # APT Programs in apt-utils
  55. APT_UTILS=ftparchive sortpkgs extracttemplates
  56. # Uncomment this to turn on verbose mode.
  57. #export DH_VERBOSE=1
  58. # Find the libapt-pkg major version for use in other control files
  59. include buildlib/libversion.mak
  60. # do not fail as we are just experimenting with symbol files for now
  61. export DPKG_GENSYMBOLS_CHECK_LEVEL=0
  62. build: build/build-stamp
  63. build-doc: build/build-doc-stamp
  64. # Note that this is unconditionally done first as part of loading environment.mak
  65. # The true is needed to force make to reload environment.mak after running
  66. # configure-stamp. Otherwise we can get stale or invalid, or missing config data.
  67. build/environment.mak: build/configure-stamp
  68. @true
  69. configure: configure.in
  70. build/configure-stamp: configure
  71. dh_testdir
  72. -mkdir build
  73. cp COPYING debian/copyright
  74. cd build && CXXFLAGS="$(CXXFLAGS)" ../configure $(confflags)
  75. touch $@
  76. build/build-stamp: build/configure-stamp
  77. # Add here commands to compile the package.
  78. $(MAKE) binary
  79. touch $@
  80. build/build-doc-stamp: build/configure-stamp
  81. # Add here commands to compile the package.
  82. $(MAKE) doc
  83. touch $@
  84. clean:
  85. dh_testdir
  86. [ ! -f Makefile ] || $(MAKE) clean distclean
  87. rm -rf build
  88. binary-indep: apt-doc libapt-pkg-doc
  89. # Build architecture-independent files here.
  90. libapt-pkg-doc: build-doc
  91. dh_testdir -p$@
  92. dh_testroot -p$@
  93. dh_prep -p$@
  94. dh_installdirs -p$@
  95. #
  96. # libapt-pkg-doc install
  97. #
  98. # remove doxygen's embedded jquery as we don't use it anyway (#622147)
  99. rm -f $(BLD)/doc/doxygen/html/jquery.js
  100. dh_installdocs -p$@ $(BLD)/docs/design* \
  101. $(BLD)/docs/dpkg-tech* \
  102. $(BLD)/docs/files* \
  103. $(BLD)/docs/method* \
  104. doc/libapt-pkg2_to_3.txt \
  105. doc/style.txt \
  106. $(BLD)/doc/doxygen/html
  107. dh_installexamples -p$@
  108. dh_installchangelogs -p$@
  109. dh_strip -p$@
  110. dh_compress -p$@
  111. dh_fixperms -p$@
  112. dh_installdeb -p$@
  113. dh_gencontrol -p$@
  114. dh_md5sums -p$@
  115. dh_builddeb -p$@
  116. apt-doc: build-doc
  117. dh_testdir -p$@
  118. dh_testroot -p$@
  119. dh_prep -p$@
  120. #
  121. # apt-doc install
  122. #
  123. # Copy the guides
  124. dh_installdocs -p$@ $(BLD)/docs/guide*.text \
  125. $(BLD)/docs/guide*.html \
  126. $(BLD)/docs/offline*.text \
  127. $(BLD)/docs/offline*.html
  128. dh_installchangelogs -p$@
  129. dh_compress -p$@
  130. dh_fixperms -p$@
  131. dh_installdeb -p$@
  132. dh_gencontrol -p$@
  133. dh_md5sums -p$@
  134. dh_builddeb -p$@
  135. # Build architecture-dependent files here.
  136. binary-arch: libapt-pkg4.10 libapt-inst1.2 apt libapt-pkg-dev apt-utils apt-transport-https
  137. apt_MANPAGES = apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list
  138. apt: build build-doc
  139. dh_testdir -p$@
  140. dh_testroot -p$@
  141. dh_prep -p$@
  142. dh_installdirs -p$@
  143. #
  144. # apt install
  145. #
  146. cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove
  147. # make rosetta happy and remove pot files in po/ (but leave stuff
  148. # in po/domains/* untouched) and cp *.po into each domain dir
  149. rm -f build/po/*.pot
  150. rm -f po/*.pot
  151. dh_install -p$@ --sourcedir=$(BLD)
  152. # Remove the bits that are in apt-utils
  153. rm $(addprefix debian/$@/usr/bin/apt-,$(APT_UTILS))
  154. # https has its own package
  155. rm debian/$@/usr/lib/apt/methods/https
  156. # move the mirror failure script in place
  157. #mv debian/$@/usr/bin/apt-report-mirror-failure \
  158. # debian/$@/usr/lib/apt/apt-report-mirror-failure \
  159. dh_bugfiles -p$@
  160. dh_lintian -p$@
  161. dh_installexamples -p$@ $(BLD)/docs/examples/*
  162. dh_installman -p$@ $(wildcard $(patsubst %,doc/%.[158],$(apt_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt_MANPAGES)))
  163. dh_installcron -p$@
  164. dh_installdocs -p$@
  165. dh_installchangelogs -p$@
  166. dh_installlogrotate -p$@
  167. dh_strip -p$@
  168. dh_compress -p$@
  169. dh_fixperms -p$@
  170. dh_installdeb -p$@
  171. dh_shlibdeps -p$@ -l$(CURDIR)/debian/libapt-inst2.1/usr/lib:$(CURDIR)/debian/libapt-pkg4.10/usr/lib
  172. dh_gencontrol -p$@
  173. dh_md5sums -p$@
  174. dh_builddeb -p$@
  175. libapt-pkg-dev: build
  176. dh_testdir -p$@
  177. dh_testroot -p$@
  178. dh_prep -p$@
  179. dh_installdirs -p$@
  180. #
  181. # libapt-pkg-dev install
  182. #
  183. dh_install -p$@ --sourcedir=$(BLD)
  184. dh_installdocs -p$@
  185. dh_installchangelogs -p$@
  186. dh_strip -p$@
  187. dh_compress -p$@
  188. dh_fixperms -p$@
  189. dh_installdeb -p$@
  190. dh_gencontrol -p$@
  191. dh_md5sums -p$@
  192. dh_builddeb -p$@
  193. apt-utils_MANPAGES = apt-sortpkgs apt-ftparchive apt-extracttemplates
  194. apt-utils: build
  195. dh_testdir -p$@
  196. dh_testroot -p$@
  197. dh_prep -p$@
  198. dh_installdirs -p$@
  199. cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/
  200. dh_install -p$@ --sourcedir=$(BLD)
  201. dh_installdocs -p$@
  202. dh_installexamples -p$@
  203. # Install the man pages..
  204. dh_installman -p$@ $(wildcard $(patsubst %,doc/%.[158],$(apt-utils_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt-utils_MANPAGES)))
  205. dh_installchangelogs -p$@
  206. dh_strip -p$@
  207. dh_compress -p$@
  208. dh_fixperms -p$@
  209. dh_makeshlibs -p$@
  210. dh_installdeb -p$@
  211. dh_shlibdeps -p$@ -l$(CURDIR)/debian/libapt-inst2.1/usr/lib:$(CURDIR)/debian/libapt-pkg4.10/usr/lib
  212. dh_gencontrol -p$@
  213. dh_md5sums -p$@
  214. dh_builddeb -p$@
  215. libapt-pkg4.10: build
  216. dh_testdir -p$@
  217. dh_testroot -p$@
  218. dh_prep -p$@
  219. dh_installdirs -p$@
  220. dh_install -p$@ --sourcedir=$(BLD)
  221. dh_installchangelogs -p$@
  222. dh_strip -p$@
  223. dh_compress -p$@
  224. dh_fixperms -p$@
  225. dh_installdeb -p$@
  226. dh_makeshlibs -p$@
  227. dh_shlibdeps -p$@
  228. dh_gencontrol -p$@
  229. dh_md5sums -p$@
  230. dh_builddeb -p$@
  231. libapt-inst1.2: build
  232. dh_testdir -p$@
  233. dh_testroot -p$@
  234. dh_prep -p$@
  235. dh_installdirs -p$@
  236. dh_install -p$@ --sourcedir=$(BLD)
  237. dh_installchangelogs -p$@
  238. dh_strip -p$@
  239. dh_compress -p$@
  240. dh_fixperms -p$@
  241. dh_installdeb -p$@
  242. dh_makeshlibs -p$@
  243. dh_shlibdeps -p$@ -l$(CURDIR)/debian/libapt-pkg4.10/usr/lib
  244. dh_gencontrol -p$@
  245. dh_md5sums -p$@
  246. dh_builddeb -p$@
  247. apt-transport-https: build libapt-pkg-dev
  248. dh_testdir -p$@
  249. dh_testroot -p$@
  250. dh_prep -p$@
  251. dh_installdirs -p$@
  252. dh_install -p$@ --sourcedir=$(BLD)
  253. dh_installdocs -p$@ debian/apt-transport-https.README
  254. dh_installexamples -p$@
  255. # Install the man pages..
  256. dh_installman -p$@
  257. dh_installchangelogs -p$@
  258. dh_strip -p$@
  259. dh_compress -p$@
  260. dh_fixperms -p$@
  261. dh_installdeb -p$@
  262. dh_shlibdeps -p$@ -l$(CURDIR)/debian/apt/usr/lib:$(CURDIR)/debian/$@/usr/lib
  263. dh_gencontrol -p$@
  264. dh_md5sums -p$@
  265. dh_builddeb -p$@
  266. configure:
  267. $(MAKE) configure
  268. really-clean: clean
  269. -find . -name Makefile.in -print0 | xargs --null --no-run-if-empty -- rm -f
  270. find -name ChangeLog | xargs rm -f
  271. rm -f l33ch-stamp
  272. binary: binary-indep binary-arch
  273. .PHONY: build clean binary-indep binary-arch binary