Makefile.am 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. # Disarchive
  2. # Copyright 2020 Timothy Sample <samplet@ngyro.com>
  3. # Copyright 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  4. #
  5. # This file is part of Disarchive.
  6. #
  7. # Disarchive is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # Disarchive is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with Disarchive. If not, see <https://www.gnu.org/licenses/>.
  19. include $(top_srcdir)/build-aux/guile.am
  20. SOURCES = \
  21. disarchive/config.scm \
  22. disarchive.scm \
  23. disarchive/assemblers.scm \
  24. disarchive/assemblers/bzip2-stream.scm \
  25. disarchive/assemblers/directory-ref.scm \
  26. disarchive/assemblers/gzip-member.scm \
  27. disarchive/assemblers/tarball.scm \
  28. disarchive/assemblers/xz-file.scm \
  29. disarchive/binary-filenames.scm \
  30. disarchive/digests.scm \
  31. disarchive/disassemblers.scm \
  32. disarchive/formats/gzip.scm \
  33. disarchive/git-hash.scm \
  34. disarchive/kinds/binary-string.scm \
  35. disarchive/kinds/bzip2.scm \
  36. disarchive/kinds/octal.scm \
  37. disarchive/kinds/tar-extension.scm \
  38. disarchive/kinds/tar-header.scm \
  39. disarchive/kinds/zero-string.scm \
  40. disarchive/kinds/xz.scm \
  41. disarchive/logging.scm \
  42. disarchive/resolvers.scm \
  43. disarchive/resolvers/swhid.scm \
  44. disarchive/scripts/assemble.scm \
  45. disarchive/scripts/disassemble.scm \
  46. disarchive/serialization.scm \
  47. disarchive/utils.scm
  48. disarchive/config.scm: disarchive/config.scm.in Makefile
  49. $(AM_V_GEN)mkdir -p disarchive
  50. $(AM_V_GEN)sed \
  51. -e 's,[@]PACKAGE_NAME[@],$(PACKAGE_NAME),g' \
  52. -e 's,[@]VERSION[@],$(VERSION),g' \
  53. -e 's,[@]GZIP[@],$(GZIP),g' \
  54. -e 's,[@]libexecdir[@],$(libexecdir),g' \
  55. -e 's,[@]O_NOFOLLOW[@],$(O_NOFOLLOW),g' \
  56. -e 's,[@]TAR[@],$(TAR),g' \
  57. -e 's,[@]XZ[@],$(XZ),g' \
  58. -e 's,[@]BZIP2[@],$(BZIP2),g' \
  59. < "$<" > "$@"
  60. bin_SCRIPTS = \
  61. scripts/disarchive
  62. scripts/disarchive: scripts/disarchive.in Makefile
  63. $(AM_V_GEN)mkdir -p scripts
  64. $(AM_V_GEN)sed \
  65. -e 's,[@]ccachedir[@],$(ccachedir),g' \
  66. -e 's,[@]GUILE[@],$(GUILE),g' \
  67. -e 's,[@]moddir[@],$(moddir),g' \
  68. < "$<" > "$@" && \
  69. chmod a+x "$@"
  70. libexec_PROGRAMS = \
  71. libexec/disarchive-zgz
  72. libexec_disarchive_zgz_SOURCES = \
  73. libexec/zgz/bits.c \
  74. libexec/zgz/deflate.c \
  75. libexec/zgz/gzip.c \
  76. libexec/zgz/gzip.h \
  77. libexec/zgz/trees.c \
  78. libexec/zgz/util.c \
  79. libexec/zgz/zgz.c
  80. libexec_disarchive_zgz_LDADD = $(ZLIB_LIBS)
  81. AM_TESTS_ENVIRONMENT = . $(top_builddir)/build-aux/tests-env;
  82. TEST_EXTENSIONS = .scm
  83. SCM_LOG_DRIVER = $(GUILE) --no-auto-compile \
  84. $(top_srcdir)/build-aux/test-driver.scm
  85. TESTS = \
  86. tests/cli.scm \
  87. tests/kinds/binary-string.scm \
  88. tests/kinds/bzip2.scm \
  89. tests/kinds/octal.scm \
  90. tests/kinds/tar-extension.scm \
  91. tests/kinds/tar-header.scm \
  92. tests/kinds/xz.scm \
  93. tests/kinds/zero-string.scm
  94. EXTRA_DIST += \
  95. .dir-locals.el \
  96. manifest.scm \
  97. disarchive/config.scm.in \
  98. scripts/disarchive.in \
  99. build-aux/git-version-gen \
  100. build-aux/gitlog-to-changelog \
  101. build-aux/test-driver.scm \
  102. tests/kinds.scm \
  103. tests/data/README \
  104. tests/data/test-archive.tar \
  105. tests/data/test-archive.da \
  106. tests/data/test-archive/test-archive/file-a \
  107. tests/data/test-archive/test-archive/file-b \
  108. $(TESTS)
  109. CLEANFILES += \
  110. disarchive/config.scm \
  111. scripts/disarchive
  112. dist-hook: gen-ChangeLog
  113. echo $(VERSION) > $(distdir)/.tarball-version
  114. if test -e .git; then \
  115. git show HEAD --format=%ct --no-patch 2>/dev/null \
  116. > $(distdir)/.tarball-timestamp; \
  117. else \
  118. cp $(srcdir)/.tarball-timestamp $(distdir)/.tarball-timestamp; \
  119. fi
  120. .PHONY: gen-ChangeLog
  121. gen-ChangeLog:
  122. $(AM_V_GEN)if test -e .git; then \
  123. { $(top_srcdir)/build-aux/gitlog-to-changelog \
  124. --format='%s%n%n%b%n' -- v0.1.0.. && \
  125. echo && \
  126. tail +8 $(top_srcdir)/ChangeLog; \
  127. } > $(distdir)/ChangeLog-t && \
  128. { rm -f $(distdir)/ChangeLog && \
  129. mv $(distdir)/ChangeLog-t $(distdir)/ChangeLog; } \
  130. fi
  131. # Reproducible tarball
  132. # Be friendly to Debian; avoid using EPOCH
  133. override GZIP_ENV = "--best --no-name"
  134. am__tar = $${TAR-tar} -chof - --sort=name \
  135. --mtime=@$$(cat "$$tardir"/.tarball-timestamp) \
  136. --owner=0 --group=0 --numeric-owner \
  137. --mode=go=rX,u+rw,a-s "$$tardir"