Makefile.am 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 | \
  53. perl -e '$(LOG_PL)' > ChangeLog )
  54. if in_source_build
  55. deb:
  56. CFLAGS="-O2 -mcpu=i686" fakeroot debian/rules binary
  57. deb-clean:
  58. dh_clean -Xsrc/
  59. fakeroot debian/rules unpatch
  60. distdir distclean: deb-clean
  61. dist-hook:
  62. find $(distdir)/debian \( -name .git -o -name .gitignore -o -name .#\*# -o -type l \) -print0 | xargs -0r rm -rf
  63. endif
  64. dist-sign: dist
  65. gpg -b -a $(PACKAGE)-$(VERSION).tar.gz
  66. rpm:
  67. make dist
  68. cp $(PACKAGE)-$(VERSION).tar.gz /usr/src/rpm/SOURCES
  69. CFLAGS="-O2 -mcpu=i686" rpm -ba --clean isync.spec
  70. docdir = $(datadir)/doc/isync
  71. doc_DATA = README TODO NEWS ChangeLog AUTHORS