rules 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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. # $Id: rules,v 1.17 1999/05/14 02:51:37 jgg Exp $
  6. # For the deb builder, you can run 'debian/rules cvs-build', which does all
  7. # steps nescessary to produce a proper source tarball with the CVS/ removed.
  8. # It builds in debian/cvs-build/apt-<VER>/, and places files in
  9. # debian/cvs-build/. Optionally, you can run 'debian/rules cvs-mkul' to
  10. # create ../upload-<VER>, with all the files needed to be uploaded placed
  11. # in it.
  12. DEB_BUILD_PROG:=debuild -us -uc
  13. APT_DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p')
  14. APT_CONFVER=$(shell sed -n -e 's/^AC_DEFINE_UNQUOTED(VERSION,"\(.*\)")/\1/p' configure.in)
  15. # Determine the build directory to use
  16. BASE=.
  17. ifdef BUILD
  18. BUILD_POSSIBLE := $(BUILD) $(BASE)/$(BUILD)
  19. else
  20. BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname -m) $(BASE)/build
  21. endif
  22. BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
  23. BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
  24. override BLD := $(BUILDX)
  25. ifneq ($(APT_DEBVER),$(APT_CONFVER))
  26. .PHONY: configure.in
  27. configure.in:
  28. sed -e 's/$(APT_CONFVER)/$(APT_DEBVER)/' $@ > $@.$$$$;mv $@.$$$$ $@
  29. else
  30. configure.in:
  31. endif
  32. # Uncomment this to turn on verbose mode.
  33. #export DH_VERBOSE=1
  34. # Find the libapt-pkg major version for use in other control files
  35. export LIBAPT_MAJOR:=$(shell egrep '^MAJOR=' apt-pkg/makefile |cut -d '=' -f 2)
  36. #debian/shlibs.local:
  37. # rm -f $@
  38. # echo "libapt-pkg $(LIBAPT_MAJOR) libapt-pkg$(LIBAPT_MAJOR)" >> $@
  39. # echo "libapt-pkg $(LIBAPT_MAJOR) apt $(APT_DEBVER)" >> $@
  40. build: build-stamp
  41. build-stamp: configure
  42. dh_testdir
  43. -mkdir build
  44. (cd build; ../configure)
  45. # cd build && CXXFLAGS="-g -Wall -D_POSIX_C_SOURCE=199309" ../configure --disable-nls --disable-static --prefix=/usr
  46. # cd build && make all-hdr
  47. # cd build && make -s
  48. # Add here commands to compile the package.
  49. make
  50. touch build-stamp
  51. clean:
  52. dh_testdir
  53. # dh_testroot
  54. rm -f build-stamp
  55. rm -rf build
  56. # Add here commands to clean up after the build process.
  57. -$(MAKE) clean
  58. -$(MAKE) distclean
  59. dh_clean
  60. binary-indep: libapt-pkg-doc
  61. # Build architecture-independent files here.
  62. libapt-pkg-doc: build debian/shlibs.local
  63. dh_testdir -p$@
  64. dh_testroot -p$@
  65. dh_clean -p$@ -k
  66. dh_installdirs -p$@
  67. #
  68. # libapt-pkg-doc install
  69. #
  70. -cp -a $(BLD)/docs/cache* $(BLD)/docs/design* $(BLD)/docs/dpkg-tech* \
  71. $(BLD)/docs/files* $(BLD)/docs/method* debian/libapt-pkg-doc/usr/doc/apt/
  72. cp -a debian/libapt-pkg-doc.dhelp debian/libapt-pkg-doc/usr/doc/libapt-pkg-doc/.dhelp
  73. dh_installdocs -p$@
  74. dh_installexamples -p$@
  75. # dh_installmenu -p$@
  76. # dh_installinit -p$@
  77. # dh_installcron -p$@
  78. # dh_installmanpages -p$@
  79. # dh_undocumented -p$@
  80. dh_installchangelogs -p$@
  81. dh_strip -p$@
  82. dh_compress -p$@
  83. dh_fixperms -p$@
  84. # dh_suidregister -p$@
  85. dh_installdeb -p$@
  86. dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR}
  87. dh_md5sums -p$@
  88. dh_builddeb -p$@
  89. # Build architecture-dependent files here.
  90. binary-arch: apt libapt-pkg-dev
  91. apt: build debian/shlibs.local
  92. dh_testdir -p$@
  93. dh_testroot -p$@
  94. dh_clean -p$@ -k
  95. dh_installdirs -p$@
  96. #
  97. # apt install
  98. #
  99. cp $(BLD)/bin/apt-* debian/tmp/usr/bin/
  100. # install the shared libs
  101. find $(BLD)/bin/ -type f -name "libapt-pkg.so.*" -exec cp -a "{}" debian/tmp/usr/lib/ \;
  102. find $(BLD)/bin/ -type l -name "libapt-pkg.so.*" -exec cp -a "{}" debian/tmp/usr/lib/ \;
  103. cp $(BLD)/bin/methods/* debian/tmp/usr/lib/apt/methods/
  104. cp $(BLD)/scripts/dselect/* debian/tmp/usr/lib/dpkg/methods/apt/
  105. # cp debian/sources.list debian/tmp/etc/apt/
  106. # Copy the users guide
  107. -cp $(BLD)/docs/guide.text debian/tmp/usr/doc/apt/users-guide.txt
  108. -cp -a $(BLD)/docs/guide.html/* debian/tmp/usr/doc/apt/users-guide.html/
  109. # Copy the offline guide
  110. -cp $(BLD)/docs/offline.text debian/tmp/usr/doc/apt/offline.txt
  111. -cp -a $(BLD)/docs/offline.html/* debian/tmp/usr/doc/apt/offline.html/
  112. cp -a debian/dhelp debian/tmp/usr/doc/apt/.dhelp
  113. # head -n 500 ChangeLog > debian/ChangeLog
  114. dh_installdocs -p$@
  115. dh_installexamples -papt $(BLD)/docs/examples/*
  116. # dh_installmenu -papt
  117. # dh_installinit -papt
  118. # dh_installcron -papt
  119. dh_installmanpages -p$@
  120. # dh_undocumented -papt
  121. dh_installchangelogs -p$@
  122. dh_strip -p$@
  123. dh_compress -p$@
  124. dh_fixperms -p$@
  125. # dh_suidregister -p$@
  126. dh_installdeb -p$@
  127. LD_LIBRARY_PATH=`pwd`/debian/tmp/usr/lib dh_shlibdeps -papt
  128. dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR}
  129. dh_makeshlibs -m${LIBAPT_MAJOR} -Vlibapt-pkg${LIBAPT_MAJOR} -papt
  130. dh_md5sums -p$@
  131. dh_builddeb -p$@
  132. libapt-pkg-dev: build debian/shlibs.local
  133. dh_testdir -p$@
  134. dh_testroot -p$@
  135. dh_clean -p$@ -k
  136. dh_installdirs -p$@
  137. #
  138. # libapt-pkg-dev install
  139. #
  140. ln -s libapt-pkg.so.${LIBAPT_MAJOR} debian/libapt-pkg-dev/usr/lib/libapt-pkg.so
  141. cp $(BLD)/include/apt-pkg/*.h debian/libapt-pkg-dev/usr/include/apt-pkg/
  142. dh_installdocs -p$@
  143. # dh_installmenu -papt
  144. # dh_installinit -papt
  145. # dh_installcron -papt
  146. # dh_installmanpages -p$@
  147. dh_installchangelogs -p$@
  148. dh_strip -p$@
  149. dh_compress -p$@
  150. dh_fixperms -p$@
  151. # dh_suidregister -p$@
  152. dh_installdeb -p$@
  153. dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR}
  154. dh_md5sums -p$@
  155. dh_builddeb -p$@
  156. source diff:
  157. @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
  158. # Update from CVS
  159. l33ch: really-clean
  160. cvs update
  161. buildlib/mkChangeLog
  162. # Update from CVS and then configure for build
  163. super-l33ch: l33ch Makefile.in
  164. configure:
  165. make configure
  166. l33ch-stamp: super-l33ch
  167. touch l33ch-stamp
  168. really-clean: clean
  169. -find -name Makefile.in -print0 | xargs -0r rm -f
  170. find -name ChangeLog | xargs rm -f
  171. rm -f l33ch-stamp
  172. binary: binary-indep binary-arch
  173. .PHONY: build clean binary-indep binary-arch binary debian/shlibs.local
  174. # Done by the uploader.
  175. #cvs update..
  176. #edit debian/changelog
  177. # configure.in has the version automatically updated now.
  178. # edit configure.in
  179. # debian/rules cvs-build
  180. cvs-build:
  181. rm -rf debian/cvs-build
  182. cvs update
  183. buildlib/mkChangeLog
  184. make startup
  185. make doc
  186. tar c --exclude CVS --exclude debian/cvs-build . |\
  187. (mkdir -p debian/cvs-build/apt-$(APT_DEBVER);cd debian/cvs-build/apt-$(APT_DEBVER);tar x)
  188. # The next line isn't needed, as debuild will make the .tar.gz for us.
  189. # (cd debian/cvs-build;tar zcf apt_$(APT_DEBVER).tar.gz apt-$(APT_DEBVER))
  190. (cd debian/cvs-build/apt-$(APT_DEBVER);$(DEB_BUILD_PROG))
  191. rm ChangeLog
  192. cvs-mkul:
  193. -mkdir -p ../upload-$(APT_DEBVER)
  194. cp `find debian/cvs-build -maxdepth 1 -type f` ../upload-$(APT_DEBVER)