forked from clalancette/oz
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
54 lines (41 loc) · 1.75 KB
/
Makefile
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
VERSION = $(shell egrep "^VERSION" setup.py | awk '{print $$3}')
VENV_DIR = tests/.venv
sdist:
python setup.py sdist
signed-tarball: sdist
gpg --detach-sign --armor -o dist/oz-$(VERSION).tar.gz.sign dist/oz-$(VERSION).tar.gz
signed-rpm: sdist
rpmbuild -ba oz.spec --sign --define "_sourcedir `pwd`/dist"
rpm: sdist
rpmbuild -ba oz.spec --define "_sourcedir `pwd`/dist"
srpm: sdist
rpmbuild -bs oz.spec --define "_sourcedir `pwd`/dist"
release: signed-rpm signed-tarball
examples-manpage:
echo "Generating oz-examples man page"
@(cat man/examples/header ; \
for example in man/examples/*.example ; do \
sed -e 's/^EXAMPLE \(.*\)/.SH EXAMPLE \1/' \
-e 's/^#\(.*\)/.RS\n#\1\n.RE/' $$example ; \
done ; \
cat man/examples/footer) > man/oz-examples.1
man2html: examples-manpage
@for file in oz-install oz-customize oz-generate-icicle oz-cleanup-cache oz-examples; do \
echo "Generating $$file HTML page from man" ; \
groff -mandoc -mwww man/$$file.1 -T html > man/$$file.html ; \
done
$(VENV_DIR):
@virtualenv $(VENV_DIR)
@pip-python -E $(VENV_DIR) install pytest
@echo "Resolving potential problems where \$PWD contains spaces"
@for MATCH in $$(grep '^#!"/' $(VENV_DIR)/bin/* -l) ; do \
sed -i '1s|^#!".*/\([^/]*\)"|#!/usr/bin/env \1|' "$$MATCH" ; \
done
virtualenv: $(VENV_DIR)
unittests:
@[ -f $(VENV_DIR)/bin/activate ] && source $(VENV_DIR)/bin/activate ; python setup.py test
@(type deactivate 2>/dev/null | grep -q 'function') && deactivate || true
pylint:
pylint --rcfile=pylint.conf oz oz-install oz-customize oz-cleanup-cache oz-generate-icicle
clean:
rm -rf MANIFEST build dist usr *~ oz.spec *.pyc oz/*~ oz/*.pyc examples/*~ oz/auto/*~ man/*~ docs/*~ man/*.html $(VENV_DIR) tests/tdl/*~ tests/factory/*~ man/oz-examples.1 tests/results.xml