1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-06 12:45:57 +01:00
Files
atomic/Makefile

102 lines
2.8 KiB
Makefile
Raw Permalink Normal View History

# Installation directories.
PREFIX ?= $(DESTDIR)/usr
SYSCONFDIR ?= $(DESTDIR)/etc/sysconfig
PROFILEDIR ?= $(DESTDIR)/etc/profile.d
export PYTHON ?= /usr/bin/python
export PYTHON3 ?= /usr/bin/python3
PYLINT ?= $(PYTHON) -m pylint
PYTHON3_PYLINT ?= $(PYTHON3) -m pylint
GO_MD2MAN ?= /usr/bin/go-md2man
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))")
VERSION=$(shell $(PYTHON) setup.py --version)
export GOPATH = $(shell pwd)/godeps
BOX="fedora_atomic"
.PHONY: all
all: python-build docs pylint-check gotar
.PHONY: test-python3-pylint
test-python3-pylint:
$(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
.PHONY: test check test-suite
check: test
test-suite:
./test.sh
test: all test-python3-pylint test-suite
test-destructive: all
ENABLE_DESTRUCTIVE=1 ./test.sh
.PHONY: python-build
python-build:
$(PYTHON) setup.py build
.PHONY: pylint-check
pylint-check:
$(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
MANPAGES_MD = $(wildcard docs/*.md)
docs/%.1: docs/%.1.md
$(GO_MD2MAN) -in $< -out $@.tmp && touch $@.tmp && mv $@.tmp $@
.PHONY: docs
docs: $(MANPAGES_MD:%.md=%)
gotar: gotar.go
$(GO) build -o $@ $<
.PHONY: clean
clean:
$(PYTHON) setup.py clean
-rm -rf dist build *~ \#* *pyc .#* docs/*.1
rm -fr build
.PHONY: install-only
install-only:
$(PYTHON) setup.py install --prefix=/usr --install-scripts /usr/share/atomic `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
(cd $(DESTDIR)/$(PYTHONSITELIB) && rm -f atomic-$(VERSION)-*egg-info)
install -d -m 0755 $(DESTDIR)/usr/bin
ln -fs ../share/atomic/atomic $(DESTDIR)/usr/bin/atomic
install -d -m 0755 $(DESTDIR)/usr/libexec/atomic
install -m 0755 migrate.sh gotar $(DESTDIR)/usr/libexec/atomic
[ -d $(SYSCONFDIR) ] || mkdir -p $(SYSCONFDIR)
install -m 644 atomic.sysconfig $(SYSCONFDIR)/atomic
[ -d $(PROFILEDIR) ] || mkdir -p $(PROFILEDIR)
install -m 644 atomic.sh $(PROFILEDIR)
install -d $(PREFIX)/share/man/man1
install -m 644 $(basename $(MANPAGES_MD)) $(PREFIX)/share/man/man1
echo ".so man1/atomic-push.1" > $(PREFIX)/share/man/man1/atomic-upload.1
install -m 644 atomic.conf $(DESTDIR)/etc
install -d $(DESTDIR)/etc/atomic.d
.PHONY: install
install: all install-only
.PHONY: install-openscap
install-openscap:
install -m 644 atomic.d/openscap $(DESTDIR)/etc/atomic.d
.PHONY: vagrant-check
vagrant-check:
BOX=$(BOX) sh ./vagrant.sh
.PHONY: install-on-atomicos
install-on-atomicos:
Fix tests for f26 Fix test failures after updating papr to test with f26 atomic/cloud images instead of f25, with the following changes: 1. Remove dependency on docker hub tester image. Instead, mimic what ostree/rpm-ostree does and use a recursive .papr.sh script to install the necessary packages to the base f26 image in the fedora registry. This fixes tests on the atomic host since python3.6 is being used, and prevents future tests from testing the wrong version. (Note this is slightly slower due to having to install packages during the test rather than using a pre-built image). 2. Fix some pylint errors, and mask others for now 3. Fix failing integration tests due to inter-test interference 4. Remove unnecessary deepcopy in container filter 5. Add compatibility for both c-s-s and d-s-s in storage 6. Update expected sha256 values for dockertar test Remaining issues: 1. test_storage should possibly be reworked. The current test setup is conflicting with the new default of overlay as a driver. For now, the test for generated d-s-s is disabled. 2. some storage commands are still using "docker-storage-setup" instead of "container-storage-setup". There is a backward compatible check in place that should be reworked in the future 3. some masked pylint errors should be further investigated 4. keep the dockerfile for the project atomic tester image for now (bump to 26), since its a little easier and faster to set up with Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com> Closes: #1076 Approved by: baude
2017-08-23 17:21:07 +00:00
NO_TEST=1 sh ./.papr.sh