~debian-janitor/debian/sid/loggerhead/lintian-fixes

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
#!/usr/bin/make -f

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|bzr)(\d+)/;')
UURL = lp:loggerhead
DTYPE = +dfsg
VER  ?= $(subst $(DTYPE),,$(UVER))

## 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))
	@

%:
	dh $* --with=python2 --buildsystem=pybuild

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
CONCURRENCY = BZR_CONCURRENCY=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	$(CONCURRENCY) BZR_PLUGINS_AT=loggerhead@$(CURDIR) /usr/bin/bzr selftest \
	    --parallel=fork -v -s bp.loggerhead
endif

override_dh_auto_clean:
	dh_auto_clean
	cd docs/ && $(MAKE) clean

override_dh_auto_build:
	dh_auto_build
	cd docs/ && $(MAKE) html
	cd docs/_build/html/_static/ && rm jquery.js underscore.js

$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
	bzr export --revision=$(REV) $(PKG)-$(VER) $(UURL) \
	|| $(RM) -r $(PKG)-$(VER)
	@echo "# Removing copy of YUI3..."
	cd $(PKG)-$(VER) \
		&& $(RM) -r -v \
		loggerhead/static/javascript/yui
	@echo "# Packing..."
	XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" "$(PKG)-$(VER)" \
	&& $(RM) -r "$(PKG)-$(VER)"