]>
git.ipfire.org Git - collecty.git/blob - Makefile
1 ###############################################################################
3 # collecty - A system statistics collection daemon for IPFire #
4 # Copyright (C) 2012 IPFire development team #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 ###############################################################################
21 PACKAGE_NAME
= collecty
22 PACKAGE_VERSION
= 0.0.1
26 BINDIR
= $(PREFIX
)/bin
27 LOCALEDIR
= $(PREFIX
)/share
/locale
28 UNITDIR
= $(PREFIX
)/lib
/systemd
/system
30 PYTHON_VER
:= $(shell python
-c
"import platform; print '.'.join(platform.python_version_tuple()[:2])")
31 PYTHON_DIR
= $(DESTDIR
)/usr
/lib
/python
$(PYTHON_VER
)/site-packages
/
36 # A list of all files that need translation
37 TRANSLATION_FILES
= $(shell find collecty
-type f
-name
"*.py") collectyd
39 POT_FILE
= po
/$(PACKAGE_NAME
).pot
40 PO_FILES
= $(wildcard po
/*.po
)
41 MO_FILES
= $(patsubst %.po
,%.mo
,$(PO_FILES
))
51 git archive
--format
=tar --prefix=$(NAME
)-$(VERSION
)/ HEAD | gzip
-9 \
52 > $(NAME
)-$(VERSION
).
tar.gz
56 -mkdir
-pv
$(PYTHON_DIR
)
57 cp
-rvf collecty
$(PYTHON_DIR
)
58 install -v
-m
755 collectyd
$(DESTDIR
)$(BINDIR
)
60 # Install configuration
61 -mkdir
-pv
$(DESTDIR
)/etc
/$(PACKAGE_NAME
)
62 cp
-vf example.conf
$(DESTDIR
)/etc
/$(PACKAGE_NAME
)/$(PACKAGE_NAME
).conf
64 # Install translation files.
65 -mkdir
-pv
$(DESTDIR
)$(LOCALEDIR
)
66 for file in
$(MO_FILES
); do \
67 lang
=$$(basename $${file
/.mo
/}); \
68 mkdir
-pv
$(DESTDIR
)$(LOCALEDIR
)/$${lang}/LC_MESSAGES
; \
69 install -v
-m
644 $${file} \
70 $(DESTDIR
)$(LOCALEDIR
)/$${lang}/LC_MESSAGES
/$(PACKAGE_NAME
).mo
; \
73 # Install systemd unit files.
74 mkdir
-pv
$(DESTDIR
)$(UNITDIR
)
75 install -m
644 -v collecty.service
$(DESTDIR
)$(UNITDIR
)
77 # Cleanup temporary files.
83 $(POT_FILE
): $(TRANSLATION_FILES
) Makefile
84 xgettext
--language python
-d
$(PACKAGE_NAME
) -k_
-kN_ \
85 -o
$@
--add-comments
--from-code
=UTF-8
$(sort $^
)
87 # Compile gettext dictionaries from translation files.