Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. export GNUPGHOME = $(CURDIR)/gpg
  2. SHELL = /bin/bash
  3. include /usr/share/dpkg/architecture.mk
  4. # List of packages to build
  5. # for each of these, the source must be available in a directory
  6. # $PACKAGE_$VERSION
  7. #
  8. # if the directory doesn't exist, but there is a directory
  9. # overlays/$PACKAGE and a directory overlays/$PACKAGE_$VERSION,
  10. # the contents of both directories will be copied sequentially to
  11. # $PACKAGE_$VERSION, allowing identical data for similar packages (eg.
  12. # multiple versions of the same packages) to be stored only once
  13. #
  14. # the suffix (_F, _A, _B or _S) specifies the type of build
  15. PACKAGES = \
  16. linux_42.0_F \
  17. nonfree-package_0.1_F \
  18. package_0.1_F \
  19. package_0.1_A \
  20. package_0.2_F \
  21. package-built-using_0.1_F \
  22. main-contrib-with-debug_0.1_F \
  23. main-contrib-with-debug_0.2_F \
  24. binnmu_0.1_F \
  25. binnmu_0.1+b1_B \
  26. binnmu_0.2_S \
  27. binnmu_0.2_B \
  28. pkgnew_0.1_AB \
  29. pkgnew_0.1_BB \
  30. pkgnew_0.1_F \
  31. pkgnew_0.2~exp_F \
  32. pkgnew_0.2_S \
  33. pkgnew_0.2_A \
  34. pkgnew_0.2_B \
  35. pkgnew_0.3_F \
  36. snowman_0.1_F \
  37. grave_0.1_F \
  38. OTHER = \
  39. linux_42.0-1_source.changes \
  40. ALL = $(PACKAGES)
  41. stamp-all: $(ALL) $(OTHER)
  42. touch $@
  43. %.orig.tar.gz:
  44. t=$*; \
  45. dir=$${t/_/-}; \
  46. base=$${t%_*}; \
  47. if [ ! -d $$dir ] ; then\
  48. cp -rv overlays/$$base/ ./$$dir/; \
  49. cp -Trv overlays/$$dir/ ./$$dir; \
  50. fi; \
  51. if [ ! -f $$t.orig.tar.gz ]; then \
  52. tar -czf $$t.orig.tar.gz --exclude=debian $${t/_/-}; \
  53. fi
  54. %_F: %.orig.tar.gz
  55. p=$*; (cd $${p/_/-}; dpkg-buildpackage -F)
  56. %_A: %.orig.tar.gz
  57. p=$*; (cd $${p/_/-}; dpkg-buildpackage -A)
  58. # build packages as if they were built with
  59. # sbuild --dpkg-file-suffix="-buildd"
  60. %_AB: %.orig.tar.gz
  61. ARCH=all; \
  62. BUILD_OPT=A; \
  63. t=$*; \
  64. dir=$${t/_/-}; \
  65. p=$*; p=$${p%%_*}; \
  66. ( \
  67. cd $${dir}; \
  68. V=`dpkg-parsechangelog -S Version`; \
  69. f=$${p}_$${V}_$${ARCH}; \
  70. dpkg-buildpackage -$${BUILD_OPT} \
  71. --no-sign \
  72. --buildinfo-option=-O../$${f}-buildd.buildinfo \
  73. --changes-option=-O../$${f}-buildd.changes; \
  74. debsign ../$${f}-buildd.changes; \
  75. )
  76. %_B: %.orig.tar.gz
  77. p=$*; (cd $${p/_/-}; dpkg-buildpackage -B)
  78. # build packages as if they were built with
  79. # sbuild --dpkg-file-suffix="-buildd"
  80. %_BB: %.orig.tar.gz
  81. ARCH=$(DEB_HOST_ARCH); \
  82. BUILD_OPT=B; \
  83. t=$*; \
  84. dir=$${t/_/-}; \
  85. p=$*; p=$${p%%_*}; \
  86. ( \
  87. cd $${dir}; \
  88. V=`dpkg-parsechangelog -S Version`; \
  89. f=$${p}_$${V}_$${ARCH}; \
  90. dpkg-buildpackage -$${BUILD_OPT} \
  91. --no-sign \
  92. --buildinfo-option=-O../$${f}-buildd.buildinfo \
  93. --changes-option=-O../$${f}-buildd.changes; \
  94. debsign ../$${f}-buildd.changes; \
  95. )
  96. %_S: %.orig.tar.gz
  97. p=$*; (cd $${p/_/-}; dpkg-buildpackage -S)
  98. %_source.changes: %_amd64.changes
  99. mergechanges -S $< /dev/null > $@
  100. debsign --no-re-sign $@
  101. # dummy rule, needed for the _source.changes rule
  102. %_amd64.changes:
  103. true
  104. clean:
  105. set -e; for j in $(ALL); do \
  106. p=$${j%_*}; \
  107. dir=$${p/_/-}; \
  108. if [ -d overlays/$$dir ]; then rm -rf ./$$dir; \
  109. else make -C $$dir -f debian/rules clean; fi; \
  110. done
  111. rm -f *.tar.gz *.tar.xz *.buildinfo *.dsc *.changes *.diff.gz *.deb
  112. rm -f gpg/*~
  113. rm -f stamp-*
  114. .PRECIOUS: %.orig.tar.gz %_amd64.changes