2015-01-27 16:28:09 -05:00
|
|
|
# Installation directories.
|
|
|
|
|
PREFIX ?= $(DESTDIR)/usr
|
|
|
|
|
SYSCONFDIR ?= $(DESTDIR)/etc/sysconfig
|
|
|
|
|
PROFILEDIR ?= $(DESTDIR)/etc/profile.d
|
2016-12-08 23:37:15 +01:00
|
|
|
export PYTHON ?= /usr/bin/python
|
|
|
|
|
export PYTHON3 ?= /usr/bin/python3
|
2016-07-19 17:23:39 -04:00
|
|
|
PYLINT ?= $(PYTHON) -m pylint
|
|
|
|
|
PYTHON3_PYLINT ?= $(PYTHON3) -m pylint
|
2015-10-07 15:37:49 +02:00
|
|
|
GO_MD2MAN ?= /usr/bin/go-md2man
|
2016-03-23 14:11:01 +01:00
|
|
|
GO ?= /usr/bin/go
|
2016-03-10 09:22:40 -05:00
|
|
|
PYTHONSITELIB=$(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(0))")
|
2016-01-22 09:27:47 -08:00
|
|
|
VERSION=$(shell $(PYTHON) setup.py --version)
|
2016-08-18 17:10:39 +02:00
|
|
|
export GOPATH = $(shell pwd)/godeps
|
2016-10-27 13:51:15 -05:00
|
|
|
BOX="fedora_atomic"
|
2015-01-27 16:28:09 -05:00
|
|
|
|
2015-10-06 14:24:29 -04:00
|
|
|
.PHONY: all
|
2018-03-24 13:36:50 +01:00
|
|
|
all: python-build docs pylint-check gotar
|
2015-02-18 16:53:05 -05:00
|
|
|
|
2016-07-07 14:45:55 -04:00
|
|
|
.PHONY: test-python3-pylint
|
2016-08-15 10:29:13 -04:00
|
|
|
test-python3-pylint:
|
2017-10-12 13:37:33 +02:00
|
|
|
$(PYTHON3_PYLINT) --disable=all --enable=E --enable=W --additional-builtins=_ *.py atomic Atomic tests/unit/*.py -d=no-absolute-import,print-statement,no-absolute-import,bad-builtin,catching-non-exception,raising-non-exception
|
2016-07-07 14:45:55 -04:00
|
|
|
|
2017-03-23 17:03:33 +01:00
|
|
|
.PHONY: test check test-suite
|
2016-07-15 09:55:10 +02:00
|
|
|
|
|
|
|
|
check: test
|
|
|
|
|
|
2017-03-23 17:03:33 +01:00
|
|
|
test-suite:
|
2016-01-18 11:08:32 -05:00
|
|
|
./test.sh
|
2015-02-08 17:33:44 +01:00
|
|
|
|
2017-03-23 17:03:33 +01:00
|
|
|
test: all test-python3-pylint test-suite
|
|
|
|
|
|
2016-05-27 16:44:45 +02:00
|
|
|
test-destructive: all
|
|
|
|
|
ENABLE_DESTRUCTIVE=1 ./test.sh
|
|
|
|
|
|
2015-10-06 14:24:29 -04:00
|
|
|
.PHONY: python-build
|
|
|
|
|
python-build:
|
2015-01-27 16:28:09 -05:00
|
|
|
$(PYTHON) setup.py build
|
2015-11-11 12:36:25 +01:00
|
|
|
|
2015-11-11 12:56:28 +01:00
|
|
|
.PHONY: pylint-check
|
2015-11-11 12:36:25 +01:00
|
|
|
pylint-check:
|
2017-10-12 13:37:33 +02:00
|
|
|
$(PYLINT) --disable=all --enable=E --enable=W --additional-builtins=_ *.py atomic Atomic tests/unit/*.py -d=no-absolute-import,print-statement,no-absolute-import,bad-builtin,catching-non-exception,raising-non-exception
|
2015-01-27 16:28:09 -05:00
|
|
|
|
2015-02-18 17:45:25 -05:00
|
|
|
MANPAGES_MD = $(wildcard docs/*.md)
|
|
|
|
|
|
|
|
|
|
docs/%.1: docs/%.1.md
|
2015-10-07 15:37:49 +02:00
|
|
|
$(GO_MD2MAN) -in $< -out $@.tmp && touch $@.tmp && mv $@.tmp $@
|
2015-02-18 17:45:25 -05:00
|
|
|
|
2015-10-06 14:24:29 -04:00
|
|
|
.PHONY: docs
|
2015-02-18 17:45:25 -05:00
|
|
|
docs: $(MANPAGES_MD:%.md=%)
|
|
|
|
|
|
2016-08-18 11:16:13 -04:00
|
|
|
gotar: gotar.go
|
|
|
|
|
$(GO) build -o $@ $<
|
|
|
|
|
|
2015-10-06 14:24:29 -04:00
|
|
|
.PHONY: clean
|
2015-01-27 16:28:09 -05:00
|
|
|
clean:
|
|
|
|
|
$(PYTHON) setup.py clean
|
2015-11-01 12:53:18 -05:00
|
|
|
-rm -rf dist build *~ \#* *pyc .#* docs/*.1
|
2018-02-13 09:22:52 -06:00
|
|
|
rm -fr build
|
2015-01-27 16:28:09 -05:00
|
|
|
|
2015-11-11 12:56:28 +01:00
|
|
|
.PHONY: install-only
|
|
|
|
|
install-only:
|
2018-04-16 12:15:47 +02:00
|
|
|
$(PYTHON) setup.py install --prefix=/usr --install-scripts /usr/share/atomic `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
|
2015-07-10 16:16:28 -04:00
|
|
|
|
2016-01-22 09:27:47 -08:00
|
|
|
(cd $(DESTDIR)/$(PYTHONSITELIB) && rm -f atomic-$(VERSION)-*egg-info)
|
|
|
|
|
|
2015-07-10 16:16:28 -04:00
|
|
|
install -d -m 0755 $(DESTDIR)/usr/bin
|
|
|
|
|
ln -fs ../share/atomic/atomic $(DESTDIR)/usr/bin/atomic
|
|
|
|
|
|
2015-11-01 12:53:18 -05:00
|
|
|
install -d -m 0755 $(DESTDIR)/usr/libexec/atomic
|
2018-03-24 13:36:50 +01:00
|
|
|
install -m 0755 migrate.sh gotar $(DESTDIR)/usr/libexec/atomic
|
2015-10-22 15:24:50 -04:00
|
|
|
|
2015-01-27 16:28:09 -05:00
|
|
|
[ -d $(SYSCONFDIR) ] || mkdir -p $(SYSCONFDIR)
|
|
|
|
|
install -m 644 atomic.sysconfig $(SYSCONFDIR)/atomic
|
|
|
|
|
|
|
|
|
|
[ -d $(PROFILEDIR) ] || mkdir -p $(PROFILEDIR)
|
|
|
|
|
install -m 644 atomic.sh $(PROFILEDIR)
|
2015-02-18 17:45:25 -05:00
|
|
|
|
|
|
|
|
install -d $(PREFIX)/share/man/man1
|
2015-03-13 11:47:56 -05:00
|
|
|
install -m 644 $(basename $(MANPAGES_MD)) $(PREFIX)/share/man/man1
|
2015-07-10 16:16:28 -04:00
|
|
|
|
2015-09-01 08:11:34 -04:00
|
|
|
echo ".so man1/atomic-push.1" > $(PREFIX)/share/man/man1/atomic-upload.1
|
2015-11-11 12:56:28 +01:00
|
|
|
|
2016-02-25 17:07:24 -06:00
|
|
|
install -m 644 atomic.conf $(DESTDIR)/etc
|
|
|
|
|
|
|
|
|
|
install -d $(DESTDIR)/etc/atomic.d
|
|
|
|
|
|
2015-11-11 12:56:28 +01:00
|
|
|
.PHONY: install
|
|
|
|
|
install: all install-only
|
2016-05-11 09:16:01 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: install-openscap
|
|
|
|
|
install-openscap:
|
|
|
|
|
install -m 644 atomic.d/openscap $(DESTDIR)/etc/atomic.d
|
2016-10-27 13:51:15 -05:00
|
|
|
|
|
|
|
|
.PHONY: vagrant-check
|
|
|
|
|
vagrant-check:
|
|
|
|
|
BOX=$(BOX) sh ./vagrant.sh
|
2017-01-30 13:23:59 -06:00
|
|
|
|
|
|
|
|
.PHONY: install-on-atomicos
|
|
|
|
|
install-on-atomicos:
|
2017-08-23 17:21:07 +00:00
|
|
|
NO_TEST=1 sh ./.papr.sh
|