maint.mk 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. ## Maintainer-only Makefile fragment
  2. # Copyright © 2018 Mathieu Lirzin <mthl@gnu.org>
  3. #
  4. # This file is part of GNU Mcron.
  5. #
  6. # GNU Mcron is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # GNU Mcron is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with GNU Mcron. If not, see <http://www.gnu.org/licenses/>.
  18. # Rebuild Makefile.in if this file is modifed.
  19. Makefile.in: maint.mk
  20. ## -------------------- ##
  21. ## Third-party files. ##
  22. ## ---------------------##
  23. WGET = wget
  24. # Git repositories on Savannah.
  25. git_sv_host = git.savannah.gnu.org
  26. # Some repositories we sync files from.
  27. sv_git_am = 'https://$(git_sv_host)/gitweb/?p=automake.git;a=blob_plain;hb=HEAD;f='
  28. sv_git_gl = 'https://$(git_sv_host)/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
  29. # Files that we fetch and which we compare against.
  30. # Note that the 'lib/COPYING' file must still be synced by hand.
  31. fetchfiles = \
  32. $(sv_git_am)contrib/test-driver.scm \
  33. $(sv_git_gl)build-aux/do-release-commit-and-tag \
  34. ${sv_git_gl}build-aux/gnu-web-doc-update \
  35. $(sv_git_gl)build-aux/gnupload
  36. # Fetch the latest versions of few scripts and files we care about.
  37. # A retrieval failure or a copying failure usually mean serious problems,
  38. # so we'll just bail out if 'wget' or 'cp' fail.
  39. fetch:
  40. $(AM_V_at)rm -rf Fetchdir
  41. $(AM_V_at)mkdir Fetchdir
  42. $(AM_V_GEN)set -e; \
  43. if $(AM_V_P); then wget_opts=; else wget_opts=-nv; fi; \
  44. for url in $(fetchfiles); do \
  45. file=`printf '%s\n' "$$url" | sed 's|^.*/||; s|^.*=||'`; \
  46. $(WGET) $$wget_opts "$$url" -O Fetchdir/$$file || exit 1; \
  47. if cmp Fetchdir/$$file $(srcdir)/build-aux/$$file >/dev/null; then \
  48. : Nothing to do; \
  49. else \
  50. echo "$@: updating file $$file"; \
  51. cp Fetchdir/$$file $(srcdir)/build-aux/$$file || exit 1; \
  52. fi; \
  53. done
  54. $(AM_V_at)rm -rf Fetchdir
  55. .PHONY: fetch
  56. # If it's not already specified, derive the GPG key ID from
  57. # the signed tag we've just applied to mark this release.
  58. gpg_key_ID = \
  59. $$(cd $(srcdir) \
  60. && git cat-file tag v$(VERSION) \
  61. | gpgv --status-fd 1 --keyring /dev/null - - 2>/dev/null \
  62. | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
  63. # Use alpha.gnu.org for alpha and beta releases.
  64. # Use ftp.gnu.org for stable releases.
  65. gnu_ftp_host-alpha = alpha.gnu.org
  66. gnu_ftp_host-beta = alpha.gnu.org
  67. gnu_ftp_host-stable = ftp.gnu.org
  68. gnu_rel_host = $(gnu_ftp_host-$(release-type))
  69. noteworthy_changes = * Noteworthy changes in release ?.? (????-??-??) [?]
  70. .PHONY: release
  71. release:
  72. cd $(srcdir) && rm -rf autom4te.cache && ./bootstrap && ./configure
  73. $(AM_V_at)$(MAKE) Makefile
  74. $(AM_V_at)$(srcdir)/build-aux/announce-gen \
  75. --mail-headers='To: ??? Mail-Followup-To: $(PACKAGE_BUGREPORT)' \
  76. --release-type=$(release-type) \
  77. --package=$(PACKAGE) \
  78. --prev=`cat .prev-version` \
  79. --curr=$(VERSION) \
  80. --gpg-key-id=$(gpg_key_ID) \
  81. --srcdir=$(srcdir) \
  82. --news=$(srcdir)/NEWS \
  83. --bootstrap-tools=autoconf,automake,help2man \
  84. --no-print-checksums \
  85. --url-dir=https://ftp.gnu.org/gnu/$(PACKAGE) \
  86. > ~/announce-$(PACKAGE)-$(VERSION)
  87. $(AM_V_at)echo $(VERSION) > .prev-version
  88. $(AM_V_at)perl -pi \
  89. -e '$$. == 3 and print "$(noteworthy_changes)\n\n\n"' \
  90. $(srcdir)/NEWS
  91. $(AM_V_at)msg=`printf '%s\n' 'maint: Post-release administrivia' '' \
  92. '* NEWS: Add header line for next release.' \
  93. '* .prev-version: Record previous version.'` || exit 1; \
  94. git commit -m "$$msg" -a
  95. .PHONY: upload
  96. upload:
  97. $(srcdir)/build-aux/gnupload $(GNUPLOADFLAGS) \
  98. --to $(gnu_rel_host):$(PACKAGE) \
  99. $(DIST_ARCHIVES)
  100. .PHONY: web-manual
  101. web-manual:
  102. $(AM_V_at)cd '$(srcdir)/doc'; \
  103. $(SHELL) ../build-aux/gendocs.sh \
  104. -o '$(abs_builddir)/doc/manual' \
  105. --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
  106. "$(PACKAGE_STRING) Reference Manual"
  107. $(AM_V_at)echo " *** Upload the doc/manual directory to web-cvs."
  108. .PHONY: web-manual-update
  109. web-manual-update:
  110. $(AM_V_GEN)cd $(srcdir) \
  111. && build-aux/gnu-web-doc-update -C $(abs_builddir)