Makefile.am 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. SUBDIRS = src
  2. bin_SCRIPTS = get-cert
  3. EXTRA_DIST = debian isync.spec $(bin_SCRIPTS)
  4. LOG_PL = \
  5. use POSIX qw(strftime); \
  6. use Date::Parse; \
  7. use Text::Wrap; \
  8. $$Text::Wrap::columns = 72; \
  9. while (defined($$_ = <>)) { \
  10. /^commit / or die "commit missing: $$_"; \
  11. <> =~ /^log size (\d+)$$/ or die "wrong size"; \
  12. $$len = $$1; \
  13. read(STDIN, $$log, $$len) == $$len or die "unexpected EOF"; \
  14. $$log =~ s/^Author: ([^>]+>)\nDate: (\d{4}-\d\d-\d\d \d\d:\d\d:\d\d [-+]\d{4})\n(.*)$$/$$3/s or die "unexpected log format"; \
  15. $$author = $$1; $$date = str2time($$2); \
  16. scalar(<>); \
  17. @files = (); \
  18. $$pfx = ""; \
  19. while (defined($$l = <>) and $$l ne "\n") { \
  20. chomp $$l; \
  21. next if ($$l =~ m,^(ChangeLog$$|NEWS$$|TODO$$|debian/),); \
  22. if (!@files) { \
  23. $$pfx = $$l; \
  24. $$pfx =~ s,/?[^/]+$$,,; \
  25. } else { \
  26. while (length($$pfx)) { \
  27. $$l =~ m,^\Q$$pfx/\E, and last; \
  28. $$pfx =~ s,/?[^/]+$$,,; \
  29. } \
  30. } \
  31. push @files, $$l; \
  32. } \
  33. next if (!@files); \
  34. print strftime("%F %H:%M", gmtime($$date))." ".$$author."\n\n"; \
  35. if (@files > 1 and ($$len = length($$pfx))) { \
  36. @efiles = (); \
  37. for $$f (@files) { push @efiles, substr($$f, $$len + 1); } \
  38. $$fstr = $$pfx."/: "; \
  39. } else { \
  40. @efiles = @files; \
  41. $$fstr = ""; \
  42. } \
  43. print wrap("\t* ", "\t ", $$fstr.join(", ", @efiles).":")."\n"; \
  44. $$log =~ s, +$$,,gm; \
  45. $$log =~ s,^ ,\t,gm; \
  46. print $$log."\n"; \
  47. }
  48. $(srcdir)/ChangeLog: log
  49. log:
  50. @test -z "$(srcdir)" || cd $(srcdir) && \
  51. ( ! test -d .git || \
  52. git log --date=iso --log-size --name-only --no-merges | \
  53. perl -e '$(LOG_PL)' > ChangeLog )
  54. deb:
  55. CFLAGS= INSTALL= dpkg-buildpackage -b --no-sign
  56. dist-hook:
  57. find $(distdir)/debian \( -name .#\*# -o -type l \) -print0 | xargs -0r rm -rf
  58. -cd $(distdir)/debian && test -f .gitignore && rm -rf `cat .gitignore` .gitignore
  59. dist-sign: dist
  60. gpg -b -a $(PACKAGE)-$(VERSION).tar.gz
  61. rpm: dist
  62. CFLAGS="-O2 -mtune=core2" rpmbuild --clean -ta $(PACKAGE)-$(VERSION).tar.gz
  63. rpm-ia32: dist
  64. CFLAGS="-O2 -m32 -march=i686" rpmbuild --target i686-unknown-linux --clean -ta $(PACKAGE)-$(VERSION).tar.gz
  65. doc_DATA = README TODO NEWS ChangeLog AUTHORS