Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigigraph / Makefile @ d1d3e7f2

History | View | Annotate | Download (2.13 KB)

1 0931fc44 Thomas BURGUIERE
NAME := vigigraph
2 2f5d4f00 Aurelien BOMPARD
3 df05a1cf Francois POIROTTE
SUBST_FILES := \
4
	deployment/logrotate.conf \
5
	deployment/settings.ini   \
6
	deployment/vigigraph.conf \
7
	deployment/vigigraph.wsgi
8 9996920f Aurelien BOMPARD
9 7c9baa43 Francois POIROTTE
all: build
10 9996920f Aurelien BOMPARD
build: $(SUBST_FILES)
11 2f5d4f00 Aurelien BOMPARD
12 c472fc59 Aurelien BOMPARD
include buildenv/Makefile.common.python
13 b444f1f7 Aurelien BOMPARD
MODULE := $(NAME)
14 1f21c892 Aurelien BOMPARD
EPYDOC_PARSE := vigigraph\.controllers
15 a3e33eb1 Aurelien BOMPARD
JSFILES = vigigraph/public/js
16 b444f1f7 Aurelien BOMPARD
17 9996920f Aurelien BOMPARD
deployment/%: deployment/%.in
18
	sed -e 's,@SYSCONFDIR@,$(SYSCONFDIR),g' \
19 df05a1cf Francois POIROTTE
	    -e 's,@HTTPD_USER@,$(HTTPD_USER),g' \
20 ed1418f0 Thomas BURGUIERE
	    -e 's,@LOCALSTATEDIR@,$(LOCALSTATEDIR),g' $^ > $@
21 9996920f Aurelien BOMPARD
22 c19f786a Aurelien BOMPARD
install: build install_python install_data
23 3751b6ce Aurelien BOMPARD
install_pkg: build install_python_pkg install_data
24 3ba7282b Aurelien BOMPARD
25 9996920f Aurelien BOMPARD
install_python: $(PYTHON) $(SUBST_FILES)
26 5627afd6 Aurelien BOMPARD
	$(PYTHON) setup.py install --record=INSTALLED_FILES
27 3ba7282b Aurelien BOMPARD
install_python_pkg: $(PYTHON)
28 0f317fa6 Aurelien BOMPARD
	$(PYTHON) setup.py install --single-version-externally-managed --root=$(DESTDIR) --record=INSTALLED_FILES
29 3ba7282b Aurelien BOMPARD
30 9996920f Aurelien BOMPARD
install_data: $(SUBST_FILES)
31 53bdf40e Aurelien BOMPARD
	# Permissions de la conf
32
	chmod a+rX -R $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)
33 9cd0325e Aurelien BOMPARD
	[ `id -u` -ne 0 ] || chgrp $(HTTPD_USER) $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/*.ini
34 9996920f Aurelien BOMPARD
	chmod 640 $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/*.ini
35 97b58008 Aurelien BOMPARD
	# Apache
36 0f317fa6 Aurelien BOMPARD
	mkdir -p $(DESTDIR)$(HTTPD_DIR)
37 af425723 Aurelien BOMPARD
	ln -f -s $(SYSCONFDIR)/vigilo/$(NAME)/$(NAME).conf $(DESTDIR)$(HTTPD_DIR)/$(PKGNAME).conf
38
	echo $(HTTPD_DIR)/$(PKGNAME).conf >> INSTALLED_FILES
39 9996920f Aurelien BOMPARD
	mkdir -p $(DESTDIR)$(LOCALSTATEDIR)/log/vigilo/$(NAME)
40 20422c44 Aurelien BOMPARD
	[ `id -u` -ne 0 ] || chown $(HTTPD_USER): $(DESTDIR)$(LOCALSTATEDIR)/log/vigilo/$(NAME)
41 af425723 Aurelien BOMPARD
	install -m 644 -p -D deployment/logrotate.conf $(DESTDIR)/etc/logrotate.d/$(PKGNAME)
42 db10526c 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 bb3d9eb7 Aurelien BOMPARD
	# Cache
47
	mkdir -p $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions
48
	chmod 750 $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions
49
	[ `id -u` -ne 0 ] || chown $(HTTPD_USER): $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions
50 0f317fa6 Aurelien BOMPARD
51 0931fc44 Thomas BURGUIERE
lint: lint_pylint
52 4c964d96 Aurelien BOMPARD
tests: tests_nose
53 101a8e79 Francois POIROTTE
doc: apidoc sphinxdoc
54 7c9baa43 Francois POIROTTE
clean: clean_python
55 9996920f Aurelien BOMPARD
	rm -f $(SUBST_FILES)
56 3ba7282b Aurelien BOMPARD
57
.PHONY: install_pkg install_python install_python_pkg install_data