File: rules

package info (click to toggle)
python-sfml 1.5.1.is.1.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,456 kB
  • ctags: 1,585
  • sloc: python: 5,747; cpp: 285; makefile: 147
file content (58 lines) | stat: -rwxr-xr-x 1,876 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export PYBUILD_NAME=sfml
export PYBUILD_INSTALL_ARGS=--skip-build
export PYBUILD_TEST_PYTEST=1
export PYBUILD_TEST_ARGS=$(CURDIR)/tests

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+.*)};')
DTYPE = +dfsg
VER  ?= $(subst 1.5.is.,,$(subst $(DTYPE),,$(UVER)))

%:
	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild

override_dh_sphinxdoc-arch:

override_dh_auto_build-indep:
	$(MAKE) -C doc html

override_dh_installchangelogs:
	dh_installchangelogs doc/source/changelog.rst

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/build

# 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:
	@echo "# Downloading..."
	uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
	@echo "# Extracting..."
	mkdir $(PKG)-$(VER) \
	 && tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER) --strip-components 1 \
	 || $(RM) -r $(PKG)-$(VER)
	@echo "# Cleaning-up..."
	cd $(PKG)-$(VER) \
	 && $(RM) -r -v \
		examples/embedding/image.jpg \
		examples/extending/image.jpg \
		examples/*/resources/ \
		examples/*/data/ \
		tests/runtests.py
	#$(RM) -v $(PKG)_$(VER).orig.tar.*
	@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)"