forked from jlebon/atomic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (46 loc) · 1.69 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Installation directories.
PREFIX ?= $(DESTDIR)/usr
SYSCONFDIR ?= $(DESTDIR)/etc/sysconfig
PROFILEDIR ?= $(DESTDIR)/etc/profile.d
PYTHON ?= /usr/bin/python
PYLINT ?= /usr/bin/pylint
GO_MD2MAN ?= /usr/bin/go-md2man
PYTHONSITELIB=$(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(0))")
VERSION=$(shell $(PYTHON) setup.py --version)
.PHONY: all
all: python-build docs pylint-check
.PHONY: test
test:
./test.sh
.PHONY: python-build
python-build:
$(PYTHON) setup.py build
.PHONY: pylint-check
pylint-check:
$(PYLINT) -E --additional-builtins=_ *.py atomic Atomic tests/unit/*.py
MANPAGES_MD = $(wildcard docs/*.md)
docs/%.1: docs/%.1.md
.PHONY: docs
docs: $(MANPAGES_MD:%.md=%)
.PHONY: clean
clean:
$(PYTHON) setup.py clean
-rm -rf dist build *~ \#* *pyc .#* docs/*.1
.PHONY: install-only
install-only:
$(PYTHON) setup.py install --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
.PHONY: install
install: all install-only