]> git.pld-linux.org Git - packages/cacti.git/blame - cacti.spec
- up to 1.2.8; fixes CVE-2019-17357, CVE-2019-17358
[packages/cacti.git] / cacti.spec
CommitLineData
bc79e792 1%define pia_ver 3.1
466d01a2 2%define php_min_version 5.4.0
4780a883 3%include /usr/lib/rpm/macros.php
9f35c748 4Summary: Cacti is a PHP frontend for rrdtool
bf643d4f 5Summary(pl.UTF-8): Cacti - frontend w PHP do rrdtoola
94614147 6Name: cacti
3310ea9c 7Version: 1.2.8
0ef63a6b 8Release: 1
bc79e792 9License: GPL v2
94614147 10Group: Applications/WWW
ffbcce38 11Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
3310ea9c 12# Source0-md5: 822e317918956246398cfc891dff66bc
a1abeca3 13Source2: %{name}.crontab
de4cec3c
GS
14Source3: %{name}-apache.conf
15Source4: %{name}-lighttpd.conf
16Source5: %{name}-rrdpath.sql
af389505 17Source7: %{name}.logrotate
81fd7803 18
de4cec3c 19Patch1: %{name}-config.patch
e90920b5 20
de4cec3c
GS
21Patch3: %{name}-ioerror.patch
22Patch4: %{name}-webroot.patch
23Patch5: %{name}-linux_memory.patch
24Patch6: %{name}-log-verbosity.patch
2a712e3d 25
ac01d3f9 26Patch8: host_name-url.patch
e79e3b18 27# http://www.cacti.net/download_patches.php
08cf4295 28# Patch100: ..
855dc8ae 29URL: http://www.cacti.net/
344e658b 30BuildRequires: sed >= 4.0
f4a0dd1f
ER
31Requires(postun): /usr/sbin/userdel
32Requires(pre): /bin/id
33Requires(pre): /usr/sbin/useradd
e9300b9e 34Requires: crondaemon
f4a0dd1f 35Requires: group(http)
94614147 36Requires: net-snmp-utils
4780a883 37Requires: php(core) >= %{php_min_version}
587a5678 38Requires: php(ctype)
a9ce9d89 39Requires: php(filter)
15d44e1a 40Requires: php(gd)
a9ce9d89 41Requires: php(json)
15d44e1a 42Requires: php(ldap)
a9ce9d89 43Requires: php(mbstring)
15d44e1a 44Requires: php(openssl)
6e11204f 45Requires: php(pcre)
fc151646 46Requires: php(pdo-mysql)
15d44e1a 47Requires: php(posix)
6e11204f 48Requires: php(session)
15d44e1a 49Requires: php(sockets)
6e11204f 50Requires: php(xml)
15d44e1a 51Requires: php(zlib)
c8f292cd 52Requires: rrdtool
4b6cd69a 53Requires: webapps
e4f2f951 54Requires: webserver
cce68540 55Requires: webserver(access)
7d4ec5c1 56Requires: webserver(alias)
09dccb3a 57Requires: webserver(indexfile)
f5a0e42f 58Requires: webserver(php)
578edcb5 59Suggests: cacti-spine
e38b8207
ER
60Suggests: php(bcmath)
61Suggests: php(ftp)
15d44e1a
AM
62Suggests: php(gmp)
63Suggests: php(snmp)
d839b321 64Provides: cacti(pia) = %{pia_ver}
f4a0dd1f 65Provides: user(cacti)
33c70cd1 66Obsoletes: cacti-add_template
64df0cbe 67Obsoletes: cacti-plugin-boost
9f8f6fd2 68Obsoletes: cacti-plugin-update
aa6fbcd1 69%if "%{pld_release}" != "ac"
6e11204f 70Conflicts: logrotate < 3.8.0
aa6fbcd1 71%endif
6587a5d5 72BuildArch: noarch
94614147
JB
73BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74
4b6cd69a
ER
75%define _webapps /etc/webapps
76%define _webapp %{name}
77%define _sysconfdir %{_webapps}/%{_webapp}
78%define _appdir /usr/share/%{name}
6587a5d5 79
4780a883
ER
80# bad depsolver
81%define _noautopear pear
d6d94c67
ER
82# optional
83%define _noautophp php-ftp php-bcmath
4780a883
ER
84
85# put it together for rpmbuild
86%define _noautoreq %{?_noautophp} %{?_noautopear}
87
6587a5d5
JB
88%description
89Cacti is a complete frondend to rrdtool, it stores all of the
94614147
JB
90nessesary information to create graphs and populate them with data in
91a MySQL database.
6587a5d5 92
94614147
JB
93The frontend is completely PHP driven. Along with being able to
94maintain Graphs, Data Sources, and Round Robin Archives in a database,
95cacti handles the data gathering also. There is also SNMP support for
96those used to creating traffic graphs with MRTG.
6587a5d5 97
41840fab 98%description -l pl.UTF-8
350cedee 99Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
bf643d4f
ER
100informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
101bazie MySQL.
c9dfb888 102
350cedee 103Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
bf643d4f
ER
104źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
105także gromadzenie danych. Ma także obsługę SNMP przydatną przy
106tworzeniu wykresów ruchu przy użyciu MRTG.
c9dfb888 107
4b6cd69a
ER
108%package setup
109Summary: Cacti setup package
110Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti
111Group: Applications/WWW
112Requires: %{name} = %{version}-%{release}
d6d42868 113Suggests: %{name}-doc = %{version}-%{release}
4b6cd69a
ER
114
115%description setup
116Install this package to configure initial Cacti installation. You
117should uninstall this package when you're done, as it considered
118insecure to keep the setup files in place.
119
a40c4ad5
JB
120%description setup -l pl.UTF-8
121Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
122Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
123obecność może być niebezpieczna.
124
4b6cd69a
ER
125%package doc
126Summary: HTML Documentation for Cacti
a40c4ad5 127Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML
4b6cd69a
ER
128Group: Documentation
129Requires: %{name} = %{version}-%{release}
130
131%description doc
132HTML Documentation for Cacti.
133
a40c4ad5
JB
134%description doc -l pl.UTF-8
135Dokumentacja do Cacti w formacie HTML.
136
6587a5d5 137%prep
ffbcce38 138%setup -q
4a9821cf 139
482f9753 140# official patches
4a9821cf
ER
141%if 0%{?PATCH100:1}
142%patch100 -p1
143%endif
482f9753 144
0482abbd 145%patch1 -p1
e90920b5 146
14544804 147%patch3 -p1
d6d42868
ER
148%patch4 -p1
149%patch5 -p1
150%patch6 -p1
2a712e3d 151
81fd7803
AM
152# ?
153# %patch8 -p1
6587a5d5 154
4b6cd69a
ER
155mkdir -p sql
156mv *.sql sql
86a72dca 157# you should run this sql if your database contains path to %{_datadir}...
3d0c4fef 158cp -p %{SOURCE5} sql
4b6cd69a 159
af389505
ER
160%{__rm} log/.htaccess
161%{__rm} cli/.htaccess
af389505 162%{__rm} rra/.htaccess
344e658b 163
93d2fa9c
ER
164# must require libs to get fatals on missing files, not include
165%{__sed} -i -e '
166 s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");,
167 s,include_once,require_once,
168' cli/*.php
169
c68d3a6e
ER
170# make sure scripts have php shebang
171%{__sed} -i -e '1{
172 /bin.php/!i#!%{_bindir}/php
173}' scripts/*.php cli/*.php
6587a5d5 174
c68d3a6e 175chmod a+rx scripts/*.php cli/*.php
ebacb7e6 176
f4a0dd1f
ER
177find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
178
a0b0ee8a 179# make sure cacti runs out of the box
af389505 180%{__sed} -i -e 's,new_install,%{version},' sql/cacti.sql
a0b0ee8a 181
6587a5d5 182%install
94614147 183rm -rf $RPM_BUILD_ROOT
b2c7c665 184install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/docs,/etc/{cron.d,logrotate.d},%{_sbindir}}
8c6ff4ca 185install -d $RPM_BUILD_ROOT/var/{log,{lib,cache}/%{name}}
e9300b9e 186
3d0c4fef 187cp -p *.php $RPM_BUILD_ROOT%{_appdir}
b2c7c665
AM
188# dirs that contain index.php are likely to be installed
189# ls -1d */index.php | cut -d"/" -f1 | xargs
71281bc3
AM
190cp -a cache/* $RPM_BUILD_ROOT/var/cache/%{name}
191ln -s /var/cache/%{name} $RPM_BUILD_ROOT%{_appdir}/cache
e90920b5 192cp -a cli docs formats images include install lib locales mibs plugins resource scripts sql $RPM_BUILD_ROOT%{_appdir}
4b6cd69a 193mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
e9300b9e 194
4b6cd69a 195cp -a log $RPM_BUILD_ROOT/var/log/%{name}
81fd7803 196:> $RPM_BUILD_ROOT/var/log/%{name}/%{name}.log
b53d6410 197install -d $RPM_BUILD_ROOT/var/log/archive/%{name}
4b6cd69a 198cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
e9300b9e 199
caa81993 200mv $RPM_BUILD_ROOT{%{_appdir}/include,%{_sysconfdir}}/config.php
3d0c4fef
ER
201cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
202cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
4b6cd69a 203
aa6fbcd1
ER
204%if "%{pld_release}" == "ac"
205%{__sed} -i -e '/su/d' $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
206%endif
207
3d0c4fef 208cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
e61341ec 209cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
3d0c4fef 210cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
6587a5d5
JB
211
212%clean
94614147 213rm -rf $RPM_BUILD_ROOT
6587a5d5 214
f4a0dd1f
ER
215%pre
216%useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
217
d5d78058
AM
218%pretrans
219if [ -d "%{_appdir}/cache" ] && [ ! -L "%{_appdir}/cache" ]; then
220 mv -v %{_appdir}/cache{,.rpmsave}
221fi
222exit 0
223
4b6cd69a
ER
224%post
225if [ ! -f /var/log/%{name}/cacti.log ]; then
226 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
227fi
228
f4a0dd1f
ER
229%postun
230if [ "$1" = "0" ]; then
231 %userremove cacti
232fi
233
5e284e3e
AM
234%post setup
235%{_appdir}/cli/upgrade_database.php || :
236
4b6cd69a
ER
237%triggerin -- apache1 < 1.3.37-3, apache1-base
238%webapp_register apache %{_webapp}
239
240%triggerun -- apache1 < 1.3.37-3, apache1-base
241%webapp_unregister apache %{_webapp}
242
e61341ec 243%triggerin -- apache < 2.2.0, apache-base
4b6cd69a
ER
244%webapp_register httpd %{_webapp}
245
e61341ec 246%triggerun -- apache < 2.2.0, apache-base
4b6cd69a
ER
247%webapp_unregister httpd %{_webapp}
248
249%triggerin -- lighttpd
250%webapp_register lighttpd %{_webapp}
251
252%triggerun -- lighttpd
253%webapp_unregister lighttpd %{_webapp}
254
255%triggerpostun -- %{name} < 0.8.7b-9.5
256if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then
257 cp -f %{_sysconfdir}/config.php{,.rpmnew}
258 mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php
259fi
260
6587a5d5 261%files
94614147 262%defattr(644,root,root,755)
e90920b5 263%doc README.md CHANGELOG
4b6cd69a
ER
264%dir %attr(750,root,http) %{_sysconfdir}
265%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
266%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
267%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
268%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
269%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
af389505 270%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
4b6cd69a 271%attr(755,root,root) %{_sbindir}/cacti-poller
344e658b 272%dir %{_appdir}
4b6cd69a
ER
273%exclude %{_appdir}/install
274%exclude %{_appdir}/docs
b2c7c665
AM
275%{_appdir}/cache
276%{_appdir}/formats
344e658b 277%{_appdir}/images
b2c7c665
AM
278%{_appdir}/include
279%{_appdir}/lib
0e54cf19 280%{_appdir}/locales
fcd3cd85 281%{_appdir}/mibs
344e658b 282%{_appdir}/plugins
b2c7c665
AM
283%{_appdir}/resource
284%{_appdir}/sql
344e658b
ER
285%{_appdir}/*.php
286
ebacb7e6
ER
287%dir %{_appdir}/cli
288%attr(755,root,root) %{_appdir}/cli/*
289
344e658b
ER
290%dir %{_appdir}/scripts
291%attr(755,root,root) %{_appdir}/scripts/*
4b6cd69a 292
ea4c4a5f
AM
293%attr(750,root,http) %dir /var/lib/%{name}
294%attr(770,root,http) %dir /var/lib/%{name}/rra
4b6cd69a 295%attr(730,root,http) %dir /var/log/%{name}
b53d6410 296%attr(750,root,logs) %dir /var/log/archive/%{name}
4b6cd69a 297%attr(660,root,http) %ghost /var/log/%{name}/cacti.log
8c6ff4ca 298%attr(730,root,http) %dir /var/cache/%{name}
15d44e1a 299/var/cache/%{name}/index.php
71281bc3
AM
300%attr(730,root,http) %dir /var/cache/%{name}/boost
301%attr(730,root,http) %dir /var/cache/%{name}/mibcache
8cc40219 302%attr(770,root,http) %dir /var/cache/%{name}/realtime
71281bc3 303%attr(730,root,http) %dir /var/cache/%{name}/spikekill
15d44e1a
AM
304/var/cache/%{name}/*/.htaccess
305/var/cache/%{name}/*/index.php
4b6cd69a
ER
306
307%files setup
308%defattr(644,root,root,755)
309%{_appdir}/install
310
311%files doc
312%defattr(644,root,root,755)
adf6e05d 313%{_appdir}/docs
This page took 0.14702 seconds and 4 git commands to generate.