#!/usr/bin/make -f DH_AUTO_OPTIONS := -v -Smakefile --parallel DEB_BUILD_MAINT_OPTIONS := hardening=+all DEB_CFLAGS_MAINT_APPEND := $(shell getconf LFS_CFLAGS) -Wall -Wextra TDIR := debian/_tmp_ DEFFILE := debian/default include /usr/share/dpkg/buildflags.mk %: dh "$@" # Set #DISTROMSG# in debian/defaults to for example 'Debian GNU/Linux' # 'Debian GNU/Hurd', or 'Ubuntu Linux' with a few leading spaces to # make the string appear centered when displayed by welcome2l. $(DEFFILE): $(DEFFILE).in debian/rules @set -e; rm -f "$@"; \ set -- $$(lsb_release --short --description || :); \ [ -n "$$2" -a "$${2#GNU/}" != "$$2" ] || set "$${1:-Debian}" Linux; \ distromsg=$$(echo "$$1 $$2" \ | sed -e ':loop; s|^.\{1,23\}$$| & |; tloop; s| *$$||g'); \ echo "Substituting \`#DISTROMSG#' in \`$@' with \`$$distromsg'"; \ sed -e "s|#DISTROMSG#|$$distromsg|g" < "$<" > "$@"; \ chmod 444 "$@" override_dh_auto_build: $(DEFFILE) dh_auto_build $(DH_AUTO_OPTIONS) -- CC=gcc CFLAGS+="$(CPPFLAGS)" override_dh_auto_install: dh_auto_install $(DH_AUTO_OPTIONS) \ --destdir=$(CURDIR)/debian/$(shell dh_listpackages)/usr -- \ INSTALL_MANPATH='$$(DESTDIR)/share/man' @test -d $(TDIR) || mkdir $(TDIR) # make sure that INSTALL file wasn't changed echo '8a200ad70ad278e894fd6a073acff7ea INSTALL' | md5sum -c @sed -e '14,140d' -e 's|/usr/local|/usr|g' < INSTALL > $(TDIR)/INSTALL override_dh_auto_clean: dh_auto_clean $(DH_AUTO_OPTIONS) rm -rf $(TDIR) $(DEFFILE)