#!/usr/bin/make -f INSTALL = install INSTALL_PROGRAM = $(INSTALL) -p -m 755 export DEB_BUILD_MAINT_OPTIONS=hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/pkg-info.mk H_LDFLAGS = $(LDFLAGS) VENDOR=$(shell dpkg-vendor --query vendor | env LC_ALL=C tr A-Z a-z | env LC_ALL=C tr -d -c '[:alnum:]') CFLAGS += -Wall -g CONFIGFLAGS = --prefix=/usr CONFIGFLAGS += --mandir=/usr/share/man CONFIGFLAGS += --bindir=/bin CONFIGFLAGS += LDFLAGS="-Wl,--as-needed -g $(H_LDFLAGS)" CONFIGFLAGS += --infodir=/usr/share/info CONFIGFLAGS += --enable-maildir-support CONFIGFLAGS += --enable-max-jobtable-size=256 CONFIGFLAGS += --enable-etcdir=/etc/zsh CONFIGFLAGS += --enable-function-subdirs CONFIGFLAGS += --enable-site-fndir=/usr/local/share/zsh/site-functions CONFIGFLAGS += --enable-fndir=/usr/share/zsh/functions CONFIGFLAGS += --with-tcsetpgrp CONFIGFLAGS += --with-term-lib="ncursesw tinfo" CONFIGFLAGS += --enable-cap --enable-pcre CONFIGFLAGS += --enable-readnullcmd=pager CONFIGFLAGS += --enable-custom-patchlevel=$(VENDOR)/$(DEB_VERSION) CONFIGFLAGS += --enable-additional-fpath=/usr/share/zsh/vendor-functions,/usr/share/zsh/vendor-completions CONFIGFLAGS += --disable-ansi2knr STATICFLAGS = --disable-dynamic STATICFLAGS += --enable-ldflags=-static STATICFLAGS += --disable-dynamic-nss ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CONFIGFLAGS += --enable-zsh-debug CONFIGFLAGS += --enable-zsh-mem-debug CONFIGFLAGS += --enable-zsh-mem-warning CONFIGFLAGS += --enable-zsh-secure-free CONFIGFLAGS += --enable-zsh-hash-debug endif BUILT_USING=$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W libcap-dev libncursesw5-dev libpcre3-dev libc-dev-bin) %: dh $@ override_dh_auto_build-arch: build-dynamic build-static build-dynamic: dh_auto_build -B obj build-static: dh_auto_build -B obj-static override_dh_auto_build-indep: dh_auto_build -B obj -- pdf override_dh_auto_test-arch: if dpkg-architecture -qDEB_BUILD_ARCH_OS | grep -qv hurd; then \ HOME="$(CURDIR)/obj/testhome" ZTST_verbose=1 dh_auto_test -B obj; \ fi #HOME="$(CURDIR)/obj-static/testhome" ZTST_verbose=1 dh_auto_test -B obj-static || true override_dh_auto_test-indep: override_dh_auto_configure: chmod 755 configure mkdir -p obj/testhome obj-static/testhome dh_auto_configure -B obj -- $(CONFIGFLAGS) dh_auto_configure -B obj-static -- $(CONFIGFLAGS) $(STATICFLAGS) sed -e 's/#define VENDOR "pc"/#define VENDOR "$(VENDOR)"/' \ -i obj/config.h obj-static/config.h sed -e 's/files.mdd link=no/files.mdd link=static/;s/stat.mdd link=no/stat.mdd link=static/' \ -i obj-static/config.modules override_dh_auto_clean: dh_auto_clean -B obj dh_auto_clean -B obj-static override_dh_installdocs-indep: dh_installdocs -pzsh-doc --link-doc=zsh-common --doc-main-package=zsh-common dh_installdocs -pzsh-common # Needs a freshly built (arch-dependent) zsh executable to compile .zwc files override_dh_auto_install-indep: build-dynamic cd obj && $(MAKE) install.man DESTDIR=$(CURDIR)/debian/zsh-common perl $(CURDIR)/Util/helpfiles obj/Doc/zshbuiltins.1 debian/zsh-common/usr/share/zsh/help cd obj && $(MAKE) install.fns DESTDIR=$(CURDIR)/debian/zsh-common awk '/^#define FPATH_DIR/ { head=$$3; gsub(/"/,"",head); }; \ /^#define FPATH_SUBDIRS/ { $$1=""; $$2=""; gsub(/[" ]/,""); tail=$$0; } \ END { printf "%s/%s\n", head, tail; };' \ obj/Src/zshpaths.h >obj/Src/zshpaths.temp obj/Src/zsh -fc \ 'setopt extendedglob; \ for i in debian/zsh-common/'`cat obj/Src/zshpaths.temp`'; do \ zcompile -U -M $$i.zwc $$i/*~*.zwc(^/); \ chmod 644 $$i.zwc; \ done' # Docs: Info + HTML cd obj && $(MAKE) install.info install.html \ DESTDIR=$(CURDIR)/debian/zsh-doc htmldir=/usr/share/doc/zsh-common/html rm -f debian/zsh-doc/usr/share/info/dir* # Work around texi2html unfriendliness sed -i -e 's/