glpi / Makefile @ 09aac931
History | View | Annotate | Download (3.05 KB)
1 |
NAME = glpi |
---|---|
2 |
php := $(shell which php) |
3 |
|
4 |
all: |
5 |
|
6 |
include buildenv/Makefile.common.nopython |
7 |
|
8 |
install: install_base install_data install_permissions |
9 |
|
10 |
install_pkg: install_base install_data |
11 |
|
12 |
install_base: $(INFILES) |
13 |
mkdir -p $(DESTDIR)$(DATADIR)/$(NAME)/plugins/ |
14 |
mkdir -p $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/groups/managed |
15 |
mkdir -p $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/hosts/managed |
16 |
mkdir -p $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/hlservices/managed |
17 |
cp -pr src/plugins/vigilo $(DESTDIR)$(DATADIR)/$(NAME)/plugins/ |
18 |
|
19 |
install_data: pkg/init pkg/sudoers |
20 |
install -p -m 755 -D pkg/init $(DESTDIR)$(INITDIR)/$(PKGNAME) |
21 |
install -p -m 644 -D pkg/sudoers $(DESTDIR)$(SYSCONFDIR)/sudoers.d/$(PKGNAME) |
22 |
|
23 |
install_permissions: |
24 |
-/usr/sbin/usermod -a -G apache vigiconf |
25 |
chown root:root $(DESTDIR)$(INITDIR)/$(PKGNAME) |
26 |
chown root:root $(DESTDIR)$(SYSCONFDIR)/sudoers.d/$(PKGNAME) |
27 |
chown vigiconf:apache $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/groups/managed |
28 |
chown vigiconf:apache $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/hosts/managed |
29 |
chown vigiconf:apache $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/hlservices/managed |
30 |
chmod 0770 $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/groups/managed |
31 |
chown 0770 $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/hosts/managed |
32 |
chown 0770 $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/hlservices/managed |
33 |
|
34 |
clean: clean_common |
35 |
|
36 |
serve: |
37 |
$(php) -S 0.0.0.0:8080 -t src |
38 |
|
39 |
# Internationalisation |
40 |
i18n: extract_messages identity_catalog update_catalog compile_catalog |
41 |
|
42 |
extract_messages: |
43 |
find src/plugins/vigilo/ -name '*.php' | \ |
44 |
xargs xgettext --keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t \ |
45 |
--keyword=_e:1,2t --keyword=_x:1c,2,3t --keyword=_ex:1c,2,3t \ |
46 |
--keyword=_nx:1c,2,3,5t --keyword=_sx:1c,2,3t \ |
47 |
-L PHP --from-code=utf-8 \ |
48 |
-o src/plugins/vigilo/locales/glpi.pot\ |
49 |
--force-po --escape --strict --sort-output \ |
50 |
--add-comments=TRANSLATOR --copyright-holder=CSSI \ |
51 |
--package-name="Vigilo NMS" --foreign-user \ |
52 |
--msgid-bugs-address=contact.vigilo@c-s.fr |
53 |
|
54 |
init_catalog: extract_messages |
55 |
msginit --no-translator -i src/plugins/vigilo/locales/glpi.pot --locale="$(LANG).UTF-8" -o "src/plugins/vigilo/locales/$(LANG).po" |
56 |
|
57 |
update_catalog: extract_messages |
58 |
for po in `find src/plugins/vigilo/locales/ -name '*.po'`; do \ |
59 |
touch $$po; \ |
60 |
msgmerge -N -i -s -o "$$po" "$$po" src/plugins/vigilo/locales/glpi.pot; \ |
61 |
done |
62 |
|
63 |
identity_catalog: extract_messages |
64 |
$(MAKE) init_catalog LANG=en_GB |
65 |
|
66 |
compile_catalog: update_catalog |
67 |
for lang in `find src/plugins/vigilo/locales/ -name '*.po'`; do \ |
68 |
lang=`basename "$$lang" .po`; \ |
69 |
echo -n "$$lang : " && msgfmt --statistics -o "src/plugins/vigilo/locales/$$lang.mo" "src/plugins/vigilo/locales/$$lang.po"; \ |
70 |
done |
71 |
|
72 |
tests: |
73 |
composer update |
74 |
vendor/bin/phpcs |
75 |
|
76 |
doc apidoc: |
77 |
|
78 |
.PHONY: all install install_pkg install_base install_data install_permissions \ |
79 |
clean man doc serve tests doc apidoc \ |
80 |
i18n extract_messages update_catalog identity_catalog compile_catalog |