]> git.ipfire.org Git - collecty.git/blob - Makefile.am
7e406b626fce644873460d3db446ed2b4c12e7e0
[collecty.git] / Makefile.am
1 ###############################################################################
2 # #
3 # collecty - The IPFire statictics collection daemon #
4 # Copyright (C) 2015 collecty development team #
5 # #
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. #
10 # #
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. #
15 # #
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/>. #
18 # #
19 ###############################################################################
20
21 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
22 AM_MAKEFLAGS = --no-print-directory
23 AUTOMAKE_OPTIONS = color-tests
24
25 # remove target it the command fails
26 .DELETE_ON_ERROR:
27
28 # keep itermediate files
29 .SECONDARY:
30
31 SUBDIRS = . po
32
33 pythondir = $(pyexecdir)
34
35 # Dirs of external packages
36 dbuspolicydir=@dbuspolicydir@
37 dbussystemservicedir=@dbussystemservicedir@
38
39 CLEANFILES =
40 DISTCLEANFILES =
41 EXTRA_DIST =
42 INSTALL_DIRS =
43 noinst_DATA =
44
45 @INTLTOOL_POLICY_RULE@
46
47 .PHONY: update-po
48 update-po:
49 $(MAKE) -C po update-po
50
51 DISTCHECK_CONFIGURE_FLAGS = \
52 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
53 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
54 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
55
56 # ------------------------------------------------------------------------------
57
58 AM_V_XSLT = $(AM_V_XSLT_$(V))
59 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
60 AM_V_XSLT_0 = @echo " XSLT " $@;
61
62 # ------------------------------------------------------------------------------
63
64 dist_doc_DATA = \
65 COPYING
66
67 # ------------------------------------------------------------------------------
68
69 dist_bin_SCRIPTS = \
70 src/collectyd \
71 src/collecty-client
72
73 collecty_PYTHON = \
74 src/collecty/__init__.py \
75 src/collecty/__version__.py \
76 src/collecty/bus.py \
77 src/collecty/client.py \
78 src/collecty/constants.py \
79 src/collecty/daemon.py \
80 src/collecty/errors.py \
81 src/collecty/i18n.py \
82 src/collecty/locales.py \
83 src/collecty/logger.py
84
85 collectydir = $(pythondir)/collecty
86
87 collectyplugins_PYTHON = \
88 src/collecty/plugins/base.py \
89 src/collecty/plugins/contextswitches.py \
90 src/collecty/plugins/conntrack.py \
91 src/collecty/plugins/cpufreq.py \
92 src/collecty/plugins/disk.py \
93 src/collecty/plugins/entropy.py \
94 src/collecty/plugins/__init__.py \
95 src/collecty/plugins/interface.py \
96 src/collecty/plugins/interrupts.py \
97 src/collecty/plugins/latency.py \
98 src/collecty/plugins/loadavg.py \
99 src/collecty/plugins/memory.py \
100 src/collecty/plugins/processor.py \
101 src/collecty/plugins/sensors.py
102
103 collectypluginsdir = $(collectydir)/plugins
104
105 pkgpyexec_LTLIBRARIES = \
106 _collecty.la
107
108 _collecty_la_SOURCES = \
109 src/_collectymodule.c
110
111 _collecty_la_CFLAGS = \
112 $(AM_CFLAGS) \
113 $(LIBATASMART_CFLAGS) \
114 $(OPING_CFLAGS) \
115 $(PYTHON_CFLAGS)
116
117 _collecty_la_LDFLAGS = \
118 $(AM_LDFLAGS) \
119 -shared \
120 -module \
121 -avoid-version
122
123 _collecty_la_LIBADD = \
124 $(LIBATASMART_LIBS) \
125 $(OPING_LIBS) \
126 $(PYTHON_LIBS) \
127 $(SENSORS_LIBS)
128
129 dist_dbuspolicy_DATA = \
130 src/dbus/org.ipfire.collecty1.conf
131
132 dist_dbussystemservice_DATA = \
133 src/dbus/org.ipfire.collecty1.service
134
135 systemdsystemunit_DATA = \
136 src/systemd/collecty.service
137
138 dist_systemdsystemunit_DATA = \
139 src/systemd/org.ipfire.collecty1.busname
140
141 EXTRA_DIST += \
142 src/systemd/collecty.service.in
143
144 CLEANFILES += \
145 src/systemd/collecty.service
146
147 # ------------------------------------------------------------------------------
148
149 if ENABLE_MANPAGES
150 MANPAGES = \
151 man/collectyd.1
152
153 MANPAGES_XML = $(patsubst %.1,%.xml,$(patsubst %.5,%.xml,$(MANPAGES)))
154 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
155
156 man: $(MANPAGES) $(MANPAGES_HTML)
157
158 man_MANS = \
159 $(MANPAGES)
160
161 noinst_DATA += \
162 $(MANPAGES_HTML)
163
164 CLEANFILES += \
165 $(man_MANS) \
166 $(MANPAGES_HTML)
167
168 EXTRA_DIST += \
169 $(MANPAGES_XML) \
170 man/custom-html.xsl
171
172 XSLTPROC_FLAGS = \
173 --nonet \
174 --stringparam man.output.quietly 1 \
175 --stringparam funcsynopsis.style ansi \
176 --stringparam man.th.extra1.suppress 1 \
177 --stringparam man.authors.section.enabled 1 \
178 --stringparam man.copyright.section.enabled 1
179
180 XSLTPROC_COMMAND_MAN = \
181 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
182 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
183
184 XSLTPROC_COMMAND_HTML = \
185 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
186
187 man/%.1: man/%.xml
188 $(XSLTPROC_COMMAND_MAN)
189
190 man/%.5: man/%.xml
191 $(XSLTPROC_COMMAND_MAN)
192
193 man/%.html: man/%.xml man/custom-html.xsl
194 $(XSLTPROC_COMMAND_HTML)
195
196 endif
197
198 # ------------------------------------------------------------------------------
199
200 substitutions = \
201 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
202 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
203 '|configsdir=$(configsdir)|' \
204 '|bindir=$(bindir)|'
205
206 SED_PROCESS = \
207 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
208 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
209 < $< > $@
210
211 src/systemd/%: src/systemd/%.in Makefile
212 $(SED_PROCESS)