900-file-mgc.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 2010-02-01 12:16:29.000000000 +0000
  5. +++ file/magic/Makefile.am 2010-02-01 12:21:54.000000000 +0000
  6. @@ -5,7 +5,7 @@ MAGIC_FRAGMENT_BASE = Magdir
  7. MAGIC_DIR = $(top_srcdir)/magic
  8. MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
  9. -pkgdata_DATA = magic.mgc
  10. +pkgdata_DATA = magic.mgc magic
  11. EXTRA_DIST = \
  12. $(MAGIC_DIR)/Header \
  13. @@ -229,8 +229,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} $(MAGIC_FRAGMENT_DIR)/Localstuff
  19. +CLEANFILES = ${RAW} ${MAGIC} $(MAGIC_FRAGMENT_DIR)/Localstuff
  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. @@ -242,7 +254,5 @@ FILE_COMPILE = $(top_builddir)/src/file
  34. FILE_COMPILE_DEP = $(FILE_COMPILE)
  35. endif
  36. -${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
  37. - @mkdir magic && cp -p $(EXTRA_DIST) magic
  38. - $(FILE_COMPILE) -C -m magic
  39. - @rm -fr magic
  40. +${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) $(RAW)
  41. + $(FILE_COMPILE) -C -m $(RAW)
  42. diff -Naurp file.orig/magic/Makefile.in file/magic/Makefile.in
  43. --- file.orig/magic/Makefile.in 2010-02-01 12:16:29.000000000 +0000
  44. +++ file/magic/Makefile.in 2010-02-01 12:24:46.000000000 +0000
  45. @@ -171,7 +171,7 @@ top_srcdir = @top_srcdir@
  46. MAGIC_FRAGMENT_BASE = Magdir
  47. MAGIC_DIR = $(top_srcdir)/magic
  48. MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
  49. -pkgdata_DATA = magic.mgc
  50. +pkgdata_DATA = magic.mgc magic
  51. EXTRA_DIST = \
  52. $(MAGIC_DIR)/Header \
  53. $(MAGIC_DIR)/Localstuff \
  54. @@ -394,10 +394,22 @@ $(MAGIC_FRAGMENT_DIR)/xwindows \
  55. $(MAGIC_FRAGMENT_DIR)/zilog \
  56. $(MAGIC_FRAGMENT_DIR)/zyxel
  57. +RAW = magic
  58. MAGIC = magic.mgc
  59. CLEANFILES = ${MAGIC} $(MAGIC_FRAGMENT_DIR)/Localstuff
  60. @IS_CROSS_COMPILE_FALSE@FILE_COMPILE = $(top_builddir)/src/file
  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. # FIXME: Build file natively as well so that it can be used to compile
  73. # the target's magic file
  74. @IS_CROSS_COMPILE_TRUE@FILE_COMPILE = file
  75. @@ -591,11 +603,8 @@ uninstall-am: uninstall-pkgdataDATA
  76. mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  77. uninstall uninstall-am uninstall-pkgdataDATA
  78. -
  79. -${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
  80. - @mkdir magic && cp -p $(EXTRA_DIST) magic
  81. - $(FILE_COMPILE) -C -m magic
  82. - @rm -fr magic
  83. +${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) $(RAW)
  84. + $(FILE_COMPILE) -C -m $(RAW)
  85. # Tell versions [3.59,3.63) of GNU make to not export all variables.
  86. # Otherwise a system limit (for SysV at least) may be exceeded.
  87. .NOEXPORT: