File pihole-admin-lte.spec of Package pihole-admin-lte
263
1
#
2
# spec file for package pi-hole
3
#
4
# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via http://bugs.opensuse.org/
16
#
17
18
# TODO: auth.php has lighttpd.log as some kind of fallback. This thing needs to be handled somehow. Probably introduce a var to config file for this?
19
# TODO: dashboard’s ajax queries seems to be blocking somehow. Investigate.
20
# TODO: api.php?summary is called like all the time. I think there needs to be some sense how often that is queried, as the page may just be running all the time.
21
# TODO: ask upstream if indentation should be standardised? Now both 4 spaces and tab indentation is used in different files.
22
23
%define web_files_location /srv/www/pihole
24
25
Name: pihole-admin-lte
26
%define official_name AdminLTE
27
Version: 5.21
28
# %%() replace causes errors like “can't expand %%(...)”. This is due some bug according search engines.
29
%global real_version %(echo "%{version}" | sed -r 's/v(.*)/\\1/')
30
%define real_nameversion %{official_name}-%{real_version}
31
Release: 0
32
Summary: Pi-hole Dashboard for stats and more
33
License: EUPL-1.2
34
# TODO: check what group would be better
35
Group: Productivity/Networking/Other
36
Url: https://pi-hole.net/
37
Source0: %{official_name}-%{version}.tar.gz
38
Source1: nginx.conf
39
Source2: lighttpd.conf
40
Source3: SUSE.readme
41
Source5: php-fpm-www.conf
42
Source6: pihole.apparmor
43
# TODO: contribute patches to upstream
44
Patch1: savesettings.php-better-error-handling.patch
45
Patch4: FTL.php-socket-error-handling.patch
46
Patch5: FTL.php-improve-get-response-ftl.patch
47
Patch7: fix_command_execution.patch
48
Patch9: buffering_fixes.patch
49
# Contribution patches ends here.
50
Patch8: fix_sudo_commands.patch
51
%define php_ver 7
52
Requires: user(pihole)
53
Requires: php7-openssl
54
Suggests: pi-hole
55
Suggests: pihole-ftl
56
BuildRequires: fdupes
57
BuildRoot: %{_tmppath}/%{real_nameversion}-build
58
BuildArch: noarch
59
60
%description
61
Pi-hole®'s Web interface (based off of AdminLTE) provides a central location to manage your Pi-hole and review the statistics generated by FTLDNS™.
62
63
* Easy-to-interpret: simple graphs and beautiful colors make Pi-hole's stats easy to understand
64
* Responsive: looks great on desktop, tablets, and mobile devices
65
* Useful: control and configure your Pi-hole with our settings
66
* Insightful: use the query log, audit log, or long-term stats to gain insight into your networks activity
67
68
%package config-nginx
69
Summary: Pi-hole AdminLTE configuration files for nginx
70
Group: Productivity/Networking/Web/Utilities
71
Requires: nginx
72
Supplements: packageand(nginx:pihole-admin-lte)
73
Recommends: %{name}-config-php-fpm
74
75
%description config-nginx
76
If you want to run Pi-hole AdminLTE via nginx and PHP-FPM, just install this
77
package to get some easy to understand/adaptable configuration files
78
that make it easy to setup AdminLTE with Nginx.
79
80
%files config-nginx
81
%defattr(-,root,root)
82
%dir %{_sysconfdir}/nginx
83
%dir %{_sysconfdir}/nginx/conf.d
84
%ghost %config(noreplace) %{_sysconfdir}/nginx/conf.d/adminlte.conf
85
%config %{_sysconfdir}/nginx/conf.d/adminlte.conf.in
86
87
%package config-php-fpm
88
Summary: Pi-hole AdminLTE configuration files for PHP-FPM
89
Group: Productivity/Networking/Web/Utilities
90
Requires: php-fpm
91
Supplements: packageand(php-fpm:pihole-admin-lte)
92
93
%description config-php-fpm
94
If you want to run Pi-hole AdminLTE via PHP-FPM, just install this package to get
95
some easy to understand/adaptable configuration files that make it easy
96
to run AdminLTE via PHP-FPM.
97
98
%files config-php-fpm
99
%defattr(-,root,root)
100
%dir %{_sysconfdir}/php7
101
%dir %{_sysconfdir}/php7/fpm
102
%dir %{_sysconfdir}/php7/fpm/php-fpm.d
103
%attr(0775, pihole, pihole) %dir /var/log/pihole/
104
%config(noreplace) %{_sysconfdir}/php7/fpm/php-fpm.d/%{name}.conf.in
105
106
%prep
107
%setup -q -n %{real_nameversion}
108
%patch1 -p1
109
%patch4 -p1
110
%patch5 -p1
111
%patch7 -p1
112
%patch8 -p1
113
%patch9 -p1
114
115
%build
116
# Nothing to do.
117
118
%install
119
120
install -Dm644 %{S:3} %{buildroot}/%{_docdir}/%{name}/SUSE.readme
121
122
install -dm755 %{buildroot}%{web_files_location}/admin
123
124
cp -dpr --no-preserve=ownership %{_builddir}/%{real_nameversion}/* %{buildroot}%{web_files_location}/admin/
125
126
rm %{buildroot}%{web_files_location}/admin/CONTRIBUTING.md
127
rm %{buildroot}%{web_files_location}/admin/README.md
128
rm %{buildroot}%{web_files_location}/admin/LICENSE
129
130
# Nginx configuration
131
# TODO: like with Moodle, I guess I could generate correct FPM paths here... https://build.opensuse.org/package/view_file/Education/moodle3_8/moodle3_8.spec?expand=1
132
install -D -m 0644 %{S:1} %{buildroot}%{_sysconfdir}/nginx/conf.d/adminlte.conf.in
133
134
# PHP-FPM configuration
135
install -D -m 0644 %{S:5} %{buildroot}%{_sysconfdir}/php%{php_ver}/fpm/php-fpm.d/%{name}.conf.in
136
install -dm775 %{buildroot}%{_var}/log/pihole
137
138
# SUSE 15-SP4 added a profile for php-fpm.
139
# Add a file to allow socket usage.
140
%if 0%{?sle_version} >= 150400
141
install -D -m 0644 %{S:6} %{buildroot}%{_sysconfdir}/apparmor.d/php-fpm.d/pihole
142
%endif
143
144
# These probably are useless for end user.
145
rm %{buildroot}%{web_files_location}/admin/scripts/vendor/daterangepicker.min.js.map
146
rm %{buildroot}%{web_files_location}/admin/scripts/vendor/bootstrap-select.min.js.map
147
rm %{buildroot}%{web_files_location}/admin/scripts/vendor/bootstrap-toggle.min.js.map
148
rm %{buildroot}%{web_files_location}/admin/scripts/vendor/chartjs-adapter-moment.min.js.map
149
150
%fdupes %buildroot
151
152
%files
153
%defattr(-,root,root,-)
154
155
# This one is admin/LICENSE
156
%license LICENSE
157
# SUSE.readme
158
%doc SUSE.readme
159
%doc README.md
160
%doc CONTRIBUTING.md
161
162
%if 0%{?sle_version} >= 150400
163
# Adding for convenience.
164
%dir /etc/apparmor.d
165
# I don’t want to own this but php-fpm seems not to own it either...
166
%dir /etc/apparmor.d/php-fpm.d
167
%{_sysconfdir}/apparmor.d/php-fpm.d/pihole
168
%endif
169
170
%dir %{web_files_location}
171
%dir %{web_files_location}/admin
172
173
# TODO: these maybe shouldn’t be installed?
174
%{web_files_location}/admin/package-lock.json
175
%{web_files_location}/admin/package.json
176
%{web_files_location}/admin/composer.json
177
%{web_files_location}/admin/composer.lock
178
%{web_files_location}/admin/phpstan.neon.dist
179
180
%{web_files_location}/admin/*.php
181
%dir %{web_files_location}/admin/img
182
%{web_files_location}/admin/img/boxed-bg.png
183
%{web_files_location}/admin/img/boxed-bg-dark.png
184
%{web_files_location}/admin/img/pihole_icon.svg
185
%dir %{web_files_location}/admin/img/favicons
186
%{web_files_location}/admin/img/favicons/*.png
187
%{web_files_location}/admin/img/favicons/*.svg
188
%{web_files_location}/admin/img/favicons/favicon.ico
189
%{web_files_location}/admin/img/favicons/manifest.json
190
%{web_files_location}/admin/img/logo.svg
191
%dir %{web_files_location}/admin/scripts/pi-hole
192
%dir %{web_files_location}/admin/scripts/pi-hole/js
193
%{web_files_location}/admin/scripts/pi-hole/js/*.js
194
%dir %{web_files_location}/admin/scripts/pi-hole/php
195
%{web_files_location}/admin/scripts/pi-hole/php/*.php
196
%dir %{web_files_location}/admin/style
197
%{web_files_location}/admin/style/pi-hole.css
198
199
# TODO: instead of these bundles, probably need to find out a way to install them as separate packages
200
201
%dir %{web_files_location}/admin/scripts
202
%dir %{web_files_location}/admin/scripts/vendor
203
%{web_files_location}/admin/scripts/vendor/*.js
204
%license %{web_files_location}/admin/scripts/vendor/LICENSE
205
%{web_files_location}/admin/scripts/vendor/qrcode.php
206
207
%dir %{web_files_location}/admin/style/vendor/font-awesome
208
%dir %{web_files_location}/admin/style/vendor/font-awesome/js
209
%{web_files_location}/admin/style/vendor/font-awesome/js/all.min.js
210
211
%dir %{web_files_location}/admin/style/themes/
212
%{web_files_location}/admin/style/themes/default-auto.css
213
%{web_files_location}/admin/style/themes/default-dark.css
214
%{web_files_location}/admin/style/themes/default-darker.css
215
%{web_files_location}/admin/style/themes/default-light.css
216
%{web_files_location}/admin/style/themes/high-contrast-dark.css
217
%{web_files_location}/admin/style/themes/high-contrast.css
218
%{web_files_location}/admin/style/themes/lcars.css
219
%{web_files_location}/admin/style/themes/lcars-picard.css
220
221
%dir %{web_files_location}/admin/style/vendor
222
%{web_files_location}/admin/style/vendor/AdminLTE.min.css
223
%{web_files_location}/admin/style/vendor/datatables.min.css
224
%{web_files_location}/admin/style/vendor/datatables_extensions.min.css
225
%{web_files_location}/admin/style/vendor/animate.min.css
226
%license %{web_files_location}/admin/style/vendor/LICENSE
227
%{web_files_location}/admin/style/vendor/js-warn.css
228
%{web_files_location}/admin/style/vendor/daterangepicker.min.css
229
230
%dir %{web_files_location}/admin/style/vendor/bootstrap
231
%dir %{web_files_location}/admin/style/vendor/bootstrap/js
232
%{web_files_location}/admin/style/vendor/bootstrap/js/bootstrap.min.js
233
%dir %{web_files_location}/admin/style/vendor/bootstrap/css
234
%{web_files_location}/admin/style/vendor/bootstrap/css/bootstrap.min.css
235
%{web_files_location}/admin/style/vendor/bootstrap/css/bootstrap.min.css.map
236
%dir %{web_files_location}/admin/style/vendor/bootstrap/fonts
237
%{web_files_location}/admin/style/vendor/bootstrap/fonts/glyphicons-halflings-*
238
239
%{web_files_location}/admin/style/vendor/bootstrap-select.min.css
240
%{web_files_location}/admin/style/vendor/bootstrap-toggle.min.css
241
242
%dir %{web_files_location}/admin/style/vendor/fonts
243
%dir %{web_files_location}/admin/style/vendor/fonts/antonio
244
%{web_files_location}/admin/style/vendor/fonts/antonio/antonio.css
245
%{web_files_location}/admin/style/vendor/fonts/antonio/antonio-v1-latin-ext_latin-*.woff
246
%{web_files_location}/admin/style/vendor/fonts/antonio/antonio-v1-latin-ext_latin-*.woff2
247
%dir %{web_files_location}/admin/style/vendor/fonts/ubuntu-mono
248
%{web_files_location}/admin/style/vendor/fonts/ubuntu-mono/ubuntu-mono.css
249
%{web_files_location}/admin/style/vendor/fonts/ubuntu-mono/ubuntu-mono-v10-latin-ext_latin-*.woff
250
%{web_files_location}/admin/style/vendor/fonts/ubuntu-mono/ubuntu-mono-v10-latin-ext_latin-*.woff2
251
252
%{web_files_location}/admin/style/vendor/icheck-bootstrap.min.css
253
%{web_files_location}/admin/style/vendor/icheck-material.min.css
254
255
%{web_files_location}/admin/style/vendor/select2.min.css
256
257
%dir %{web_files_location}/admin/style/vendor/SourceSansPro
258
%{web_files_location}/admin/style/vendor/SourceSansPro/source-sans-pro-*.woff
259
%{web_files_location}/admin/style/vendor/SourceSansPro/source-sans-pro-*.woff2
260
%{web_files_location}/admin/style/vendor/SourceSansPro/SourceSansPro.css
261
262
%changelog
263