More compat
[rarfile.git] / Makefile
blobd27c432cd51dd340ed2158d9c6560ff6fbd76728
2 prefix = /usr/local
4 REPO = https://github.com/markokr/rarfile
5 NEWS = doc/news.rst
7 PACKAGE = $(shell python3 setup.py --name)
8 VERSION = $(shell python3 setup.py --version)
9 RXVERSION = $(shell python3 setup.py --version | sed 's/\./[.]/g')
10 TAG = v$(VERSION)
11 TGZ = dist/$(PACKAGE)-$(VERSION).tar.gz
12 URL = $(REPO)/releases/download/v$(VERSION)/$(PACKAGE)-$(VERSION).tar.gz
14 all:
15 pyflakes3 rarfile.py
16 tox -e lint
17 tox -e py38-cryptography
19 install:
20 python setup.py install --prefix=$(prefix)
22 clean:
23 rm -rf __pycache__ build dist .tox
24 rm -f *.pyc MANIFEST *.orig *.rej *.html *.class test/*.pyc
25 rm -rf doc/_build doc/_static doc/_templates doc/html
26 rm -rf .coverage cover*
27 rm -rf *.egg-info
28 rm -f test/files/*.rar.[pjt]* *.diffs
30 toxclean: clean
31 rm -rf .tox
33 ack:
34 for fn in test/files/*.py38-cryptography; do \
35 cp $$fn `echo $$fn | sed 's/[.]py.*/.exp/'` || exit 1; \
36 done
38 prepare:
39 @echo "Checking version - $(VERSION)"
40 @grep -qE '^\w+ $(RXVERSION)\b' $(NEWS) \
41 || { echo "Version '$(VERSION)' not in $(NEWS)"; exit 1; }
42 @echo "Checking git repo"
43 @git diff --stat --exit-code || { echo "ERROR: Unclean repo"; exit 1; }
45 release: prepare
46 git tag $(TAG)
47 git push github $(TAG):$(TAG)
49 upload:
50 mkdir -p dist && rm -f dist/*
51 cd dist && wget -q $(URL)
52 tar tvf $(TGZ)
53 twine upload $(TGZ)
55 shownote:
56 awk -v VER="$(VERSION)" -f doc/note.awk $(NEWS) \
57 | pandoc -f rst -t gfm --wrap=none
59 unrelease:
60 git push github :$(TAG)
61 git tag -d $(TAG)
63 dist-test:
64 python3 setup.py sdist
65 rm -rf $(PACKAGE)-$(VERSION)
66 tar xf $(TGZ)
67 cd $(PACKAGE)-$(VERSION) && tox