Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigigraph / Makefile @ 0158c6f0

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