vigiboard / Makefile @ 4ab73308
History | View | Annotate | Download (2.32 KB)
1 |
NAME := vigiboard |
---|---|
2 |
|
3 |
SUBST_FILES := \ |
4 |
deployment/logrotate.conf \ |
5 |
deployment/settings.ini \ |
6 |
deployment/vigiboard.conf \ |
7 |
deployment/vigiboard.wsgi \ |
8 |
pkg/vigilo-vigiboard.sh |
9 |
|
10 |
all: build |
11 |
build: $(SUBST_FILES) |
12 |
|
13 |
include buildenv/Makefile.common.python |
14 |
MODULE := $(NAME) |
15 |
EPYDOC_PARSE := vigiboard\.(widgets|controllers|tests) |
16 |
JSFILES = vigiboard/public/js |
17 |
|
18 |
deployment/%: deployment/%.in |
19 |
sed -e 's,@SYSCONFDIR@,$(SYSCONFDIR),g' \ |
20 |
-e 's,@HTTPD_USER@,$(HTTPD_USER),g' \ |
21 |
-e 's,@NAGIOS_BIN@,$(NAGIOS_BIN),g' \ |
22 |
-e 's,@LOCALSTATEDIR@,$(LOCALSTATEDIR),g' $^ > $@ |
23 |
|
24 |
pkg/vigilo-vigiboard.sh: pkg/vigilo-vigiboard.sh.in |
25 |
sed -e 's,@INITCONFDIR@,$(INITCONFDIR),g' \ |
26 |
-e 's,@BINDIR@,$(BINDIR),g' $^ > $@ |
27 |
|
28 |
install: build install_python install_data |
29 |
install_pkg: build install_python_pkg install_data |
30 |
|
31 |
install_python: $(PYTHON) $(SUBST_FILES) |
32 |
$(PYTHON) setup.py install --record=INSTALLED_FILES |
33 |
install_python_pkg: $(PYTHON) $(SUBST_FILES) |
34 |
$(PYTHON) setup.py install --single-version-externally-managed \ |
35 |
$(SETUP_PY_OPTS) --root=$(DESTDIR) --record=INSTALLED_FILES |
36 |
|
37 |
install_data: $(SUBST_FILES) |
38 |
# Configuration de la tâche cron. |
39 |
install -p -m 644 -D pkg/initconf $(DESTDIR)$(INITCONFDIR)/$(PKGNAME) |
40 |
echo $(INITCONFDIR)/$(PKGNAME) >> INSTALLED_FILES |
41 |
# Permissions de la conf |
42 |
chmod a+rX -R $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME) |
43 |
[ `id -u` -ne 0 ] || chgrp $(HTTPD_USER) $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/*.ini |
44 |
chmod 640 $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/*.ini |
45 |
# Apache |
46 |
mkdir -p $(DESTDIR)$(HTTPD_DIR) |
47 |
ln -f -s $(SYSCONFDIR)/vigilo/$(NAME)/$(NAME).conf $(DESTDIR)$(HTTPD_DIR)/$(PKGNAME).conf |
48 |
echo $(HTTPD_DIR)/$(PKGNAME).conf >> INSTALLED_FILES |
49 |
mkdir -p $(DESTDIR)$(LOCALSTATEDIR)/log/vigilo/$(NAME) |
50 |
[ `id -u` -ne 0 ] || chown $(HTTPD_USER): $(DESTDIR)$(LOCALSTATEDIR)/log/vigilo/$(NAME) |
51 |
install -m 644 -p -D deployment/logrotate.conf $(DESTDIR)/etc/logrotate.d/$(PKGNAME) |
52 |
# Installation du app_cfg.py |
53 |
install -m 644 -p app_cfg.py $(DESTDIR)$(SYSCONFDIR)/vigilo/$(NAME)/ |
54 |
# Cache |
55 |
mkdir -p $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions |
56 |
chmod 750 $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions |
57 |
[ `id -u` -ne 0 ] || chown $(HTTPD_USER): $(DESTDIR)$(LOCALSTATEDIR)/cache/vigilo/sessions |
58 |
|
59 |
|
60 |
lint: lint_pylint |
61 |
tests: tests_nose |
62 |
doc: apidoc |
63 |
clean: clean_python |
64 |
rm -f $(SUBST_FILES) |
65 |
|
66 |
.PHONY: install_pkg install_python install_python_pkg install_data |