File: rules

package info (click to toggle)
php-net-ldap3 1.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 212 kB
  • ctags: 507
  • sloc: php: 2,192; makefile: 29
file content (31 lines) | stat: -rwxr-xr-x 1,324 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
%:
	dh $@ --with phpcomposer

UURL = https://git.kolab.org/diffusion/PNL/php-net_ldap.git
PKG  = php-net-ldap3
VER ?= $(shell dpkg-parsechangelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
PFX  = pear-Net-LDAP3-
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz
	:
$(PKG)_$(VER)$(DTYPE).orig.tar.xz: $(info I: VER=$(VER))
	$(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 $(PFX)$(VER) \
	&& [ -s ChangeLog ] || ( echo "# Generating ChangeLog..." \
	   ; git log --pretty="format:%ad  %aN  <%aE>%n%n%x09* %s%n" --date=short > ChangeLog \
	   ; touch -d "$$(git log -1 --format='%ci')" ChangeLog) \
	&& echo "# Setting times..." \
	&& git ls-tree -r --name-only HEAD | while read F ; do touch --no-dereference -d "$$(git log -1 --format="%ai" -- "$$F")" "$$F"; done \
	&& echo "# Cleaning-up..." \
	&& $(RM) -r -v \
	    notneededdir/unwantedfile1 \
	    notneededdir/unwantedfiles.* \
	&& $(RM) -r .git .git*
	@echo "# Packing..."
	find -L "$(PKG)-$(VER)" -xdev -type f -print | LC_ALL=C sort \
	| XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
	&& $(RM) -r "$(PKG)-$(VER)"