| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 | #!/usr/bin/make -fexport DEB_BUILD_MAINT_OPTIONS = hardening=+allSHELL := sh -eifeq (,$(filter stage1,$(DEB_BUILD_PROFILES)))-include /usr/share/python/python.mkendifDEB_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)-ldelse	CROSS= --build=$(DEB_BUILD_GNU_TYPE)endif# HOWMANY is the number of bytes looked at by fileCFLAGS += -DHOWMANY=0x18000ifeq (,$(filter stage1,$(DEB_BUILD_PROFILES)))PYTHON_VERSIONS=$(shell pyversions -r debian/control)PYTHON3_VERSIONS=$(shell py3versions -r debian/control)endif%:ifeq (,$(filter stage1,$(DEB_BUILD_PROFILES)))	dh ${@} --with autoreconf,python2,python3else	dh ${@} --with autoreconfendifoverride_dh_auto_clean:	dh_auto_clean	rm -rf python/build	rm -rf python/__pycache__	rm -f python/*.pycoverride_dh_auto_build:	dh_auto_buildifeq (,$(filter stage1,$(DEB_BUILD_PROFILES)))	for python in $(PYTHON_VERSIONS); \	do \		(cd python && $$python setup.py build_ext \			-L$(CURDIR)/src/.libs); \	done	for python in $(PYTHON3_VERSIONS); \	do \		(cd python && $$python setup.py build_ext \			-L$(CURDIR)/src/.libs); \	doneendifoverride_dh_auto_configure:	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:	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.mimeifeq (,$(filter stage1,$(DEB_BUILD_PROFILES)))	for python in $(PYTHON_VERSIONS); \	do \		(cd python && $$python setup.py install --no-compile \			--root=$(CURDIR)/debian/python-magic $(py_setup_install_args)); \	done	for python in $(PYTHON3_VERSIONS); \	do \		(cd python && $$python setup.py install --no-compile \			--root=$(CURDIR)/debian/python3-magic $(py_setup_install_args)); \	doneendif	# Installing additional headers	mkdir -p debian/libmagic-dev/usr/include/file	cp src/file.h debian/libmagic-dev/usr/include/file	# Removing useless files	rm -f debian/tmp/usr/lib/*/*.laoverride_dh_builddeb:	dh_builddeb -- -Zxzoverride_dh_install:	dh_install --fail-missingoverride_dh_shlibdeps:ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))	# use 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/libmagic1/usr/share/file/magic.mgc \		dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/libelse	dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/libendifoverride_dh_strip:ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))	# use just built file in dh_strip	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/libmagic1/usr/share/file/magic.mgc \		dh_strip --dbg-package=file-dbgelse	dh_strip --dbg-package=file-dbgendif
 |