Spec file improvements

This commit is contained in:
Morten Stevens 2018-12-03 20:13:47 +01:00
parent 7890d92470
commit b0ece1f8c8
3 changed files with 26 additions and 14 deletions

View File

@ -1 +1 @@
#*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1 #*/5 * * * * apache /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

View File

@ -1,8 +1,8 @@
/var/log/cacti/cacti.log { /var/log/cacti/cacti.log {
weekly
rotate 7
missingok missingok
monthly
notifempty notifempty
compress compress
create 0664 cacti apache su apache apache
su cacti apache
} }

View File

@ -1,10 +1,10 @@
Name: cacti Name: cacti
Version: 1.1.38 Version: 1.1.38
Release: 3%{?dist} Release: 4%{?dist}
Summary: An rrd based graphing tool Summary: An rrd based graphing tool
License: GPLv2+ License: GPLv2+
URL: http://www.cacti.net/ URL: https://www.cacti.net/
Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz Source0: https://www.cacti.net/downloads/%{name}-%{version}.tar.gz
Source1: cacti-httpd.conf Source1: cacti-httpd.conf
Source2: cacti.logrotate Source2: cacti.logrotate
Source3: cacti.README.fedora Source3: cacti.README.fedora
@ -113,10 +113,16 @@ ln -s %{_localstatedir}/log/%{name}/ %{buildroot}/%{_datadir}/%{name}/log
ln -s %{_datadir}/%{name}/lib %{buildroot}/%{_localstatedir}/lib/%{name}/ ln -s %{_datadir}/%{name}/lib %{buildroot}/%{_localstatedir}/lib/%{name}/
ln -s %{_datadir}/%{name}/include %{buildroot}/%{_localstatedir}/lib/%{name}/ ln -s %{_datadir}/%{name}/include %{buildroot}/%{_localstatedir}/lib/%{name}/
%pre
useradd -d %{_datadir}/%{name} -r -s /sbin/nologin cacti 2> /dev/null || :
%post %post
# Migrate file ownership to apache user
chown -R apache:apache %{_localstatedir}/lib/%{name}/rra/
chown -R apache:apache %{_localstatedir}/log/%{name}/
chown root:apache %{_sysconfdir}/%{name}/db.php
# Migrate cacti polller to apache user
sed -i -e 's/\tcacti\t/\tapache\t/' %{_sysconfdir}/cron.d/%{name}
if [ $1 -eq 1 ] ; then if [ $1 -eq 1 ] ; then
%systemd_postun_with_restart httpd.service %systemd_postun_with_restart httpd.service
fi fi
@ -132,12 +138,12 @@ fi
%dir %{_localstatedir}/lib/%{name} %dir %{_localstatedir}/lib/%{name}
%dir %{_localstatedir}/lib/%{name}/cli %dir %{_localstatedir}/lib/%{name}/cli
%dir %attr(-,apache,apache) %{_localstatedir}/lib/%{name}/scripts %dir %attr(-,apache,apache) %{_localstatedir}/lib/%{name}/scripts
%dir %attr(-,cacti,apache) %{_localstatedir}/log/%{name}/ %dir %attr(-,apache,apache) %{_localstatedir}/log/%{name}/
%config(noreplace) %attr(-,cacti,apache) %{_localstatedir}/log/%{name}/%{name}.log %config(noreplace) %attr(-,apache,apache) %{_localstatedir}/log/%{name}/%{name}.log
%config(noreplace) %{_sysconfdir}/cron.d/cacti %config(noreplace) %{_sysconfdir}/cron.d/cacti
%config(noreplace) %{_sysconfdir}/httpd/conf.d/cacti.conf %config(noreplace) %{_sysconfdir}/httpd/conf.d/cacti.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%attr(0640,cacti,apache) %config(noreplace) %{_sysconfdir}/%{name}/db.php %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/db.php
%{_datadir}/%{name}/*.php %{_datadir}/%{name}/*.php
%{_datadir}/%{name}/cache %{_datadir}/%{name}/cache
%{_datadir}/%{name}/cli %{_datadir}/%{name}/cli
@ -155,7 +161,7 @@ fi
%{_localstatedir}/lib/%{name}/scripts/*[^p] %{_localstatedir}/lib/%{name}/scripts/*[^p]
%attr(-,root,root) %{_localstatedir}/lib/%{name}/scripts/*.php %attr(-,root,root) %{_localstatedir}/lib/%{name}/scripts/*.php
%attr(-,apache,apache) %{_datadir}/%{name}/resource/ %attr(-,apache,apache) %{_datadir}/%{name}/resource/
%attr(-,cacti,root) %{_localstatedir}/lib/%{name}/rra/ %attr(-,apache,apache) %{_localstatedir}/lib/%{name}/rra/
%attr(-,apache,apache) %{_localstatedir}/lib/%{name}/cache/ %attr(-,apache,apache) %{_localstatedir}/lib/%{name}/cache/
%attr(-,root,root) %{_localstatedir}/lib/%{name}/cli/*php %attr(-,root,root) %{_localstatedir}/lib/%{name}/cli/*php
%attr(-,root,root) %{_localstatedir}/lib/%{name}/cli/.htaccess %attr(-,root,root) %{_localstatedir}/lib/%{name}/cli/.htaccess
@ -163,6 +169,12 @@ fi
%attr(-,root,root) %{_localstatedir}/lib/%{name}/lib %attr(-,root,root) %{_localstatedir}/lib/%{name}/lib
%changelog %changelog
* Mon Dec 03 2018 Morten Stevens <mstevens@fedoraproject.org> - 1.1.38-4
- Spec file improvements
- Updated logrotation settings
- Removed cacti user
- Changed rra file ownership to apache #1454755
* Wed Jul 25 2018 Morten Stevens <mstevens@fedoraproject.org> - 1.1.38-3 * Wed Jul 25 2018 Morten Stevens <mstevens@fedoraproject.org> - 1.1.38-3
- Fix for https://github.com/Cacti/cacti/issues/1634 - Fix for https://github.com/Cacti/cacti/issues/1634