summaryrefslogtreecommitdiff
path: root/Makefile
blob: c4fa67801b81910c56825f9d72adf309b8dfeaa8 (plain)
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
PYTHON ?= python
VERSION = $(shell cat VERSION)
TAGVER = $(shell cat VERSION | sed -e "s/\([0-9\.]*\).*/\1/")

PKGNAME = micng

PLUGIN_DIR = /usr/lib/micng/plugins

ifeq ($(VERSION), $(TAGVER))
	TAG = $(TAGVER)
else
	TAG = "HEAD"
endif

ifndef PREFIX
    PREFIX = "/usr/local"
endif

all:
	$(PYTHON) setup.py build

dist-bz2:
	git archive --format=tar --prefix=$(PKGNAME)-$(TAGVER)/ $(TAG) | \
		bzip2  > $(PKGNAME)-$(TAGVER).tar.bz2

dist-gz:
	git archive --format=tar --prefix=$(PKGNAME)-$(TAGVER)/ $(TAG) | \
		gzip  > $(PKGNAME)-$(TAGVER).tar.gz

install-plugins:
	install -d ${DESTDIR}/${PLUGIN_DIR}
	install -D -m 644 plugins/imager/* ${DESTDIR}/${PLUGIN_DIR}/imager
	install -D -m 644 plugins/backend/* ${DESTDIR}/${PLUGIN_DIR}/backend

install: all install-plugins
	$(PYTHON) setup.py install  --prefix=$(DESTDIR)/$(PREFIX)

develop: all
	$(PYTHON) setup.py develop

clean:
	rm -f tools/*.py[co]
	rm -rf *.egg-info
	rm -rf build/
	rm -rf dist/