rules 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/usr/bin/make -f
  2. # debian/rules for the dpkg suite.
  3. # Copyright © 2004 Scott James Remnant <scott@netsplit.com>
  4. CFLAGS = -Wall -g
  5. CXXFLAGS = -Wall -g
  6. # Disable optimisations if ‘noopt’ found in $DEB_BUILD_OPTIONS
  7. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  8. CFLAGS += -O0
  9. CXXFLAGS += -O0
  10. else
  11. CFLAGS += -O2
  12. CXXFLAGS += -O2
  13. endif
  14. # These are used for cross-compiling and for saving the configure script
  15. # from having to guess our platform (since we know it already)
  16. DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  17. DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  18. ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  19. confflags += --build=$(DEB_HOST_GNU_TYPE)
  20. else
  21. confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
  22. endif
  23. # Create configure script if necessary, automake handles rebuilding it.
  24. configure:
  25. dh_testdir
  26. autoreconf -v -i
  27. # Configure the build tree
  28. build-tree/config.status: configure
  29. dh_testdir
  30. install -d build-tree
  31. cd build-tree && ../configure $(confflags) \
  32. CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
  33. --prefix=/usr \
  34. --mandir=\$${datadir}/man \
  35. --infodir=\$${datadir}/info \
  36. --sysconfdir=/etc \
  37. --localstatedir=/var/lib \
  38. --with-zlib=static \
  39. --with-bz2=static
  40. # Build the package in build-tree
  41. build: build-tree/build-stamp
  42. build-tree/build-stamp: build-tree/config.status
  43. dh_testdir
  44. cd build-tree && $(MAKE)
  45. touch $@
  46. # Install the package underneath debian/tmp
  47. install: build
  48. dh_testdir
  49. dh_testroot
  50. dh_clean -k
  51. dh_installdirs
  52. cd build-tree && $(MAKE) DESTDIR="$(CURDIR)/debian/tmp" install
  53. # Put together the dpkg and dselect packages
  54. binary-arch: install
  55. dh_testdir -a
  56. dh_testroot -a
  57. dh_install --sourcedir=debian/tmp -a
  58. dh_installchangelogs -pdpkg ChangeLog
  59. dh_installdocs -pdpkg
  60. install -d debian/dselect/usr/share/doc
  61. ln -s dpkg debian/dselect/usr/share/doc/dselect
  62. dh_strip -a
  63. dh_compress -a
  64. dh_fixperms -a
  65. dh_installdeb -a
  66. dh_shlibdeps -a
  67. dh_gencontrol -a
  68. dh_md5sums -a
  69. dh_builddeb -a
  70. # Put together the dpkg-dev package
  71. binary-indep: install
  72. dh_testdir -i
  73. dh_testroot -i
  74. dh_install --sourcedir=debian/tmp -i
  75. install -d debian/dpkg-dev/usr/share/doc
  76. ln -s dpkg debian/dpkg-dev/usr/share/doc/dpkg-dev
  77. dh_strip -i
  78. dh_compress -i
  79. dh_fixperms -i
  80. dh_installdeb -i
  81. dh_gencontrol -i
  82. dh_md5sums -i
  83. dh_builddeb -i
  84. binary: binary-arch binary-indep
  85. # Clean up the mess we made
  86. clean:
  87. dh_testdir
  88. rm -rf build-tree
  89. dh_clean
  90. .PHONY: build install binary-arch binary-indep binary clean