File: rules

package info (click to toggle)
libheif 1.3.2-2~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,696 kB
  • sloc: cpp: 10,880; sh: 4,550; python: 3,016; ansic: 283; makefile: 235; xml: 10
file content (28 lines) | stat: -rwxr-xr-x 1,201 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f
#export DH_VERBOSE=1

PKD = $(abspath $(dir $(MAKEFILE_LIST)))
PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
VER = $(shell dpkg-parsechangelog -l$(PKD)/changelog | grep "^Version:" | sed "s/^Version:\s\+\(\d:\)\?\([^\+\-]\+\).*/\2/g")
COMMIT = $(shell git log -1 --pretty=%h)

%:
	dh $@

UURL = git://github.com/strukturag/libheif.git
DATE = $(shell date --utc +%Y%m%d%H%M%S)
get-head-source:
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting.))
	@echo "# Downloading..."
	git clone $(UURL) $(PKG)-$(VER) \
		|| $(RM) -r $(PKG)-$(VER)
	cd $(PKG)-$(VER) \
	&& echo "# Checking out commit $(COMMIT)..." \
	&& git checkout -q $(COMMIT) \
	&& 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 \
	&& $(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)+$(DATE)+git$(COMMIT).orig.tar.xz" -T- --transform "s/$(PKG)-$(VER)/$(PKG)_$(VER)+$(DATE)+git$(COMMIT)/g" --owner=root --group=root --mode=a+rX \
	&& $(RM) -r "$(PKG)-$(VER)"