65 lines
2 KiB
Makefile
65 lines
2 KiB
Makefile
|
PYTHON=`which python3`
|
||
|
PYTHONCOVERAGE=`which python3-coverage`
|
||
|
DESTDIR=/
|
||
|
BUILDIR=$(CURDIR)/debian/pymanager
|
||
|
PROJECT=pymanager
|
||
|
VERSION=1.0.0
|
||
|
OMIT_COVERGAGE=--omit=/usr/lib/python3/*,tests/*
|
||
|
|
||
|
all:
|
||
|
@echo "make sdist - Create source package"
|
||
|
@echo "make bdist - Create package"
|
||
|
@echo "make test - Test"
|
||
|
@echo "make coverage - coverage"
|
||
|
@echo "make htmldoc - generate html doc (out : doc/build)"
|
||
|
@echo "make install - Install on local system"
|
||
|
@echo "make builddeb - Generate a deb package"
|
||
|
@echo "make clean - Get rid of scratch and byte files"
|
||
|
|
||
|
sdist:
|
||
|
$(PYTHON) setup.py sdist $(COMPILE)
|
||
|
|
||
|
bdist:
|
||
|
$(PYTHON) setup.py bdist $(COMPILE)
|
||
|
|
||
|
test:
|
||
|
$(PYTHON) setup.py test
|
||
|
|
||
|
coverage:
|
||
|
$(PYTHONCOVERAGE) erase
|
||
|
$(PYTHONCOVERAGE) run -a ${OMIT_COVERGAGE} pymanager/certificate.py --version
|
||
|
$(PYTHONCOVERAGE) run -a ${OMIT_COVERGAGE} tests/test_certificate.py
|
||
|
$(PYTHONCOVERAGE) run -a ${OMIT_COVERGAGE} pymanager/manager.py --version
|
||
|
$(PYTHONCOVERAGE) run -a ${OMIT_COVERGAGE} tests/test_manager.py
|
||
|
$(PYTHONCOVERAGE) run -a ${OMIT_COVERGAGE} pymanager/client.py --version
|
||
|
$(PYTHONCOVERAGE) run -a ${OMIT_COVERGAGE} tests/test_client.py
|
||
|
$(PYTHONCOVERAGE) run -a ${OMIT_COVERGAGE} pymanager/password.py --version
|
||
|
$(PYTHONCOVERAGE) run -a ${OMIT_COVERGAGE} tests/test_password.py
|
||
|
$(PYTHONCOVERAGE) report # ${OMIT_COVERGAGE}
|
||
|
$(PYTHONCOVERAGE) html
|
||
|
|
||
|
htmldoc:
|
||
|
sphinx-build -b html docs/source docs/build
|
||
|
|
||
|
install:
|
||
|
$(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE)
|
||
|
|
||
|
builddeb:
|
||
|
# build the source package in the parent directory
|
||
|
# then rename it to project_version.orig.tar.gz
|
||
|
$(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../
|
||
|
rename -v -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*
|
||
|
# build the package
|
||
|
dpkg-buildpackage -i -I -rfakeroot
|
||
|
|
||
|
clean:
|
||
|
$(PYTHON) setup.py clean
|
||
|
$(MAKE) -f $(CURDIR)/debian/rules clean
|
||
|
rm -rf build/ MANIFEST
|
||
|
rm -rf docs/build/
|
||
|
rm -rf dist/
|
||
|
rm -rf .coverage
|
||
|
rm -rf htmlcov
|
||
|
rm -rf pymanager/__pycache__
|
||
|
find . -name '*.pyc' -delete
|