46 lines
1.5 KiB
Makefile
Executable File
46 lines
1.5 KiB
Makefile
Executable File
#!/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 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
|
|
|
|
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
|