#!/usr/bin/make -f # -*- makefile -*- #export DH_VERBOSE=1 include /usr/share/dpkg/pkg-info.mk %: dh $@ --with phpcomposer override_dh_auto_build: if [ ! -e libs/sysplugins/smarty_internal_configfilelexer.php.orig ]; then \ cp libs/sysplugins/smarty_internal_configfilelexer.php libs/sysplugins/smarty_internal_configfilelexer.php.orig; \ fi if [ ! -e libs/sysplugins/smarty_internal_configfileparser.php.orig ]; then \ cp libs/sysplugins/smarty_internal_configfileparser.php libs/sysplugins/smarty_internal_configfileparser.php.orig; \ fi php /usr/share/php/smarty-lexer/Create_Config_Parser.php if [ ! -e libs/sysplugins/smarty_internal_templatelexer.php.orig ]; then \ cp libs/sysplugins/smarty_internal_templatelexer.php libs/sysplugins/smarty_internal_templatelexer.php.orig; \ fi if [ ! -e libs/sysplugins/smarty_internal_templateparser.php.orig ]; then \ cp libs/sysplugins/smarty_internal_templateparser.php libs/sysplugins/smarty_internal_templateparser.php.orig; \ fi php /usr/share/php/smarty-lexer/Create_Template_Parser.php dh_auto_build override_dh_auto_clean: if [ -e libs/sysplugins/smarty_internal_configfilelexer.php.orig ]; then \ mv libs/sysplugins/smarty_internal_configfilelexer.php.orig libs/sysplugins/smarty_internal_configfilelexer.php; \ fi if [ -e libs/sysplugins/smarty_internal_configfileparser.php.orig ]; then \ mv libs/sysplugins/smarty_internal_configfileparser.php.orig libs/sysplugins/smarty_internal_configfileparser.php; \ fi if [ -e libs/sysplugins/smarty_internal_templatelexer.php.orig ]; then \ mv libs/sysplugins/smarty_internal_templatelexer.php.orig libs/sysplugins/smarty_internal_templatelexer.php; \ fi if [ -e libs/sysplugins/smarty_internal_templateparser.php.orig ]; then \ mv libs/sysplugins/smarty_internal_templateparser.php.orig libs/sysplugins/smarty_internal_templateparser.php; \ fi rm -f lexer/smarty_internal_configfilelexer.php rm -f lexer/smarty_internal_configfileparser.out rm -f lexer/smarty_internal_configfileparser.php rm -f lexer/smarty_internal_templatelexer.php rm -f lexer/smarty_internal_templateparser.out rm -f lexer/smarty_internal_templateparser.php override_dh_install: dh_install rm -f debian/smarty3/usr/share/php/smarty3/sysplugins/*.php.bak rm -f debian/smarty3/usr/share/php/smarty3/sysplugins/*.php.bak rm -f debian/smarty3/usr/share/php/smarty3/sysplugins/*.php.orig rm -f debian/smarty3/usr/share/php/smarty3/sysplugins/*.php.orig override_dh_installchangelogs: dh_installchangelogs change_log.txt PKD = $(word 1,$(abspath $(dir $(MAKEFILE_LIST)))) PKG = $(DEB_SOURCE) UVER = $(shell echo $(DEB_VERSION) | cut -d "-" -f1) DTYPE = +selfpack1 VER ?= $(subst $(DTYPE),,$(UVER)) UURL = git://github.com/smarty-php/smarty.git UREV = $(shell echo $(VER) | cut -d"." -f5) ## http://wiki.debian.org/onlyjob/get-orig-source .PHONY: get-orig-source get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE)) @ $(PKG)_$(VER)$(DTYPE).orig.tar.xz: $(info I: GIT Revision=$(UREV)) $(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..)) @echo "# Downloading..." git clone $(UURL) $(PKG)-$(VER) \ || $(RM) -r $(PKG)-$(VER) cd $(PKG)-$(VER) \ && git checkout "$(UREV)" \ && echo "# Setting times..." \ && for F in $$(git ls-tree -r --name-only HEAD); do touch --no-dereference -d "$$(git log -1 --format="%ai" -- $$F)" "$$F"; done \ && echo "# Cleaning-up..." \ && rm -rf \ .travis.yml \ travis.ini \ && $(RM) -r .git .git* @echo "# Packing..." find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \ | XZ_OPT="-6v" tar -caf "../$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \ && $(RM) -r "$(PKG)-$(VER)" ### Github provides broken tarballs for 3.1.31, see https://github.com/smarty-php/smarty/issues/325 #get-orig-source: # uscan --noconf --force-download --rename --download-current-version --destdir=..