rules 6.1 KB

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