glpi / Makefile @ 6ef95d06
History | View | Annotate | Download (3.01 KB)
1 | 75e60ab7 | Francois POIROTTE | NAME = glpi |
---|---|---|---|
2 | a165d451 | Francois POIROTTE | php := $(shell which php) |
3 | 75e60ab7 | Francois POIROTTE | |
4 | all: |
||
5 | |||
6 | include buildenv/Makefile.common.nopython |
||
7 | |||
8 | 5256c457 | Francois POIROTTE | install: install_base install_data install_permissions |
9 | 75e60ab7 | Francois POIROTTE | |
10 | 5256c457 | Francois POIROTTE | 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 | 92b19eed | Francois POIROTTE | mkdir -p $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/hlservices/managed |
17 | 166be9d2 | Francois POIROTTE | cp -pr src/plugins/vigilo $(DESTDIR)$(DATADIR)/$(NAME)/plugins/ |
18 | 75e60ab7 | Francois POIROTTE | |
19 | 5256c457 | Francois POIROTTE | 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 | 92b19eed | Francois POIROTTE | chown vigiconf:apache $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/hlservices/managed |
30 | 5256c457 | Francois POIROTTE | chmod 0770 $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/groups/managed |
31 | chown 0770 $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/hosts/managed |
||
32 | 92b19eed | Francois POIROTTE | chown 0770 $(DESTDIR)$(SYSCONFDIR)/vigilo/vigiconf/conf.d/hlservices/managed |
33 | 5256c457 | Francois POIROTTE | |
34 | 75e60ab7 | Francois POIROTTE | clean: clean_common |
35 | |||
36 | a165d451 | Francois POIROTTE | serve: |
37 | $(php) -S 0.0.0.0:8080 -t src |
||
38 | |||
39 | 945f4815 | Francois POIROTTE | # 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 | a68b0db7 | Francois POIROTTE | tests doc apidoc: |
73 | |||
74 | .PHONY: all install install_pkg install_base install_data install_permissions \ |
||
75 | clean man doc serve tests doc apidoc \ |
||
76 | 945f4815 | Francois POIROTTE | i18n extract_messages update_catalog identity_catalog compile_catalog |