lorax/Makefile

81 lines
2.4 KiB
Makefile
Raw Normal View History

PYTHON ?= /usr/bin/python3
2010-12-08 13:16:13 +00:00
DESTDIR ?= /
PREFIX ?= /usr
mandir ?= $(PREFIX)/share/man
2010-12-02 12:36:22 +00:00
PKGNAME = lorax
VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec)
RELEASE = $(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec | sed -e 's|%.*$$||g')
2013-02-28 19:53:34 +00:00
TAG = lorax-$(VERSION)-$(RELEASE)
2010-12-02 12:36:22 +00:00
default: all
src/composer/version.py: lorax.spec
echo "num = '$(VERSION)-$(RELEASE)'" > src/composer/version.py
src/pylorax/version.py: lorax.spec
echo "num = '$(VERSION)-$(RELEASE)'" > src/pylorax/version.py
all: src/pylorax/version.py src/composer/version.py
$(PYTHON) setup.py build
2010-12-02 12:36:22 +00:00
install: all
$(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
2013-07-26 22:01:14 +00:00
mkdir -p $(DESTDIR)/$(mandir)/man1
install -m 644 docs/man/lorax.1 $(DESTDIR)/$(mandir)/man1
install -m 644 docs/man/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1
mkdir -p $(DESTDIR)/etc/bash_completion.d
2018-09-18 14:48:46 +00:00
install -m 644 etc/bash_completion.d/composer $(DESTDIR)/etc/bash_completion.d
check:
@echo "*** Running pylint ***"
PYTHONPATH=$(PYTHONPATH):./src/ ./tests/pylint/runpylint.py
test:
@echo "*** Running tests ***"
PYTHONPATH=$(PYTHONPATH):./src/ $(PYTHON) -m nose -v --with-coverage --cover-erase --cover-branches \
--cover-package=pylorax --cover-inclusive \
2018-05-04 18:35:31 +00:00
./tests/pylorax/ ./tests/composer/
coverage3 report -m
[ -f "/usr/bin/coveralls" ] && [ -n "$(COVERALLS_REPO_TOKEN)" ] && coveralls || echo
clean:
-rm -rf build src/pylorax/version.py
-rm -rf build src/composer/version.py
2010-10-12 16:23:29 +00:00
2010-12-02 12:36:22 +00:00
tag:
git tag -f $(TAG)
docs:
2018-03-15 19:20:22 +00:00
$(MAKE) -C docs apidoc html
archive:
2010-12-02 12:36:22 +00:00
@git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) > $(PKGNAME)-$(VERSION).tar
2013-02-28 20:11:05 +00:00
@gzip $(PKGNAME)-$(VERSION).tar
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
2010-10-19 15:35:50 +00:00
dist: tag archive
scp $(PKGNAME)-$(VERSION).tar.gz fedorahosted.org:lorax
2010-12-02 12:36:22 +00:00
local:
2013-02-28 20:11:05 +00:00
@rm -rf $(PKGNAME)-$(VERSION).tar.gz
@rm -rf /var/tmp/$(PKGNAME)-$(VERSION)
@dir=$$PWD; cp -a $$dir /var/tmp/$(PKGNAME)-$(VERSION)
@rm -rf /var/tmp/$(PKGNAME)-$(VERSION)/.git
@dir=$$PWD; cd /var/tmp; tar --gzip -cSpf $$dir/$(PKGNAME)-$(VERSION).tar.gz $(PKGNAME)-$(VERSION)
@rm -rf /var/tmp/$(PKGNAME)-$(VERSION)
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
test-in-docker:
sudo docker build -t welder/lorax:latest -f Dockerfile.test .
docs-in-docker:
sudo docker run -it --rm -v `pwd`/docs/html/:/lorax/docs/html/ --security-opt label=disable welder/lorax-composer:latest make docs
ci: check test
2018-03-15 19:20:22 +00:00
.PHONY: docs