Browse Source

Packaging cleanup

Christoph Biedl 6 years ago
parent
commit
f1f513768b
7 changed files with 61 additions and 100 deletions
  1. 1 1
      debian/compat
  2. 3 10
      debian/control
  3. 38 39
      debian/copyright
  4. 1 1
      debian/libmagic-mgc.dirs
  5. 2 2
      debian/libmagic-mgc.links
  6. 1 1
      debian/libmagic1.links
  7. 15 46
      debian/rules

+ 1 - 1
debian/compat

@@ -1 +1 @@
-9
+10

+ 3 - 10
debian/control

@@ -2,17 +2,8 @@ Source: file
 Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
 Homepage: http://www.darwinsys.com/file/
 Standards-Version: 4.0.1
-Build-Depends: debhelper (>= 9.20141010~),
-    dpkg-dev (>= 1.17.14~),
-Build-Depends-Arch:
-    dh-autoreconf,
+Build-Depends: debhelper (>= 10~),
     zlib1g-dev,
-Build-Depends-Indep:
-    dh-python,
-    python-all,
-    python-setuptools,
-    python3-all,
-    python3-setuptools,
 Priority: standard
 Section: utils
 
@@ -36,6 +27,7 @@ Depends: ${misc:Depends}, ${shlibs:Depends},
 Suggests:
     file,
 Section: libs
+Priority: optional
 Multi-Arch: same
 Description: Recognize the type of data in a file using "magic" numbers - library
  This library can be used to classify files according to magic number
@@ -49,6 +41,7 @@ Breaks:
 Replaces:
     libmagic1 (<< 1:5.28-4~),
 Section: libs
+Priority: optional
 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

+ 38 - 39
debian/copyright

@@ -1,83 +1,82 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: file
 Upstream-Contact: http://mx.gw.com/mailman/listinfo/file
 Source: ftp://ftp.astron.com/pub/file/
 
 Files: *
 Copyright: 1985-1995 Ian F. Darwin
-           1994-2016 Christos Zoulas <christos@zoulas.com>
+ 1994-2016 Christos Zoulas <christos@zoulas.com>
 License: BSD-2-Clause-alike
 
 Files:
-    src/apprentice.c
-    src/ascmagic.c
-    src/asprintf.c
-    src/compress.c
-    src/dprintf.c
-    src/encoding.c
-    src/file.c
-    src/fsmagic.c
-    src/is_tar.c
-    src/print.c
-    src/softmagic.c
-    src/vasprintf.c
+ src/apprentice.c
+ src/ascmagic.c
+ src/asprintf.c
+ src/compress.c
+ src/dprintf.c
+ src/encoding.c
+ src/file.c
+ src/fsmagic.c
+ src/is_tar.c
+ src/print.c
+ src/softmagic.c
+ src/vasprintf.c
 Copyright:
  Ian F. Darwin 1986-1995.
  maintained 1995-present by Christos Zoulas and others.
 License: BSD-2-Clause-alike
 
 Files:
-    src/funcs.c
-    src/magic.c
-    src/readelf.c
-    tests/test.c
+ src/funcs.c
+ src/magic.c
+ src/readelf.c
+ tests/test.c
 Copyright: 2003 Christos Zoulas
 License: BSD-2-Clause-alike
 
 Files:
-    src/apptype.c
-Copyright:
- Eberhard Mattes
+ src/apptype.c
+Copyright: Eberhard Mattes
 License: public-domain
 
 Files:
-    src/cdf.c
-    src/cdf_time.c
-    src/der.c
-    src/der.h
-    src/readcdf.c
+ src/cdf.c
+ src/cdf_time.c
+ src/der.c
+ src/der.h
+ src/readcdf.c
 Copyright: 2008 Christos Zoulas
 License: BSD-2-Clause-netbsd
 
 Files:
-    src/getline.c
+ src/getline.c
 Copyright: 2011 The NetBSD Foundation, Inc.
 License: BSD-2-Clause-netbsd
 
 Files:
-    src/fmtcheck.c
-    src/getopt_long.c
+ src/fmtcheck.c
+ src/getopt_long.c
 Copyright: 2000 The NetBSD Foundation, Inc.
 License: BSD-2-Clause-netbsd
 
 Files:
-    src/strcasestr.c
+ src/strcasestr.c
 Copyright: 1990, 1993 The Regents of the University of California
 License: BSD-2-Clause-regents
 
 Files:
-    src/strlcat.c
-    src/strlcpy.c
+ src/strlcat.c
+ src/strlcpy.c
 Copyright: 1998 Todd C. Miller <Todd.Miller@courtesan.com>
 License: MIT-Old-Style-with-legal-disclaimer-2
 
-Files: debian/*
+Files:
+ debian/*
 Copyright:
-    2007-2013 Daniel Baumann <mail@daniel-baumann.ch>
-    2014-2016 Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+ 2007-2013 Daniel Baumann <mail@daniel-baumann.ch>
+ 2014-2016 Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
 License: BSD-2-Clause-alike
 
-
 License: BSD-2-Clause-alike
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
@@ -103,6 +102,9 @@ License: BSD-2-Clause-alike
 Comment: Extra clause about copyright placement "immediately at the
  beginning of the file, without modification".
 
+License: public-domain
+ Written by Eberhard Mattes and put into the public domain
+
 License: BSD-2-Clause-netbsd
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
@@ -162,6 +164,3 @@ License: MIT-Old-Style-with-legal-disclaimer-2
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-License: public-domain
- Written by Eberhard Mattes and put into the public domain

+ 1 - 1
debian/libmagic-mgc.dirs

@@ -1 +1 @@
-/usr/share/file/magic
+usr/share/file/magic/

+ 2 - 2
debian/libmagic-mgc.links

@@ -3,5 +3,5 @@
 # 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
+usr/lib/file/magic.mgc  usr/share/file/magic.mgc
+usr/lib/file/magic.mgc  usr/share/misc/magic.mgc

+ 1 - 1
debian/libmagic1.links

@@ -2,4 +2,4 @@
 # upstream and many applications expect the magic in /usr/share/misc/,
 # other in /usr/share/file/.
 # Provide symlinks in the hope everybody gets satisfied.
-/usr/share/file/magic       /usr/share/misc/magic
+usr/share/file/magic    usr/share/misc/magic

+ 15 - 46
debian/rules

@@ -2,46 +2,23 @@
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
-SHELL := sh -e
-
-DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_MULTIARCH	?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-
-ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
-	CROSS= --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) CC=$(DEB_HOST_GNU_TYPE)-gcc LD=$(DEB_HOST_GNU_TYPE)-ld
-else
-	CROSS= --build=$(DEB_BUILD_GNU_TYPE)
-endif
-
 # HOWMANY is the number of bytes looked at by file
 CFLAGS += -DHOWMANY=0x18000
 
 %:
-	dh $@ $(DH_ADDONS)
-binary-arch build-arch install-arch: DH_ADDONS=--with autoreconf
-binary-indep build-indep install-indep: DH_ADDONS=--with python2,python3
-binary build install: DH_ADDONS=--with autoreconf,python2,python3
-
-override_dh_auto_clean:
-	dh_auto_clean
-
-	rm -rf python/build
-	rm -rf python/__pycache__
-	rm -f python/*.pyc
-
-override_dh_auto_configure-indep:
-	dh_auto_configure --buildsystem=pybuild --sourcedirectory=python
-override_dh_auto_build-indep:
-	dh_auto_build --buildsystem=pybuild --sourcedirectory=python
-override_dh_auto_test-indep:
-override_dh_auto_install-indep:
-	dh_auto_install --buildsystem=pybuild --sourcedirectory=python
-
-override_dh_auto_configure-arch:
-	dh_auto_configure -- $(CROSS) --prefix=/usr --datadir=\$${prefix}/share --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) --mandir=\$${prefix}/share/man --enable-fsect-man5 --enable-static --disable-silent-rules CFLAGS="$(CFLAGS)"
-
-override_dh_auto_install-arch:
+	dh $@
+
+override_dh_auto_configure:
+	dh_auto_configure -- \
+		--prefix=/usr \
+		--datadir=\$${prefix}/share \
+		--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
+		--mandir=\$${prefix}/share/man \
+		--enable-fsect-man5 \
+		--enable-static \
+		--disable-silent-rules CFLAGS="$(CFLAGS)"
+
+override_dh_auto_install:
 	dh_auto_install
 
 	mv debian/tmp/usr/share/misc debian/tmp/usr/share/file
@@ -56,16 +33,8 @@ override_dh_auto_install-arch:
 	# Remove useless files
 	rm -f debian/tmp/usr/lib/*/*.la
 
-override_dh_install:
-	dh_install --fail-missing
+override_dh_missing:
+	dh_missing --fail-missing
 
 override_dh_shlibdeps:
-ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
-	# use the just built file in dh_shlibdeps
-	PATH=$(CURDIR)/debian/file/usr/bin:$$PATH \
-		LD_LIBRARY_PATH=$(CURDIR)/debian/libmagic1/usr/lib/$(DEB_HOST_MULTIARCH)$${LD_LIBRARY_PATH+:$${LD_LIBRARY_PATH}} \
-		MAGIC=$(CURDIR)/debian/libmagic-mgc/usr/share/file/magic.mgc \
-		dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/lib
-else
 	dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/lib
-endif