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>
 Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
 Homepage: http://www.darwinsys.com/file/
 Homepage: http://www.darwinsys.com/file/
 Standards-Version: 4.0.1
 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,
     zlib1g-dev,
-Build-Depends-Indep:
-    dh-python,
-    python-all,
-    python-setuptools,
-    python3-all,
-    python3-setuptools,
 Priority: standard
 Priority: standard
 Section: utils
 Section: utils
 
 
@@ -36,6 +27,7 @@ Depends: ${misc:Depends}, ${shlibs:Depends},
 Suggests:
 Suggests:
     file,
     file,
 Section: libs
 Section: libs
+Priority: optional
 Multi-Arch: same
 Multi-Arch: same
 Description: Recognize the type of data in a file using "magic" numbers - library
 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
  This library can be used to classify files according to magic number
@@ -49,6 +41,7 @@ Breaks:
 Replaces:
 Replaces:
     libmagic1 (<< 1:5.28-4~),
     libmagic1 (<< 1:5.28-4~),
 Section: libs
 Section: libs
+Priority: optional
 Multi-Arch: foreign
 Multi-Arch: foreign
 Description: File type determination library using "magic" numbers (compiled magic file)
 Description: File type determination library using "magic" numbers (compiled magic file)
  This package provides the compiled magic file "magic.mgc". It has
  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-Name: file
 Upstream-Contact: http://mx.gw.com/mailman/listinfo/file
 Upstream-Contact: http://mx.gw.com/mailman/listinfo/file
 Source: ftp://ftp.astron.com/pub/file/
 Source: ftp://ftp.astron.com/pub/file/
 
 
 Files: *
 Files: *
 Copyright: 1985-1995 Ian F. Darwin
 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
 License: BSD-2-Clause-alike
 
 
 Files:
 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:
 Copyright:
  Ian F. Darwin 1986-1995.
  Ian F. Darwin 1986-1995.
  maintained 1995-present by Christos Zoulas and others.
  maintained 1995-present by Christos Zoulas and others.
 License: BSD-2-Clause-alike
 License: BSD-2-Clause-alike
 
 
 Files:
 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
 Copyright: 2003 Christos Zoulas
 License: BSD-2-Clause-alike
 License: BSD-2-Clause-alike
 
 
 Files:
 Files:
-    src/apptype.c
-Copyright:
- Eberhard Mattes
+ src/apptype.c
+Copyright: Eberhard Mattes
 License: public-domain
 License: public-domain
 
 
 Files:
 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
 Copyright: 2008 Christos Zoulas
 License: BSD-2-Clause-netbsd
 License: BSD-2-Clause-netbsd
 
 
 Files:
 Files:
-    src/getline.c
+ src/getline.c
 Copyright: 2011 The NetBSD Foundation, Inc.
 Copyright: 2011 The NetBSD Foundation, Inc.
 License: BSD-2-Clause-netbsd
 License: BSD-2-Clause-netbsd
 
 
 Files:
 Files:
-    src/fmtcheck.c
-    src/getopt_long.c
+ src/fmtcheck.c
+ src/getopt_long.c
 Copyright: 2000 The NetBSD Foundation, Inc.
 Copyright: 2000 The NetBSD Foundation, Inc.
 License: BSD-2-Clause-netbsd
 License: BSD-2-Clause-netbsd
 
 
 Files:
 Files:
-    src/strcasestr.c
+ src/strcasestr.c
 Copyright: 1990, 1993 The Regents of the University of California
 Copyright: 1990, 1993 The Regents of the University of California
 License: BSD-2-Clause-regents
 License: BSD-2-Clause-regents
 
 
 Files:
 Files:
-    src/strlcat.c
-    src/strlcpy.c
+ src/strlcat.c
+ src/strlcpy.c
 Copyright: 1998 Todd C. Miller <Todd.Miller@courtesan.com>
 Copyright: 1998 Todd C. Miller <Todd.Miller@courtesan.com>
 License: MIT-Old-Style-with-legal-disclaimer-2
 License: MIT-Old-Style-with-legal-disclaimer-2
 
 
-Files: debian/*
+Files:
+ debian/*
 Copyright:
 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
 
 
-
 License: BSD-2-Clause-alike
 License: BSD-2-Clause-alike
  Redistribution and use in source and binary forms, with or without
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  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
 Comment: Extra clause about copyright placement "immediately at the
  beginning of the file, without modification".
  beginning of the file, without modification".
 
 
+License: public-domain
+ Written by Eberhard Mattes and put into the public domain
+
 License: BSD-2-Clause-netbsd
 License: BSD-2-Clause-netbsd
  Redistribution and use in source and binary forms, with or without
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  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
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  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
 # other in /usr/share/file/. The compiled magic however is
 # arch-dependent and must therefore be in /usr/lib/
 # arch-dependent and must therefore be in /usr/lib/
 # 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/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/,
 # upstream and many applications expect the magic in /usr/share/misc/,
 # other in /usr/share/file/.
 # other in /usr/share/file/.
 # Provide symlinks in the hope everybody gets satisfied.
 # 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
 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
 # HOWMANY is the number of bytes looked at by file
 CFLAGS += -DHOWMANY=0x18000
 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
 	dh_auto_install
 
 
 	mv debian/tmp/usr/share/misc debian/tmp/usr/share/file
 	mv debian/tmp/usr/share/misc debian/tmp/usr/share/file
@@ -56,16 +33,8 @@ override_dh_auto_install-arch:
 	# Remove useless files
 	# Remove useless files
 	rm -f debian/tmp/usr/lib/*/*.la
 	rm -f debian/tmp/usr/lib/*/*.la
 
 
-override_dh_install:
-	dh_install --fail-missing
+override_dh_missing:
+	dh_missing --fail-missing
 
 
 override_dh_shlibdeps:
 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
 	dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/lib
-endif