vigigraph / Makefile @ c1c106e4
History | View | Annotate | Download (2.03 KB)
1 |
NAME := vigigraph |
---|---|
2 |
|
3 |
SUBST_FILES := deployment/logrotate.conf deployment/settings.ini \ |
4 |
deployment/vigigraph.conf deployment/vigigraph.wsgi |
5 |
|
6 |
all: build |
7 |
build: $(SUBST_FILES) |
8 |
|
9 |
include buildenv/Makefile.common |
10 |
MODULE := $(NAME) |
11 |
EPYDOC_PARSE := vigigraph\.controllers |
12 |
|
13 |
deployment/%: deployment/%.in |
14 |
sed -e 's,@SYSCONFDIR@,$(SYSCONFDIR),g' \ |
15 |
-e 's,@LOCALSTATEDIR@,$(LOCALSTATEDIR),g' $^ > $@ |
16 |
|
17 |
install: build install_python install_data |
18 |
install_pkg: build install_python_pkg install_data |
19 |
|
20 |
install_python: $(PYTHON) $(SUBST_FILES) |
21 |
$(PYTHON) setup.py install --record=INSTALLED_FILES |
22 |
install_python_pkg: $(PYTHON) |
23 |
$(PYTHON) setup.py install --single-version-externally-managed --root=$(DESTDIR) --record=INSTALLED_FILES |
24 |
|
25 |
install_data: $(SUBST_FILES) |
26 |
# Permissions de la conf |
27 |
chmod a+rX -R $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME) |
28 |
[ `id -u` -ne 0 ] || chgrp $(HTTPD_USER) $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/*.ini |
29 |
chmod 640 $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/*.ini |
30 |
# Apache |
31 |
mkdir -p $(DESTDIR)$(HTTPD_DIR) |
32 |
ln -f -s $(SYSCONFDIR)/vigilo/$(NAME)/$(NAME).conf $(DESTDIR)$(HTTPD_DIR)/ |
33 |
echo $(HTTPD_DIR)/$(NAME).conf >> INSTALLED_FILES |
34 |
mkdir -p $(DESTDIR)$(LOCALSTATEDIR)/log/vigilo/$(NAME) |
35 |
[ `id -u` -ne 0 ] || chown $(HTTPD_USER): $(DESTDIR)$(LOCALSTATEDIR)/log/vigilo/$(NAME) |
36 |
install -m 644 -p -D deployment/logrotate.conf $(DESTDIR)/etc/logrotate.d/$(NAME) |
37 |
# 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 |
# 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 |
|
46 |
lint: lint_pylint |
47 |
tests: tests_nose |
48 |
doc: apidoc |
49 |
clean: clean_python |
50 |
rm -f $(SUBST_FILES) |
51 |
|
52 |
.PHONY: install_pkg install_python install_python_pkg install_data |