rules 5.5 KB

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