Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigigraph / Makefile @ cc774053

History | View | Annotate | Download (2.06 KB)

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