#!/usr/bin/make -f # resolve DEB_VERSION_UPSTREAM include /usr/share/dpkg/pkg-info.mk export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic export DEB_CXXFLAGS_MAINT_APPEND = -Wall -pedantic # trust upstream optimization level unless explicitly disabled ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) export DEB_CFLAGS_MAINT_STRIP=-O2 export DEB_CXXFLAGS_MAINT_STRIP=-O2 endif # generate documentation unless nodoc requested ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) DOCS = README.html README.txt CHANGELOGS = CHANGELOG.html CHANGELOG.txt endif # target directory for generated man page and shell completion scripts export BUILD_SCRIPT_DIR = doc # resolve all direct entries in first "package..." section in TODO VENDORLIBS = $(shell perl -nE \ '/^(?:\s{2}[*]\s*(?:(package)|(\S+))|\s{4}[*]\s*(\S+))/ or next; \ $$i++ if $$1; exit if $$i > 1 or $$2; say $$3 if $$3 and $$i;' \ debian/TODO) %: dh $@ %.html: %.md cmark-gfm $< > $@ %.txt: %.md cmark-gfm --to plaintext $< > $@ execute_after_dh_auto_build: $(DOCS) $(CHANGELOGS) execute_after_dh_auto_install: debian/cyme/usr/bin/cyme --gen override_dh_installdocs: dh_installdocs --all -- $(DOCS) override_dh_installchangelogs: dh_installchangelogs -- $(CHANGELOGS) # custom target unused during official build get-vendorlibs: # preserve and use pristine Cargo.lock [ -f Cargo.lock.orig ] || cp Cargo.lock Cargo.lock.orig cp -f Cargo.lock.orig Cargo.lock # modernize crates cargo update # preserve needed crates cargo vendor --versioned-dirs debian/vendorlibs~ rm -rf debian/vendorlibs mkdir debian/vendorlibs cd debian/vendorlibs~ && mv --target-directory=../vendorlibs $(VENDORLIBS) # cleanup rm -rf debian/vendorlibs~ [ ! -f Cargo.lock.orig ] || mv -f Cargo.lock.orig Cargo.lock