Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigigraph / Makefile @ 23899999

History | View | Annotate | Download (2.15 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 1ff8c312 Francois POIROTTE
	$(PYTHON) setup.py install --single-version-externally-managed \
29
		$(SETUP_PY_OPTS) --root=$(DESTDIR) --record=INSTALLED_FILES
30 3ba7282b Aurelien BOMPARD
31 9996920f Aurelien BOMPARD
install_data: $(SUBST_FILES)
32 53bdf40e Aurelien BOMPARD
	# Permissions de la conf
33
	chmod a+rX -R $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)
34 9cd0325e Aurelien BOMPARD
	[ `id -u` -ne 0 ] || chgrp $(HTTPD_USER) $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/*.ini
35 9996920f Aurelien BOMPARD
	chmod 640 $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/*.ini
36 97b58008 Aurelien BOMPARD
	# Apache
37 0f317fa6 Aurelien BOMPARD
	mkdir -p $(DESTDIR)$(HTTPD_DIR)
38 af425723 Aurelien BOMPARD
	ln -f -s $(SYSCONFDIR)/vigilo/$(NAME)/$(NAME).conf $(DESTDIR)$(HTTPD_DIR)/$(PKGNAME).conf
39
	echo $(HTTPD_DIR)/$(PKGNAME).conf >> INSTALLED_FILES
40 9996920f Aurelien BOMPARD
	mkdir -p $(DESTDIR)$(LOCALSTATEDIR)/log/vigilo/$(NAME)
41 20422c44 Aurelien BOMPARD
	[ `id -u` -ne 0 ] || chown $(HTTPD_USER): $(DESTDIR)$(LOCALSTATEDIR)/log/vigilo/$(NAME)
42 af425723 Aurelien BOMPARD
	install -m 644 -p -D deployment/logrotate.conf $(DESTDIR)/etc/logrotate.d/$(PKGNAME)
43 db10526c Aurelien BOMPARD
	# Déplacement du app_cfg.py
44
	mv $(DESTDIR)`grep '$(NAME)/config/app_cfg.py$$' INSTALLED_FILES` $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/
45
	ln -s $(SYSCONFDIR)/vigilo/$(NAME)/app_cfg.py $(DESTDIR)`grep '$(NAME)/config/app_cfg.py$$' INSTALLED_FILES`
46
	echo $(SYSCONFDIR)/vigilo/$(NAME)/app_cfg.py >> INSTALLED_FILES
47 bb3d9eb7 Aurelien BOMPARD
	# Cache
48
	mkdir -p $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions
49
	chmod 750 $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions
50
	[ `id -u` -ne 0 ] || chown $(HTTPD_USER): $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions
51 0f317fa6 Aurelien BOMPARD
52 0931fc44 Thomas BURGUIERE
lint: lint_pylint
53 4c964d96 Aurelien BOMPARD
tests: tests_nose
54 101a8e79 Francois POIROTTE
doc: apidoc sphinxdoc
55 7c9baa43 Francois POIROTTE
clean: clean_python
56 9996920f Aurelien BOMPARD
	rm -f $(SUBST_FILES)
57 3ba7282b Aurelien BOMPARD
58
.PHONY: install_pkg install_python install_python_pkg install_data