900-file-mgc.patch 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. Author: Daniel Baumann <daniel@debian.org>
  2. Description: Reverting upstream change of stopping to build plain magic file (Closes: #481247).
  3. diff -Naurp file.orig/magic/Makefile.am file/magic/Makefile.am
  4. --- file.orig/magic/Makefile.am 2009-05-03 00:07:11.000000000 +0000
  5. +++ file/magic/Makefile.am 2009-05-03 08:51:56.000000000 +0000
  6. @@ -4,7 +4,7 @@
  7. MAGIC_FRAGMENT_BASE = Magdir
  8. MAGIC_FRAGMENT_DIR = $(top_srcdir)/magic/$(MAGIC_FRAGMENT_BASE)
  9. -pkgdata_DATA = magic.mgc
  10. +pkgdata_DATA = magic.mgc magic
  11. EXTRA_DIST = Header Localstuff \
  12. $(MAGIC_FRAGMENT_DIR)/acorn \
  13. @@ -220,8 +220,20 @@ $(MAGIC_FRAGMENT_DIR)/xwindows \
  14. $(MAGIC_FRAGMENT_DIR)/zilog \
  15. $(MAGIC_FRAGMENT_DIR)/zyxel
  16. +RAW = magic
  17. MAGIC = magic.mgc
  18. -CLEANFILES = ${MAGIC}
  19. +CLEANFILES = ${MAGIC} ${RAW}
  20. +
  21. +${RAW}: Header Localstuff $(EXTRA_DIST)
  22. + cat /dev/null > $@
  23. + for frag in $(EXTRA_DIST); do \
  24. + if test -f $(srcdir)/$$frag; then \
  25. + f=$(srcdir)/$$frag; \
  26. + else \
  27. + f=$$frag; \
  28. + fi; \
  29. + cat $$f; \
  30. + done >> $@
  31. # FIXME: Build file natively as well so that it can be used to compile
  32. # the target's magic file
  33. @@ -233,6 +245,5 @@ FILE_COMPILE = $(top_builddir)/src/file
  34. FILE_COMPILE_DEP = $(FILE_COMPILE)
  35. endif
  36. -${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
  37. - $(FILE_COMPILE) -C -m $(MAGIC_FRAGMENT_DIR)
  38. - @mv $(MAGIC_FRAGMENT_BASE).mgc $@
  39. +${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) $(RAW)
  40. + $(FILE_COMPILE) -C -m $(RAW)
  41. diff -Naurp file.orig/magic/Makefile.in file/magic/Makefile.in
  42. --- file.orig/magic/Makefile.in 2009-05-03 00:07:11.000000000 +0000
  43. +++ file/magic/Makefile.in 2009-05-03 08:55:09.000000000 +0000
  44. @@ -170,7 +170,7 @@ top_srcdir = @top_srcdir@
  45. #
  46. MAGIC_FRAGMENT_BASE = Magdir
  47. MAGIC_FRAGMENT_DIR = $(top_srcdir)/magic/$(MAGIC_FRAGMENT_BASE)
  48. -pkgdata_DATA = magic.mgc
  49. +pkgdata_DATA = magic.mgc magic
  50. EXTRA_DIST = Header Localstuff \
  51. $(MAGIC_FRAGMENT_DIR)/acorn \
  52. $(MAGIC_FRAGMENT_DIR)/adi \
  53. @@ -385,8 +385,21 @@ $(MAGIC_FRAGMENT_DIR)/xwindows \
  54. $(MAGIC_FRAGMENT_DIR)/zilog \
  55. $(MAGIC_FRAGMENT_DIR)/zyxel
  56. +RAW = magic
  57. MAGIC = magic.mgc
  58. -CLEANFILES = ${MAGIC}
  59. +CLEANFILES = ${MAGIC} ${RAW}
  60. +
  61. +${RAW}: Header Localstuff $(EXTRA_DIST)
  62. + cat /dev/null > $@
  63. + for frag in $(EXTRA_DIST); do \
  64. + if test -f $(srcdir)/$$frag; then \
  65. + f=$(srcdir)/$$frag; \
  66. + else \
  67. + f=$$frag; \
  68. + fi; \
  69. + cat $$f; \
  70. + done >> $@
  71. +
  72. @IS_CROSS_COMPILE_FALSE@FILE_COMPILE = $(top_builddir)/src/file
  73. # FIXME: Build file natively as well so that it can be used to compile
  74. @@ -582,10 +595,8 @@ uninstall-am: uninstall-pkgdataDATA
  75. mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  76. uninstall uninstall-am uninstall-pkgdataDATA
  77. -
  78. -${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
  79. - $(FILE_COMPILE) -C -m $(MAGIC_FRAGMENT_DIR)
  80. - @mv $(MAGIC_FRAGMENT_BASE).mgc $@
  81. +${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) $(RAW)
  82. + $(FILE_COMPILE) -C -m $(RAW)
  83. # Tell versions [3.59,3.63) of GNU make to not export all variables.
  84. # Otherwise a system limit (for SysV at least) may be exceeded.
  85. .NOEXPORT: