#!/usr/bin/make -f # Invoke each target with `./debian/rules '. All targets should be # invoked with the package root as the current directory. package := liblopsub1t64 devpackage := liblopsub-dev binpackage := liblopsub-bin define checkdir @test -f debian/rules -a -f lopsub.c || \ (echo Not in correct source directory; exit 1) endef SRCTOP := $(shell pwd) TMPDIR := $(SRCTOP)/debian/tmp DESTDIR := $(SRCTOP)/debian/$(package) DEVDIR := $(SRCTOP)/debian/$(devpackage) DOCS_DIR := $(DESTDIR)/usr/share/doc/$(package) DEVDOCS_DIR := $(DEVDIR)/usr/share/doc/$(devpackage) TRIPLET := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) # activate the dh sequencer %: dh "$@" build-arch: $(checkdir) $(MAKE) $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all \ dpkg-buildflags --export=cmdline) build-indep: build: build-indep build-arch clean: $(checkdir) -rm -f debian/substvars $(MAKE) distclean dh_clean MAKE_DIR = install -p -d -m 755 INST_FILE = install -c -m 644 binary: build $(checkdir) $(MAKE) PREFIX=/usr install DESTDIR=$(TMPDIR) mv $(TMPDIR)/usr/lib $(TMPDIR)/usr/lib-$(TRIPLET) $(MAKE_DIR) $(TMPDIR)/usr/lib mv $(TMPDIR)/usr/lib-$(TRIPLET) $(TMPDIR)/usr/lib/$(TRIPLET) dh_install -p $(package) dh_install -p $(devpackage) dh_install -p $(binpackage) dh_link -p $(binpackage) dh_lintian $(MAKE_DIR) $(DESTDIR)/DEBIAN $(DOCS_DIR) $(DEVDOCS_DIR) echo 'activate-noawait ldconfig' > $(DESTDIR)/DEBIAN/triggers $(INST_FILE) debian/copyright $(DOCS_DIR)/copyright $(INST_FILE) debian/copyright $(DEVDOCS_DIR)/copyright $(INST_FILE) debian/changelog $(DOCS_DIR)/changelog.Debian $(INST_FILE) debian/changelog $(DEVDOCS_DIR)/changelog.Debian gzip -fn9 $(DOCS_DIR)/changelog.Debian gzip -fn9 $(DEVDOCS_DIR)/changelog.Debian dh_fixperms dh_makeshlibs dh_shlibdeps dh_strip dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary-indep binary-arch: binary .PHONY: clean build binary-arch binary-indep binary