File: Makefile

package info (click to toggle)
python-rarfile 4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,308 kB
  • sloc: python: 4,180; makefile: 201; sh: 88; awk: 14
file content (71 lines) | stat: -rw-r--r-- 1,689 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
59
60
61
62
63
64
65
66
67
68
69
70
71

prefix = /usr/local

REPO = https://github.com/markokr/rarfile
NEWS = doc/news.rst

PACKAGE = $(shell python3 setup.py --name)
VERSION = $(shell python3 setup.py --version)
RXVERSION = $(shell python3 setup.py --version | sed 's/\./[.]/g')
TAG = v$(VERSION)
TGZ = $(PACKAGE)-$(VERSION).tar.gz
WHEEL = $(PACKAGE)-$(VERSION)-py3-none-any.whl
URL = $(REPO)/releases/download/$(TAG)

all:
	pyflakes rarfile.py
	tox -e lint
	tox -e py38-cryptography -- -n auto

install:
	python setup.py install --prefix=$(prefix)

clean:
	rm -rf __pycache__ build dist .tox
	rm -f *.pyc MANIFEST *.orig *.rej *.html *.class test/*.pyc
	rm -rf doc/_build doc/_static doc/_templates doc/html
	rm -rf .coverage cover*
	rm -rf *.egg-info
	rm -f test/files/*.rar.[pjt]* *.diffs

toxclean: clean
	rm -rf .tox

ack:
	for fn in test/files/*.py38-cryptography; do \
		cp $$fn `echo $$fn | sed 's/[.]py.*/.exp/'` || exit 1; \
	done

prepare:
	@echo "Checking version - $(VERSION)"
	@grep -qE '^\w+ $(RXVERSION)\b' $(NEWS) \
	|| { echo "Version '$(VERSION)' not in $(NEWS)"; exit 1; }
	@echo "Checking git repo"
	@git diff --stat --exit-code || { echo "ERROR: Unclean repo"; exit 1; }

release: prepare
	git tag $(TAG)
	git push github $(TAG):$(TAG)

upload:
	mkdir -p dist && rm -f dist/*
	cd dist && wget -q $(URL)/$(TGZ)
	cd dist && wget -q $(URL)/$(WHEEL)
	tar tvf dist/$(TGZ)
	unzip -t dist/$(WHEEL)
	twine upload dist/$(TGZ) dist/$(WHEEL)

shownote:
	awk -v VER="$(VERSION)" -f doc/note.awk $(NEWS) \
	| pandoc -f rst -t gfm --wrap=none

unrelease:
	git push github :$(TAG)
	git tag -d $(TAG)

dist-test:
	python3 setup.py sdist
	rm -rf $(PACKAGE)-$(VERSION)
	tar xf dist/$(TGZ)
	cd $(PACKAGE)-$(VERSION) && tox