File: rules

package info (click to toggle)
smarty3 3.1.33+20180830.1.3a78a21f+selfpack1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,036 kB
  • sloc: php: 18,535; yacc: 982; makefile: 74
file content (97 lines) | stat: -rwxr-xr-x 3,985 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/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=..