rules 4.8 KB

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