2015-07-02 13:15:27 +00:00
|
|
|
.PHONY: all clean doc log test
|
|
|
|
|
2006-11-08 22:52:04 +00:00
|
|
|
PKGNAME=pungi
|
2017-03-06 08:07:14 +00:00
|
|
|
VERSION=$(shell rpm -q --qf "%{VERSION}\n" --specfile ${PKGNAME}.spec | head -n1)
|
|
|
|
RELEASE=$(shell rpm -q --qf "%{RELEASE}\n" --specfile ${PKGNAME}.spec | head -n1)
|
2016-09-27 06:49:17 +00:00
|
|
|
GITTAG=${PKGNAME}-$(VERSION)
|
2007-02-12 21:50:02 +00:00
|
|
|
PKGRPMFLAGS=--define "_topdir ${PWD}" --define "_specdir ${PWD}" --define "_sourcedir ${PWD}/dist" --define "_srcrpmdir ${PWD}" --define "_rpmdir ${PWD}" --define "_builddir ${PWD}"
|
|
|
|
|
|
|
|
RPM="noarch/${PKGNAME}-$(VERSION)-$(RELEASE).noarch.rpm"
|
|
|
|
SRPM="${PKGNAME}-$(VERSION)-$(RELEASE).src.rpm"
|
|
|
|
|
2020-07-28 01:23:53 +00:00
|
|
|
PYTEST=pytest
|
2019-06-20 11:20:44 +00:00
|
|
|
|
2006-11-08 22:52:04 +00:00
|
|
|
|
2015-06-25 12:02:52 +00:00
|
|
|
all: help
|
|
|
|
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Usage: make <target>"
|
|
|
|
@echo
|
|
|
|
@echo "Available targets are:"
|
|
|
|
@echo " help show this text"
|
|
|
|
@echo " clean remove python bytecode and temp files"
|
2015-07-02 13:15:27 +00:00
|
|
|
@echo " doc build documentation"
|
2015-06-25 12:02:52 +00:00
|
|
|
@echo " install install program on current system"
|
|
|
|
@echo " test run tests"
|
2016-02-23 12:03:11 +00:00
|
|
|
@echo " test-coverage run tests and generate a coverage report"
|
|
|
|
@echo " test-compose run a small teest compose (requires test data)"
|
|
|
|
@echo " test-data build test data (requirement for running tests)"
|
2015-06-25 12:02:52 +00:00
|
|
|
@echo
|
|
|
|
@echo "Available rel-eng targets are:"
|
|
|
|
@echo " archive create source tarball"
|
|
|
|
@echo " log display changelog for spec file"
|
|
|
|
@echo " tag create a git tag according to version and release from spec file"
|
|
|
|
@echo " rpm build rpm"
|
|
|
|
@echo " srpm build srpm"
|
|
|
|
@echo " rpminstall build rpm and install it"
|
|
|
|
@echo " release build srpm and create git tag"
|
2006-11-08 22:52:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
tag:
|
2008-04-01 18:58:05 +00:00
|
|
|
@git tag -a -m "Tag as $(GITTAG)" -f $(GITTAG)
|
|
|
|
@echo "Tagged as $(GITTAG)"
|
2015-06-25 12:02:52 +00:00
|
|
|
|
2006-11-08 22:52:04 +00:00
|
|
|
|
2008-04-01 18:58:05 +00:00
|
|
|
Changelog:
|
2009-03-09 22:22:44 +00:00
|
|
|
(GIT_DIR=.git git log > .changelog.tmp && mv .changelog.tmp Changelog; rm -f .changelog.tmp) || (touch Changelog; echo 'git directory not found: installing possibly empty changelog.' >&2)
|
2008-04-01 18:58:05 +00:00
|
|
|
|
2015-06-25 12:02:52 +00:00
|
|
|
|
2013-10-27 19:29:15 +00:00
|
|
|
log:
|
2015-06-25 12:02:52 +00:00
|
|
|
@(LC_ALL=C date +"* %a %b %e %Y `git config --get user.name` <`git config --get user.email`> - VERSION"; git log --pretty="format:- %s (%ae)" | sed -r 's/ \(([^@]+)@[^)]+\)/ (\1)/g' | cat) | less
|
|
|
|
|
2013-10-27 19:29:15 +00:00
|
|
|
|
2007-02-13 22:12:39 +00:00
|
|
|
archive:
|
2008-04-01 18:58:05 +00:00
|
|
|
@rm -f Changelog
|
2009-03-09 22:34:59 +00:00
|
|
|
@rm -f MANIFEST
|
2008-04-01 18:58:05 +00:00
|
|
|
@make Changelog
|
2006-11-08 22:52:04 +00:00
|
|
|
@rm -rf ${PKGNAME}-$(VERSION)/
|
2008-01-02 22:41:54 +00:00
|
|
|
@python setup.py sdist --formats=bztar > /dev/null
|
2008-04-01 18:58:38 +00:00
|
|
|
@echo "The archive is in dist/${PKGNAME}-$(VERSION).tar.bz2"
|
2006-11-08 22:52:04 +00:00
|
|
|
|
2015-06-25 12:02:52 +00:00
|
|
|
|
2006-11-08 22:52:04 +00:00
|
|
|
srpm: archive
|
2007-02-12 21:50:02 +00:00
|
|
|
@rm -f $(SRPM)
|
2006-11-08 22:52:04 +00:00
|
|
|
@rpmbuild -bs ${PKGRPMFLAGS} ${PKGNAME}.spec
|
2007-02-12 21:50:02 +00:00
|
|
|
@echo "The srpm is in $(SRPM)"
|
|
|
|
|
2015-06-25 12:02:52 +00:00
|
|
|
|
2007-02-15 23:19:20 +00:00
|
|
|
rpm: archive
|
2007-02-12 21:50:02 +00:00
|
|
|
@rpmbuild --clean -bb ${PKGRPMFLAGS} ${PKGNAME}.spec
|
|
|
|
@echo "The rpm is in $(RPM)"
|
|
|
|
|
2015-06-25 12:02:52 +00:00
|
|
|
|
2007-02-12 21:50:02 +00:00
|
|
|
rpminstall: rpm
|
|
|
|
@rpm -ivh --force $(RPM)
|
2006-11-08 22:52:04 +00:00
|
|
|
|
2015-06-25 12:02:52 +00:00
|
|
|
|
2007-02-15 23:19:20 +00:00
|
|
|
release: tag srpm
|
|
|
|
|
2015-06-25 12:02:52 +00:00
|
|
|
|
2007-06-11 18:37:35 +00:00
|
|
|
install:
|
|
|
|
@python setup.py install
|
|
|
|
|
2015-06-25 12:02:52 +00:00
|
|
|
|
2007-02-12 21:50:02 +00:00
|
|
|
clean:
|
2015-02-05 15:56:24 +00:00
|
|
|
@python setup.py clean
|
2015-06-25 12:02:52 +00:00
|
|
|
@rm -vf *.rpm
|
2007-08-09 01:03:11 +00:00
|
|
|
@rm -vrf noarch
|
|
|
|
@rm -vf *.tar.gz
|
|
|
|
@rm -vrf dist
|
|
|
|
@rm -vf MANIFEST
|
2008-04-01 18:58:05 +00:00
|
|
|
@rm -vf Changelog
|
2015-06-25 12:02:52 +00:00
|
|
|
@find . -\( -name "*.pyc" -o -name '*.pyo' -o -name "*~" -o -name "__pycache__" -\) -delete
|
|
|
|
@find . -depth -type d -a -name '*.egg-info' -exec rm -rf {} \;
|
|
|
|
|
|
|
|
|
|
|
|
test:
|
2020-07-28 01:23:53 +00:00
|
|
|
$(PYTEST) $(PYTEST_OPTS)
|
2015-06-25 12:02:52 +00:00
|
|
|
|
2016-02-23 12:03:11 +00:00
|
|
|
test-coverage:
|
2020-07-28 01:23:53 +00:00
|
|
|
$(PYTEST) --cov=pungi --cov-report term --cov-report html --cov-config tox.ini $(PYTEST_OPTS)
|
2015-06-25 12:02:52 +00:00
|
|
|
|
|
|
|
test-data:
|
|
|
|
./tests/data/specs/build.sh
|
2015-07-02 13:15:27 +00:00
|
|
|
|
2016-02-23 12:03:11 +00:00
|
|
|
test-compose:
|
|
|
|
cd tests && ./test_compose.sh
|
2015-07-02 13:15:27 +00:00
|
|
|
|
2018-09-10 08:16:44 +00:00
|
|
|
test-multi-compose:
|
|
|
|
PYTHONPATH=$$(pwd) PATH=$$(pwd)/bin:$$PATH pungi-orchestrate --debug start tests/data/multi-compose.conf
|
|
|
|
|
2015-07-02 13:15:27 +00:00
|
|
|
doc:
|
|
|
|
cd doc; make html
|