-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (49 loc) · 1.98 KB
/
Makefile
File metadata and controls
64 lines (49 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
NAME := vigiconf
all: build
include buildenv/Makefile.common.python
CONFDIR := $(SYSCONFDIR)/vigilo/$(NAME)
VARDIR := $(LOCALSTATEDIR)/lib/vigilo/$(NAME)
VIGICONFPATH = $(dir $(shell PYTHONPATH=$(DESTDIR)$(PYTHON_SITELIB) python -c 'import vigilo.vigiconf; print vigilo.vigiconf.__file__'))
INFILES = pkg/$(PKGNAME)$(CRONEXT) settings.ini
build: $(INFILES)
pkg/$(PKGNAME)$(CRONEXT): pkg/cronjobs.in
sed -e 's,@BINDIR@,$(PREFIX)/bin,' $^ > $@
settings.ini: settings.ini.in
sed -e 's,@LOCALSTATEDIR@,$(LOCALSTATEDIR),;s,@SYSCONFDIR@,$(SYSCONFDIR),g' \
$^ > $@
install: build install_python install_users install_permissions
install_pkg: build install_python_pkg
install_python: settings.ini $(PYTHON)
CRONEXT=$(CRONEXT) $(PYTHON) setup.py install --record=INSTALLED_FILES
install_python_pkg: settings.ini $(PYTHON)
CRONEXT=$(CRONEXT) $(PYTHON) setup.py install --single-version-externally-managed \
$(SETUP_PY_OPTS) --root=$(DESTDIR)
install_users:
@echo "Creating the $(NAME) user..."
-/usr/sbin/groupadd $(NAME)
-/usr/sbin/useradd -s /bin/bash -M -d $(VARDIR) -g $(NAME) -c 'Vigilo VigiConf user' $(NAME)
install_permissions:
chmod 755 $(DESTDIR)$(VARDIR)
chown -R $(NAME):$(NAME) $(DESTDIR)$(VARDIR)
# Les autres utilisateurs du groupe peuvent prendre le verrou (cf. #1108).
chmod 775 $(DESTDIR)$(LOCALSTATEDIR)/lock/subsys/$(PKGNAME)
chown -R $(NAME):$(NAME) $(DESTDIR)$(LOCALSTATEDIR)/lock/subsys/$(PKGNAME)
chown -R $(NAME):$(NAME) $(DESTDIR)$(CONFDIR)
chmod 755 $(DESTDIR)$(VIGICONFPATH)/applications/*/*.sh
lint: lint_pylint
tests: tests_nose
doc: apidoc sphinxdoc
clean: clean_python
rm -f $(INFILES)
prepare_sphinxdoc: bin/vigilo-autodoc
bin/vigilo-autodoc doc/autodoc.py
sphinxdoc_html: bin/python prepare_sphinxdoc
sphinxdoc_pdf: bin/python prepare_sphinxdoc
.PHONY: \
all build clean \
install install_users install_permissions \
install_pkg install_python install_python_pkg \
tests lint \
doc apidoc \
prepare_sphinxdoc sphinxdoc_html sphinxdoc_pdf \
# vim: set noexpandtab :