summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules46
1 files changed, 46 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..db42b82
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,46 @@
+#!/usr/bin/make -f
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# HOWMANY is the number of bytes looked at by file
+CFLAGS += -DHOWMANY=0x18000
+
+ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+ export PATH := $(CURDIR)/debian/run-file:$(PATH)
+ export CURDIR
+endif
+
+%:
+ 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-libseccomp \
+ --disable-silent-rules CFLAGS="$(CFLAGS)"
+
+override_dh_auto_install:
+ dh_auto_install
+
+ mv debian/tmp/usr/share/misc debian/tmp/usr/share/file
+
+ install -D -m 0644 magic/magic.local debian/tmp/etc/magic
+ install -D -m 0644 magic/magic.local debian/tmp/etc/magic.mime
+
+ # Install additional headers
+ mkdir -p debian/libmagic-dev/usr/include/file
+ cp src/file.h debian/libmagic-dev/usr/include/file
+
+ # Remove useless files
+ rm -f debian/tmp/usr/lib/*/*.la
+
+override_dh_missing:
+ dh_missing --fail-missing
+
+override_dh_shlibdeps:
+ dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/lib