diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-11 09:04:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-13 09:34:21 +0000 |
commit | 47553c43d71b7b1144f912ab9679f5b60e858fa2 (patch) | |
tree | 08378beaeeea8f9bb2686d3037c7b6f5062bb948 /Makefile | |
parent | Initial commit. (diff) | |
download | cvprac-a65feb76b09ace829c4c389df1bb986491d035ae.tar.xz cvprac-a65feb76b09ace829c4c389df1bb986491d035ae.zip |
Adding upstream version 1.3.1+dfsg.upstream/1.3.1+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2c437d8 --- /dev/null +++ b/Makefile @@ -0,0 +1,86 @@ +#!/usr/bin/make +# WARN: gmake syntax +######################################################## +# Makefile for collector +# +# useful targets: +# make check -- manifest checks +# make clean -- clean up workspace +# make pep8 -- pep8 checks +# make pyflakes -- pyflakes checks +# make pylint -- source code checks +# make rpm -- build RPM package +# make sdist -- build python source distribution +# make systest -- runs the system tests +# make tests -- run all of the tests +# +######################################################## +# variable section + +NAME = "cvprac" + +PYTHON=python +COVERAGE=coverage +SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") + +VERSION := $(shell awk '/__version__/{print $$NF}' cvprac/__init__.py | sed "s/'//g") + +RPMSPECDIR = . +RPMSPEC = $(RPMSPECDIR)/$(NAME).spec +RPMRELEASE = 1 +RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)" + +PEP8_IGNORE = E302,E203,E261 +######################################################## + +all: clean check pep8 pyflakes pylint tests + +check: + check-manifest + +clean: + @echo "Cleaning up distutils stuff" + rm -rf rpmbuild build dist MANIFEST *.egg-info .coverage + @echo "Cleaning up byte compiled python stuff" + find . -type f -regex ".*\.py[co]$$" -delete + +coverage_report: + $(COVERAGE) report -m + +pep8: + -pep8 -r --max-line-length=120 --ignore=$(PEP8_IGNORE) cvprac/ + -pep8 -r --max-line-length=120 --ignore=$(PEP8_IGNORE),E402 test/ + +pyflakes: + pyflakes cvprac/ test/ + +pylint: + find ./cvprac ./test -name \*.py | xargs pylint --rcfile .pylintrc + +unittest: clean + $(COVERAGE) run --source $(NAME) -m unittest discover test/unit -v + +systest: clean + $(COVERAGE) run --source $(NAME) -m unittest discover test/system -v + +tests: unittest systest coverage_report + +rpmcommon: sdist + @mkdir -p rpmbuild + @cp dist/*.gz rpmbuild/ + @sed -e 's#^Version:.*#Version: $(VERSION)#' -e 's#^Release:.*#Release: $(RPMRELEASE)#' $(RPMSPEC) >rpmbuild/$(NAME).spec + +rpm: rpmcommon + @rpmbuild --define "_topdir %(pwd)/rpmbuild" \ + --define "_builddir %{_topdir}" \ + --define "_rpmdir %{_topdir}" \ + --define "_srcrpmdir %{_topdir}" \ + --define "_specdir $(RPMSPECDIR)" \ + --define "_sourcedir %{_topdir}" \ + --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.rpm" \ + --define "__python /usr/bin/python" \ + -ba rpmbuild/$(NAME).spec + @rm -f rpmbuild/$(NAME).spec + +sdist: clean + $(PYTHON) setup.py sdist |