File: rules

package info (click to toggle)
avarice 2.13%2Bsvn347-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,880 kB
  • sloc: cpp: 22,872; sh: 4,129; ansic: 1,134; makefile: 92
file content (34 lines) | stat: -rwxr-xr-x 1,330 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh  $@ --with autoreconf --parallel

PKD   = $(abspath $(dir $(MAKEFILE_LIST)))
PKG   = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
UVER  = $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
REV  = $(shell echo $(VER) | perl -ne 'print "$$1" if m/(?:git|svn|hg)(\d+)/;')
VER  ?= $(subst $(DTYPE),,$(UVER))
UURL = svn://svn.code.sf.net/p/avarice/code/trunk
UPVER = $(shell echo $(VER) | sed 's/+.*$$//' )

.PHONY: get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER))
	@


$(PKG)_$(VER).orig.tar.xz: $(info I: REV=$(REV) UPVER=$(UPVER))
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
	svn checkout --config-option config:miscellany:use-commit-times=yes -r $(REV) \
	$(UURL) $(PKG)-$(VER) || $(RM) -r $(PKG)-$(VER)
	@echo "Clean-up..."
	cd $(PKG)-$(VER)/avarice \
	&& find . -depth -name ".svn" -exec $(RM) -r '{}' \; \
	&& ./Bootstrap && ./configure && make dist-xz 
	@echo "# Packing..."
	find "$(PKG)-$(VER)/avarice/" -name avarice-$(UPVER)svn*.xz -exec mv '{}' "$(PKG)_$(VER).orig.tar.xz" \; \
	&& $(RM) -r "$(PKG)-$(VER)"