Browse Source

Don't hardcode dependency on libmagic1. Closes: #1066850

Christoph Biedl 2 years ago
parent
commit
a121aac390
2 changed files with 8 additions and 2 deletions
  1. 2 2
      debian/control
  2. 6 0
      debian/rules

+ 2 - 2
debian/control

@@ -7,7 +7,7 @@ Vcs-Git: https://git.in-ulm.de/cbiedl/python-magic.git
 Testsuite: autopkgtest-pkg-python
 Testsuite: autopkgtest-pkg-python
 Build-Depends: debhelper-compat (= 13),
 Build-Depends: debhelper-compat (= 13),
     dh-python,
     dh-python,
-    libmagic1 (>= 1:5.39),
+    libmagic-dev,
     python3-all,
     python3-all,
     python3-coverage,
     python3-coverage,
     python3-pytest,
     python3-pytest,
@@ -21,7 +21,7 @@ Section: libs
 Package: python3-magic
 Package: python3-magic
 Architecture: all
 Architecture: all
 Depends: ${misc:Depends}, ${python3:Depends},
 Depends: ${misc:Depends}, ${python3:Depends},
-    libmagic1 (>= 1:5.39),
+    ${magic:Depends},
 Section: python
 Section: python
 Priority: optional
 Priority: optional
 Description: python3 interface to the libmagic file type identification library
 Description: python3 interface to the libmagic file type identification library

+ 6 - 0
debian/rules

@@ -2,5 +2,11 @@
 
 
 export LC_ALL = C.UTF-8
 export LC_ALL = C.UTF-8
 
 
+libmagic_package := $(shell dpkg-query '-f$${Depends}' -W libmagic-dev | awk '{print $$1}')
+
 %:
 %:
 	dh $@ --buildsystem=pybuild --test-tox --with python3
 	dh $@ --buildsystem=pybuild --test-tox --with python3
+
+override_dh_gencontrol:
+	echo "magic:Depends=$(libmagic_package)" >>debian/python3-magic.substvars
+	dh_gencontrol $@