summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: db42b82b9b6965cfadb914a3783cc984dba5d50c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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