Browse Source

Ship the compiled magic file in a separate package so libmagic1 is finally multi-arch compliant. Closes: #670006

Christoph Biedl 7 years ago
parent
commit
502e3ab49c

+ 17 - 1
debian/control

@@ -1,7 +1,7 @@
 Source: file
 Source: file
 Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
 Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
 Homepage: http://www.darwinsys.com/file/
 Homepage: http://www.darwinsys.com/file/
-Standards-Version: 3.9.5
+Standards-Version: 3.9.8
 Build-Depends: debhelper (>= 9.20141010~),
 Build-Depends: debhelper (>= 9.20141010~),
     dh-autoreconf,
     dh-autoreconf,
     dh-python,
     dh-python,
@@ -30,6 +30,7 @@ Architecture: any
 Pre-Depends:
 Pre-Depends:
     ${misc:Pre-Depends},
     ${misc:Pre-Depends},
 Depends: ${misc:Depends}, ${shlibs:Depends},
 Depends: ${misc:Depends}, ${shlibs:Depends},
+    libmagic-mgc (= ${binary:Version}),
 Suggests:
 Suggests:
     file,
     file,
 Section: libs
 Section: libs
@@ -38,6 +39,21 @@ Description: Recognize the type of data in a file using "magic" numbers - librar
  This library can be used to classify files according to magic number
  This library can be used to classify files according to magic number
  tests. It implements the core functionality of the file command.
  tests. It implements the core functionality of the file command.
 
 
+Package: libmagic-mgc
+Architecture: any
+Depends: ${misc:Depends},
+Breaks:
+    libmagic1 (<< 1:5.28-4~),
+Replaces:
+    libmagic1 (<< 1:5.28-4~),
+Section: libs
+Multi-Arch: foreign
+Description: File type determination library using "magic" numbers (compiled magic file)
+ This package provides the compiled magic file "magic.mgc". It has
+ been separated from libmagic1 in order to meet the multiarch
+ requirements without breaking applications that expect this file
+ at its absolute path.
+
 Package: libmagic-dev
 Package: libmagic-dev
 Architecture: any
 Architecture: any
 Depends: ${misc:Depends},
 Depends: ${misc:Depends},

+ 8 - 0
debian/libmagic-mgc.README.Debian

@@ -0,0 +1,8 @@
+
+Between architectures, the compiled magic at /usr/lib/file/magic.mgc
+differs only in the endianness. The libmagic library can auto-detect
+wrong endianness and handle that situation gracefully, at a significant
+performance cost though.
+
+Therefore: If you run file/libmagic in a mixed-endianness multi-arch
+setup, choose the architecture for libmagic-mgc wisely.

debian/libmagic1.dirs → debian/libmagic-mgc.dirs


+ 1 - 0
debian/libmagic-mgc.install

@@ -0,0 +1 @@
+usr/share/file/magic.mgc    usr/lib/file/

+ 7 - 0
debian/libmagic-mgc.links

@@ -0,0 +1,7 @@
+
+# upstream and many applications expect the magic in /usr/share/misc/,
+# other in /usr/share/file/. The compiled magic however is
+# arch-dependent and must therefore be in /usr/lib/
+# Provide symlinks in the hope everybody gets satisfied.
+/usr/lib/file/magic.mgc     /usr/share/file/magic.mgc
+/usr/lib/file/magic.mgc     /usr/share/misc/magic.mgc

+ 0 - 1
debian/libmagic1.install

@@ -1,4 +1,3 @@
 etc
 etc
 usr/lib/*/*.so.*
 usr/lib/*/*.so.*
-usr/share/file/magic.mgc    usr/lib/file/
 usr/share/man/man5
 usr/share/man/man5

+ 1 - 4
debian/libmagic1.links

@@ -1,8 +1,5 @@
 
 
 # upstream and many applications expect the magic in /usr/share/misc/,
 # upstream and many applications expect the magic in /usr/share/misc/,
-# other in /usr/share/file/. The compiled magic however is
-# arch-dependent and must therefore be in /usr/lib/
+# other in /usr/share/file/.
 # Provide symlinks in the hope everybody gets satisfied.
 # Provide symlinks in the hope everybody gets satisfied.
-/usr/lib/file/magic.mgc     /usr/share/file/magic.mgc
-/usr/lib/file/magic.mgc     /usr/share/misc/magic.mgc
 /usr/share/file/magic       /usr/share/misc/magic
 /usr/share/file/magic       /usr/share/misc/magic

+ 1 - 1
debian/rules

@@ -97,7 +97,7 @@ ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
 	# use the just built file in dh_shlibdeps
 	# use the just built file in dh_shlibdeps
 	PATH=$(CURDIR)/debian/file/usr/bin:$$PATH \
 	PATH=$(CURDIR)/debian/file/usr/bin:$$PATH \
 		LD_LIBRARY_PATH=$(CURDIR)/debian/libmagic1/usr/lib/$(DEB_HOST_MULTIARCH)$${LD_LIBRARY_PATH+:$${LD_LIBRARY_PATH}} \
 		LD_LIBRARY_PATH=$(CURDIR)/debian/libmagic1/usr/lib/$(DEB_HOST_MULTIARCH)$${LD_LIBRARY_PATH+:$${LD_LIBRARY_PATH}} \
-		MAGIC=$(CURDIR)/debian/libmagic1/usr/share/file/magic.mgc \
+		MAGIC=$(CURDIR)/debian/libmagic-mgc/usr/share/file/magic.mgc \
 		dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/lib
 		dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/lib
 else
 else
 	dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/lib
 	dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/lib