]> git.ipfire.org Git - people/ms/westferry.git/blob - Makefile.am
Add graphs handlers
[people/ms/westferry.git] / Makefile.am
1 ###############################################################################
2 # #
3 # Westferry - The IPFire web user interface #
4 # Copyright (C) 2015 IPFire 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 configsdir = $(sysconfdir)/westferry
36
37 # Directories for static files
38 webrootdir = $(datadir)/westferry/webroot
39 webroot_cssdir = $(webrootdir)/css
40 webroot_fontsdir = $(webrootdir)/fonts
41 webroot_scriptsdir = $(webrootdir)/scripts
42 webroot_imagesdir = $(webrootdir)/images
43
44 CLEANFILES =
45 DISTCLEANFILES =
46 EXTRA_DIST =
47 INSTALL_DIRS =
48 noinst_DATA =
49
50 @INTLTOOL_POLICY_RULE@
51
52 .PHONY: update-po
53 update-po:
54 $(MAKE) -C po update-po
55
56 DISTCHECK_CONFIGURE_FLAGS = \
57 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
58
59 # ------------------------------------------------------------------------------
60
61 AM_V_XSLT = $(AM_V_XSLT_$(V))
62 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
63 AM_V_XSLT_0 = @echo " XSLT " $@;
64
65 # ------------------------------------------------------------------------------
66
67 dist_doc_DATA = \
68 COPYING
69
70 # ------------------------------------------------------------------------------
71
72 bin_SCRIPTS = \
73 src/scripts/westferry
74
75 EXTRA_DIST += \
76 src/scripts/westferry.in
77
78 CLEANFILES += \
79 src/scripts/westferry
80
81 dist_configs_DATA = \
82 westferry.conf.sample
83
84 westferry_PYTHON = \
85 src/westferry/__init__.py \
86 src/westferry/constants.py \
87 src/westferry/application.py \
88 src/westferry/i18n.py \
89 src/westferry/services.py
90
91 westferrydir = $(pythondir)/westferry
92
93 EXTRA_DIST += \
94 src/westferry/constants.py.in
95
96 CLEANFILES += \
97 src/westferry/constants.py
98
99 westferry_backend_PYTHON = \
100 src/westferry/backend/__init__.py \
101 src/westferry/backend/__version__.py \
102 src/westferry/backend/base.py \
103 src/westferry/backend/graphs.py \
104 src/westferry/backend/main.py \
105 src/westferry/backend/system.py
106
107 westferry_backenddir = $(pythondir)/westferry/backend
108
109 westferry_handlers_PYTHON = \
110 src/westferry/handlers/__init__.py \
111 src/westferry/handlers/analytics.py \
112 src/westferry/handlers/base.py \
113 src/westferry/handlers/index.py
114
115 westferry_handlersdir = $(pythondir)/westferry/handlers
116
117 westferry_ui_PYTHON = \
118 src/westferry/ui/__init__.py \
119 src/westferry/ui/base.py \
120 src/westferry/ui/graphs.py \
121 src/westferry/ui/menu.py \
122 src/westferry/ui/utils.py
123
124 westferry_uidir = $(pythondir)/westferry/ui
125
126 # - templates ------------------------------------------------------------------
127
128 templatesdir = $(datadir)/westferry/templates
129
130 dist_templates_DATA = \
131 src/templates/base.html
132
133 templates_modulesdir = $(templatesdir)/modules
134
135 dist_templates_modules_DATA =
136
137 templates_modules_graphsdir = $(templates_modulesdir)/graphs
138
139 dist_templates_modules_graphs_DATA = \
140 src/templates/modules/graphs/box.html \
141 src/templates/modules/graphs/preview.html
142
143 templates_modules_menudir = $(templates_modulesdir)/menu
144
145 dist_templates_modules_menu_DATA = \
146 src/templates/modules/menu/sidebar.html \
147 src/templates/modules/menu/sidebar-divider.html \
148 src/templates/modules/menu/sidebar-link.html \
149 src/templates/modules/menu/sidebar-submenu.html
150
151 ui_modulesdir = $(datadir)/westferry/templates/modules
152
153 ui_modules_DATA =
154
155 dist_webroot_css_DATA = \
156 src/styles/westferry.css
157
158 # - third party ----------------------------------------------------------------
159
160 # We currently ship a copy of Bootstrap which eventually has to go away
161
162 dist_webroot_css_DATA += \
163 src/third-party/bootstrap/css/bootstrap.min.css
164
165 EXTRA_DIST += \
166 src/third-party/bootstrap/css/bootstrap.css \
167 src/third-party/bootstrap/css/bootstrap-theme.css \
168 src/third-party/bootstrap/css/bootstrap-theme.css.map \
169 src/third-party/bootstrap/css/bootstrap.min.css \
170 src/third-party/bootstrap/css/bootstrap-theme.min.css \
171 src/third-party/bootstrap/css/bootstrap.css.map
172
173 dist_webroot_fonts_DATA = \
174 src/third-party/bootstrap/fonts/glyphicons-halflings-regular.ttf \
175 src/third-party/bootstrap/fonts/glyphicons-halflings-regular.svg \
176 src/third-party/bootstrap/fonts/glyphicons-halflings-regular.woff \
177 src/third-party/bootstrap/fonts/glyphicons-halflings-regular.eot \
178 src/third-party/bootstrap/fonts/glyphicons-halflings-regular.woff2
179
180 dist_webroot_scripts_DATA = \
181 src/third-party/bootstrap/js/bootstrap.min.js
182
183 EXTRA_DIST += \
184 src/third-party/bootstrap/js/npm.js \
185 src/third-party/bootstrap/js/bootstrap.js
186
187 # Also shipping jQuery
188
189 dist_webroot_scripts_DATA += \
190 src/third-party/jquery.min.js
191
192 # ------------------------------------------------------------------------------
193
194 if ENABLE_MANPAGES
195 MANPAGES =
196
197 MANPAGES_XML = $(patsubst %.1,%.xml,$(patsubst %.5,%.xml,$(MANPAGES)))
198 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
199
200 man: $(MANPAGES) $(MANPAGES_HTML)
201
202 man_MANS = \
203 $(MANPAGES)
204
205 noinst_DATA += \
206 $(MANPAGES_HTML)
207
208 CLEANFILES += \
209 $(man_MANS) \
210 $(MANPAGES_HTML)
211
212 EXTRA_DIST += \
213 $(MANPAGES_XML) \
214 man/custom-html.xsl
215
216 XSLTPROC_FLAGS = \
217 --nonet \
218 --stringparam man.output.quietly 1 \
219 --stringparam funcsynopsis.style ansi \
220 --stringparam man.th.extra1.suppress 1 \
221 --stringparam man.authors.section.enabled 1 \
222 --stringparam man.copyright.section.enabled 1
223
224 XSLTPROC_COMMAND_MAN = \
225 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
226 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
227
228 XSLTPROC_COMMAND_HTML = \
229 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
230
231 man/%.1: man/%.xml
232 $(XSLTPROC_COMMAND_MAN)
233
234 man/%.5: man/%.xml
235 $(XSLTPROC_COMMAND_MAN)
236
237 man/%.html: man/%.xml man/custom-html.xsl
238 $(XSLTPROC_COMMAND_HTML)
239
240 endif
241
242 # ------------------------------------------------------------------------------
243
244 if HAVE_SYSTEMD
245 systemdsystemunit_DATA = \
246 src/systemd/westferry.service
247
248 CLEANFILES += \
249 $(systemdsystemunit_DATA)
250
251 INSTALL_DIRS += \
252 $(systemdsystemunitdir)
253 endif
254
255 EXTRA_DIST += \
256 src/systemd/westferry.service.in
257
258 # ------------------------------------------------------------------------------
259
260 substitutions = \
261 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
262 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
263 '|configsdir=$(configsdir)|' \
264 '|bindir=$(bindir)|' \
265 '|datadir=$(datadir)|' \
266 '|templatesdir=$(templatesdir)|' \
267 '|webrootdir=$(webrootdir)|'
268
269 SED_PROCESS = \
270 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
271 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
272 < $< > $@
273
274 %.py: %.py.in Makefile
275 $(SED_PROCESS)
276
277 src/scripts/westferry: src/scripts/westferry.in Makefile
278 $(SED_PROCESS)
279
280 src/systemd/%: src/systemd/%.in Makefile
281 $(SED_PROCESS)