Update to 1.2.2

This commit is contained in:
Morten Stevens 2019-02-25 13:44:05 +01:00
parent 20eeaa2cb1
commit 9e12056612
4 changed files with 76 additions and 12 deletions

1
.gitignore vendored
View File

@ -36,3 +36,4 @@
/cacti-1.1.38.tar.gz /cacti-1.1.38.tar.gz
/cacti-1.2.0.tar.gz /cacti-1.2.0.tar.gz
/cacti-1.2.1.tar.gz /cacti-1.2.1.tar.gz
/cacti-1.2.2.tar.gz

View File

@ -0,0 +1,11 @@
--- cacti-1.2.2/include/config.php.orig 2019-02-24 15:52:08.000000000 +0100
+++ cacti-1.2.2/include/config.php 2019-02-25 13:31:22.313347085 +0100
@@ -85,7 +85,7 @@ $cacti_db_session = false;
* Disable log rotation settings for packagers
*/
-$disable_log_rotation = false;
+$disable_log_rotation = true;
/*
* Optional parameters to define scripts and resource paths. These

View File

@ -1,8 +1,8 @@
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
Name: cacti Name: cacti
Version: 1.2.1 Version: 1.2.2
Release: 2%{?dist} Release: 1%{?dist}
Summary: An rrd based graphing tool Summary: An rrd based graphing tool
License: GPLv2+ License: GPLv2+
URL: https://www.cacti.net/ URL: https://www.cacti.net/
@ -12,6 +12,7 @@ Source2: cacti.logrotate
Source3: cacti.README.fedora Source3: cacti.README.fedora
Source4: %{name}.cron Source4: %{name}.cron
Source5: cacti.nginx Source5: cacti.nginx
Patch0: cacti-1.2.x-disable_log_rotation.patch
BuildArch: noarch BuildArch: noarch
@ -75,9 +76,10 @@ data in a MySQL database. The frontend is completely PHP
driven. driven.
%prep %prep
%autosetup %autosetup -p1
%build %build
# Nothing to build
%install %install
%{__mkdir} -p %{buildroot}/%{_sysconfdir}/%{name} %{__mkdir} -p %{buildroot}/%{_sysconfdir}/%{name}
@ -86,43 +88,85 @@ driven.
%{__install} -d -m 0755 cache/ %{buildroot}/%{_localstatedir}/lib/%{name}/cache %{__install} -d -m 0755 cache/ %{buildroot}/%{_localstatedir}/lib/%{name}/cache
%{__install} -d -m 0755 cli/ %{buildroot}/%{_localstatedir}/lib/%{name}/cli %{__install} -d -m 0755 cli/ %{buildroot}/%{_localstatedir}/lib/%{name}/cli
%{__install} -d -m 0775 log/ %{buildroot}/%{_localstatedir}/log/%{name}/ %{__install} -d -m 0775 log/ %{buildroot}/%{_localstatedir}/log/%{name}/
touch %{buildroot}/%{_localstatedir}/log/%{name}/%{name}.log %{__install} -d -m 0755 resource/ %{buildroot}/%{_localstatedir}/lib/%{name}/resource
touch %{buildroot}/%{_localstatedir}/log/%{name}/%{name}_stderr.log
%{__install} -d -m 0755 rra/ %{buildroot}/%{_localstatedir}/lib/%{name}/rra/ %{__install} -d -m 0755 rra/ %{buildroot}/%{_localstatedir}/lib/%{name}/rra/
%{__install} -d -m 0755 scripts/ %{buildroot}/%{_localstatedir}/lib/%{name}/scripts/ %{__install} -d -m 0755 scripts/ %{buildroot}/%{_localstatedir}/lib/%{name}/scripts/
%{__mv} *.php %{buildroot}/%{_datadir}/%{name}/ %{__mv} *.php %{buildroot}/%{_datadir}/%{name}/
%{__mv} cache/ %{buildroot}/%{_localstatedir}/lib/%{name}/ %{__mv} cache/ %{buildroot}/%{_localstatedir}/lib/%{name}/
%{__mv} cli/ %{buildroot}/%{_localstatedir}/lib/%{name}/ %{__mv} cli/ %{buildroot}/%{_localstatedir}/lib/%{name}/
%{__mv} resource/ %{buildroot}/%{_localstatedir}/lib/%{name}/
%{__mv} rra/ %{buildroot}/%{_localstatedir}/lib/%{name}/ %{__mv} rra/ %{buildroot}/%{_localstatedir}/lib/%{name}/
%{__mv} scripts/ %{buildroot}/%{_localstatedir}/lib/%{name}/ %{__mv} scripts/ %{buildroot}/%{_localstatedir}/lib/%{name}/
%{__install} -p -D -m 0644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/cron.d/%{name} %{__install} -p -D -m 0644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/cron.d/%{name}
%{__install} -D -m 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/httpd/conf.d/%{name}.conf %{__install} -D -m 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/httpd/conf.d/%{name}.conf
%{__install} -D -m 0644 %{SOURCE5} %{buildroot}/%{_sysconfdir}/nginx/default.d/%{name}.conf %{__install} -D -m 0644 %{SOURCE5} %{buildroot}/%{_sysconfdir}/nginx/default.d/%{name}.conf
%{__install} -D -m 0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/cacti %{__install} -D -m 0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/cacti
%{__cp} -ar formats/ images/ include/ install/ lib/ locales/ mibs/ plugins/ resource/ %{buildroot}%{_datadir}/%{name} %{__cp} -ar formats/ images/ include/ install/ lib/ locales/ mibs/ plugins/ %{buildroot}%{_datadir}/%{name}
%{__cp} %{SOURCE3} ./docs/README.fedora %{__mv} %{SOURCE3} %{buildroot}/%{_pkgdocdir}
%{__cp} -a docs/ %{buildroot}/%{_pkgdocdir} %{__cp} -a docs/ %{buildroot}/%{_pkgdocdir}
%{__mv} %{buildroot}/%{_datadir}/%{name}/include/config.php %{buildroot}/%{_sysconfdir}/%{name}/db.php %{__mv} %{buildroot}/%{_datadir}/%{name}/include/config.php %{buildroot}/%{_sysconfdir}/%{name}/db.php
%{__chmod} +x %{buildroot}/%{_datadir}/%{name}/cmd.php %{buildroot}/%{_datadir}/%{name}/poller.php %{__chmod} +x %{buildroot}/%{_datadir}/%{name}/cmd.php %{buildroot}/%{_datadir}/%{name}/poller.php
ln -s %{_localstatedir}/lib/%{name}/cache %{buildroot}/%{_datadir}/%{name}/ ln -s %{_localstatedir}/lib/%{name}/cache %{buildroot}/%{_datadir}/%{name}/
ln -s %{_localstatedir}/lib/%{name}/cli %{buildroot}/%{_datadir}/%{name}/ ln -s %{_localstatedir}/lib/%{name}/cli %{buildroot}/%{_datadir}/%{name}/
ln -s %{_sysconfdir}/%{name}/db.php %{buildroot}/%{_datadir}/%{name}/include/config.php ln -s %{_sysconfdir}/%{name}/db.php %{buildroot}/%{_datadir}/%{name}/include/config.php
ln -s %{_localstatedir}/lib/%{name}/resource %{buildroot}/%{_datadir}/%{name}/
ln -s %{_localstatedir}/lib/%{name}/rra %{buildroot}/%{_datadir}/%{name}/ ln -s %{_localstatedir}/lib/%{name}/rra %{buildroot}/%{_datadir}/%{name}/
ln -s %{_localstatedir}/lib/%{name}/scripts %{buildroot}/%{_datadir}/%{name}/ ln -s %{_localstatedir}/lib/%{name}/scripts %{buildroot}/%{_datadir}/%{name}/
ln -s %{_localstatedir}/log/%{name}/ %{buildroot}/%{_datadir}/%{name}/log 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}/
# Create logfiles
touch %{buildroot}/%{_localstatedir}/log/%{name}/%{name}.log
touch %{buildroot}/%{_localstatedir}/log/%{name}/%{name}_stderr.log
# Migrate /usr/share/cacti/resource to /var/cacti/resource
%pretrans -p <lua>
path = "/usr/share/cacti/resource"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
%post %post
# Migrate file ownership to apache user # Migrate file ownership to apache user
chown -R apache:apache %{_localstatedir}/lib/%{name}/cache/
chown -R apache:apache %{_localstatedir}/lib/%{name}/cli/
chown -R apache:apache %{_localstatedir}/lib/%{name}/resource/
chown -R apache:apache %{_localstatedir}/lib/%{name}/rra/ chown -R apache:apache %{_localstatedir}/lib/%{name}/rra/
chown -R apache:apache %{_localstatedir}/lib/%{name}/scripts/
chown -R apache:apache %{_localstatedir}/log/%{name}/ chown -R apache:apache %{_localstatedir}/log/%{name}/
chown root:apache %{_sysconfdir}/%{name}/db.php chown root:apache %{_sysconfdir}/%{name}/db.php
# SELinux
semanage fcontext -a -t httpd_sys_content_t '%{_sysconfdir}/%{name}/db.php' 2>/dev/null || :
semanage fcontext -a -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}/cache(/.*)?' 2>/dev/null || :
semanage fcontext -a -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}/cli(/.*)?' 2>/dev/null || :
semanage fcontext -a -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}/resource(/.*)?' 2>/dev/null || :
semanage fcontext -a -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}/scripts(/.*)?' 2>/dev/null || :
restorecon -R %{_localstatedir}/lib/%{name} || :
restorecon -R %{_sysconfdir}/%{name} || :
# Migrate cacti polller to apache user # Migrate cacti polller to apache user
sed -i -e 's/\tcacti\t/\tapache\t/' %{_sysconfdir}/cron.d/%{name} sed -i -e 's/\tcacti\t/\tapache\t/' %{_sysconfdir}/cron.d/%{name}
%postun
if [ $1 -eq 0 ] ; then
semanage fcontext -d -t httpd_sys_content_t '%{_sysconfdir}/%{name}/db.php' 2>/dev/null || :
semanage fcontext -d -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}/cache(/.*)?' 2>/dev/null || :
semanage fcontext -d -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}/cli(/.*)?' 2>/dev/null || :
semanage fcontext -d -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}/resource(/.*)?' 2>/dev/null || :
semanage fcontext -d -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}/scripts(/.*)?' 2>/dev/null || :
fi
%files %files
%doc docs/ README.md cacti.sql %doc docs/ README.md cacti.sql
%license LICENSE %license LICENSE
@ -151,19 +195,27 @@ sed -i -e 's/\tcacti\t/\tapache\t/' %{_sysconfdir}/cron.d/%{name}
%{_datadir}/%{name}/log %{_datadir}/%{name}/log
%{_datadir}/%{name}/mibs %{_datadir}/%{name}/mibs
%{_datadir}/%{name}/plugins/ %{_datadir}/%{name}/plugins/
%{_datadir}/%{name}/resource
%{_datadir}/%{name}/rra %{_datadir}/%{name}/rra
%{_datadir}/%{name}/scripts %{_datadir}/%{name}/scripts
%{_localstatedir}/lib/%{name}/scripts/*[^p] %{_localstatedir}/lib/%{name}/scripts/*[^p]
%attr(-,root,root) %{_localstatedir}/lib/%{name}/scripts/*.php %{_pkgdocdir}/cacti.README.fedora
%attr(-,apache,apache) %{_datadir}/%{name}/resource/ %attr(-,apache,apache) %{_localstatedir}/lib/%{name}/scripts/*.php
%attr(-,apache,apache) %{_localstatedir}/lib/%{name}/resource/
%attr(-,apache,apache) %{_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(-,apache,apache) %{_localstatedir}/lib/%{name}/cli/*php
%attr(-,root,root) %{_localstatedir}/lib/%{name}/cli/.htaccess %attr(-,apache,apache) %{_localstatedir}/lib/%{name}/cli/.htaccess
%attr(-,root,root) %{_localstatedir}/lib/%{name}/include %attr(-,root,root) %{_localstatedir}/lib/%{name}/include
%attr(-,root,root) %{_localstatedir}/lib/%{name}/lib %attr(-,root,root) %{_localstatedir}/lib/%{name}/lib
%ghost %{_datadir}/%{name}/resource.rpmmoved
%changelog %changelog
* Mon Feb 25 2019 Morten Stevens <mstevens@fedoraproject.org> - 1.2.2-1
- Update to 1.2.2
- SELinux improvements
- Packaging improvements
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-2 * Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (cacti-1.2.1.tar.gz) = f68516559f05f5f5b591cc951ef86705791693d139b3b819a7942b1c1d7a63ce3f671c11ebcc6bc986d2c2bb86d3abfc191d3fea661df6548c0ce0e3e7954711 SHA512 (cacti-1.2.2.tar.gz) = 4a41aff20f06ad56f4723e52084d1a09e3b3eb017e8f1c957f700e4e2f9b12e8f0e599cb56611241c6fcc59bbd6bf957e948631f3beca72e2a7fdadacc473c65