Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / Makefile @ d05904a2

History | View | Annotate | Download (2.16 KB)

1 d7540235 Aurelien BOMPARD
NAME := vigiboard
2 f299be9c Aurelien BOMPARD
3 d05904a2 Francois POIROTTE
SUBST_FILES := \
4
	deployment/logrotate.conf \
5
	deployment/settings.ini   \
6
	deployment/vigiboard.conf \
7
	deployment/vigiboard.wsgi
8 f299be9c Aurelien BOMPARD
9 536ea51c Aurelien BOMPARD
all: build
10 f299be9c Aurelien BOMPARD
build: $(SUBST_FILES)
11 536ea51c Aurelien BOMPARD
12 97bb9169 Aurelien BOMPARD
include buildenv/Makefile.common.python
13 70209762 Aurelien BOMPARD
MODULE := $(NAME)
14 dc005588 Francois POIROTTE
EPYDOC_PARSE := vigiboard\.(widgets|controllers|tests)
15 12a23194 Aurelien BOMPARD
JSFILES = vigiboard/public/js
16 70209762 Aurelien BOMPARD
17 f299be9c Aurelien BOMPARD
deployment/%: deployment/%.in
18
	sed -e 's,@SYSCONFDIR@,$(SYSCONFDIR),g' \
19 d05904a2 Francois POIROTTE
	    -e 's,@HTTPD_USER@,$(HTTPD_USER),g' \
20
	    -e 's,@LOCALSTATEDIR@,$(LOCALSTATEDIR),g' $^ > $@
21 f299be9c Aurelien BOMPARD
22 809955f3 Aurelien BOMPARD
install: build install_python install_data
23
install_pkg: build install_python_pkg install_data
24 b8e1cd40 Aurelien BOMPARD
25 f299be9c Aurelien BOMPARD
install_python: $(PYTHON) $(SUBST_FILES)
26 db58b89e Aurelien BOMPARD
	$(PYTHON) setup.py install --record=INSTALLED_FILES
27 f299be9c Aurelien BOMPARD
install_python_pkg: $(PYTHON) $(SUBST_FILES)
28 a43ec272 Aurelien BOMPARD
	$(PYTHON) setup.py install --single-version-externally-managed --root=$(DESTDIR) --record=INSTALLED_FILES
29 b8e1cd40 Aurelien BOMPARD
30 f299be9c Aurelien BOMPARD
install_data: $(SUBST_FILES)
31 64ef5a71 Aurelien BOMPARD
	# Permissions de la conf
32
	chmod a+rX -R $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)
33 acb0dfad Aurelien BOMPARD
	[ `id -u` -ne 0 ] || chgrp $(HTTPD_USER) $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/*.ini
34 64ef5a71 Aurelien BOMPARD
	chmod 640 $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/*.ini
35 fd3d2299 Aurelien BOMPARD
	# Apache
36 a43ec272 Aurelien BOMPARD
	mkdir -p $(DESTDIR)$(HTTPD_DIR)
37 99bd4776 Aurelien BOMPARD
	ln -f -s $(SYSCONFDIR)/vigilo/$(NAME)/$(NAME).conf $(DESTDIR)$(HTTPD_DIR)/$(PKGNAME).conf
38
	echo $(HTTPD_DIR)/$(PKGNAME).conf >> INSTALLED_FILES
39 64ef5a71 Aurelien BOMPARD
	mkdir -p $(DESTDIR)$(LOCALSTATEDIR)/log/vigilo/$(NAME)
40 6e77380f Aurelien BOMPARD
	[ `id -u` -ne 0 ] || chown $(HTTPD_USER): $(DESTDIR)$(LOCALSTATEDIR)/log/vigilo/$(NAME)
41 99bd4776 Aurelien BOMPARD
	install -m 644 -p -D deployment/logrotate.conf $(DESTDIR)/etc/logrotate.d/$(PKGNAME)
42 88f37dd7 Aurelien BOMPARD
	# Déplacement du app_cfg.py
43
	mv $(DESTDIR)`grep '$(NAME)/config/app_cfg.py$$' INSTALLED_FILES` $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/
44
	ln -s $(SYSCONFDIR)/vigilo/$(NAME)/app_cfg.py $(DESTDIR)`grep '$(NAME)/config/app_cfg.py$$' INSTALLED_FILES`
45
	echo $(SYSCONFDIR)/vigilo/$(NAME)/app_cfg.py >> INSTALLED_FILES
46 64ef5a71 Aurelien BOMPARD
	# Cache
47
	mkdir -p $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions
48
	chmod 750 $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions
49 119ddf4c Aurelien BOMPARD
	[ `id -u` -ne 0 ] || chown $(HTTPD_USER): $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions
50 f913c9d3 Thomas BURGUIERE
51 a43ec272 Aurelien BOMPARD
52 858d88aa Francois POIROTTE
53 d7540235 Aurelien BOMPARD
lint: lint_pylint
54 c6e2f817 Aurelien BOMPARD
tests: tests_nose
55 37f38cfa Aurelien BOMPARD
doc: apidoc
56 536ea51c Aurelien BOMPARD
clean: clean_python
57 f299be9c Aurelien BOMPARD
	rm -f $(SUBST_FILES)
58 b8e1cd40 Aurelien BOMPARD
59
.PHONY: install_pkg install_python install_python_pkg install_data