File: rules

package info (click to toggle)
django-ratelimit 0.4.0+8+gd58c489-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, sid
  • size: 200 kB
  • ctags: 204
  • sloc: python: 508; makefile: 159; sh: 16
file content (48 lines) | stat: -rwxr-xr-x 1,638 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
#!/usr/bin/make -f
DH_VERBOSE = 1
export PYBUILD_NAME=django-ratelimit
# upstream version part in debian/changelog is generate with:
# $ git describe --tags COMMIT_FOR_RELEASE | sed -e 's,^v,,' -e 's,-,+,g'
# where COMMIT_FOR_RELEASE is the commit put in prinstine-tar branch
# we need to maintain up-to-date pristine-tar branch
orig_version=$(shell dpkg-parsechangelog | grep ^Version | cut -d' ' -f2 | cut -d- -f1)
pkgname=$(shell dpkg-parsechangelog | grep ^Source | cut -d' ' -f2)
# If we are w/o .git dir try to wget orig source.
# this is to maintain up-to-date, this is not a good solution
upstream_commit_release="d58c489797405db348b30dec6103dcfff73160ec"
upstream_base_url="https://github.com/jsocol/django-ratelimit/archive"

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

override_dh_auto_build:
	dh_testdir
	$(MAKE) -C docs html
	dh_auto_build

override_dh_auto_test:
	dh_testdir
	@echo test with python3
	PYTHONPATH="." DJANGO_SETTINGS_MODULE="test_settings" \
	python3 $(shell which django-admin) test ratelimit
	@echo test with python2
	PYTHONPATH="." DJANGO_SETTINGS_MODULE="test_settings" \
	python2 $(shell which django-admin) test ratelimit

override_dh_clean:
	$(MAKE) -C docs clean
	rm -rf docs/_build *.egg-info
	dh_clean

get-orig-source:
	dh_testdir
	uscan --no-verbose --download-current-version || $(MAKE) -f debian/rules git-orig-source

git-orig-source:
	dh_testdir
	if test -d .git ; then \
	 pristine-tar checkout ../$(pkgname)_$(orig_version).orig.tar.gz ; \
	else \
	 wget -O ../$(pkgname)_$(orig_version).orig.tar.gz \
	 "$(upstream_base_url)/$(upstream_commit_release).tar.gz" ; \
	fi