From 374ab61f1457d87056939b83ed1430880f45ec98 Mon Sep 17 00:00:00 2001 From: monitorbuilder_pel7ppc64lebuilder0 Date: Tue, 29 Jun 2021 07:52:25 +0200 Subject: [PATCH] icinga web 2 package full update Signed-off-by: monitorbuilder_pel7ppc64lebuilder0 --- SPECS/icingaweb2.spec | 384 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 384 insertions(+) create mode 100644 SPECS/icingaweb2.spec diff --git a/SPECS/icingaweb2.spec b/SPECS/icingaweb2.spec new file mode 100644 index 0000000..a324816 --- /dev/null +++ b/SPECS/icingaweb2.spec @@ -0,0 +1,384 @@ +%define selinux_variants mls targeted +%define php php +%define php_cli php-cli +%define php_common php-common +%define wwwconfigdir %{_sysconfdir}/httpd/conf.d +%define wwwuser apache +%define php_version 5.6.0 +%define basedir %{_datadir}/%{name} +%define bindir %{_bindir} +%define configdir %{_sysconfdir}/%{name} +%define logdir %{_localstatedir}/log/%{name} +%define phpdir %{_datadir}/php +%define icingawebgroup icingaweb2 +%define docsdir %{_datadir}/doc/%{name} + +Name: icingaweb2 +Version: 2.8.2 +Release: 1%{?dist} +Summary: Icinga Web 2 +Group: Applications/System +License: GPLv2+ and MIT and BSD +URL: https://icinga.com +Source0: icingaweb2-2.8.2.orig.tar.gz +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} +Packager: Icinga Team +Requires: %{php}-mysqlnd +Requires: %{php}-pgsql +Requires: %{php}-ldap +Requires(pre): shadow-utils +Requires: php >= %{php_version} +Requires: php-common >= %{php_version} +Requires: icinga-l10n +Requires: icingacli = %{version}-%{release} +Requires: %{name}-common = %{version}-%{release} +Requires: php-Icinga = %{version}-%{release} +Requires: %{name}-vendor-dompdf = %{version}-%{release} +Requires: %{name}-vendor-HTMLPurifier = 1:%{version}-%{release} +Requires: %{name}-vendor-JShrink = %{version}-%{release} +Requires: %{name}-vendor-lessphp = %{version}-%{release} +Requires: %{name}-vendor-Parsedown = %{version}-%{release} + + +%description +Icinga Web 2 + + +%package common +Summary: Common files for Icinga Web 2 and the Icinga CLI +Group: Applications/System +Requires(pre): shadow-utils +%description common +Common files for Icinga Web 2 and the Icinga CLI + + +%package -n php-Icinga +Summary: Icinga Web 2 PHP library +Group: Development/Libraries +Requires: php-common >= %{php_version} +Requires: php-gd +Requires: php-intl +Requires: php-mbstring +Requires: %{php}-json +#Requires: %{name}-vendor-zf1 = %{version}-%{release} +#Requires: php-pecl-imagick +%description -n php-Icinga +Icinga Web 2 PHP library + + +%package -n icingacli +Summary: Icinga CLI +Group: Applications/System +Requires: icinga-l10n +Requires: %{name}-common = %{version}-%{release} +Requires: php-Icinga = %{version}-%{release} +Requires: bash-completion +Requires: phpi-cli >= %{php_version} +%description -n icingacli +Icinga CLI + + + +%package selinux +Summary: SELinux policy for Icinga Web 2 +BuildRequires: checkpolicy, selinux-policy-devel, hardlink +Requires: %{name} = %{version}-%{release} +Requires(post): policycoreutils +Requires(postun): policycoreutils +%description selinux +SELinux policy for Icinga Web 2 + + +%package vendor-dompdf +Summary: Icinga Web 2 vendor library dompdf +Group: Development/Libraries +License: LGPLv2.1 +Requires: php-common >= %{php_version} +Requires: %{name}-common = %{version}-%{release} +%description vendor-dompdf +Icinga Web 2 vendor library dompdf + + +%package vendor-HTMLPurifier +Epoch: 1 +Summary: Icinga Web 2 vendor library HTMLPurifier +Group: Development/Libraries +License: LGPLv2.1 +Requires: php-common >= %{php_version} +Requires: %{name}-common = %{version}-%{release} +%description vendor-HTMLPurifier +Icinga Web 2 vendor library HTMLPurifier + + +%package vendor-JShrink +Summary: Icinga Web 2 vendor library JShrink +Group: Development/Libraries +License: BSD +Requires: php-common >= %{php_version} +Requires: %{name}-common = %{version}-%{release} +%description vendor-JShrink +Icinga Web 2 vendor library JShrink + + +%package vendor-lessphp +Summary: Icinga Web 2 vendor library lessphp +Group: Development/Libraries +License: MIT +Requires: php-common >= %{php_version} +Requires: %{name}-common = %{version}-%{release} +%description vendor-lessphp +Icinga Web 2 vendor library lessphp + + +%package vendor-Parsedown +Summary: Icinga Web 2 vendor library Parsedown +Group: Development/Libraries +License: MIT +Requires: php-common >= %{php_version} +Requires: %{name}-common = %{version}-%{release} +%description vendor-Parsedown +Icinga Web 2 vendor library Parsedown + + +%package vendor-zf1 +Summary: Icinga Web 2's fork of Zend Framework 1 +Group: Development/Libraries +License: BSD +Requires: php-common >= %{php_version} +Obsoletes: %{name}-vendor-Zend < 1.12.20 +Requires: %{name}-common = %{version}-%{release} +%description vendor-zf1 +Icinga Web 2's fork of Zend Framework 1 + + +%prep +%setup -q +mkdir selinux +cp -p packages/selinux/icingaweb2.{fc,if,te} selinux + + +%build +cd selinux +for selinuxvariant in %{selinux_variants} +do + make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile + mv icingaweb2.pp icingaweb2.pp.${selinuxvariant} + make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean +done +cd - + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/{%{basedir}/{modules,library/vendor,public},%{bindir},%{configdir}/modules,%{logdir},%{phpdir},%{wwwconfigdir},%{_sysconfdir}/bash_completion.d,%{docsdir}} +cp -prv application doc %{buildroot}/%{basedir} +cp -pv etc/bash_completion.d/icingacli %{buildroot}/%{_sysconfdir}/bash_completion.d/icingacli +cp -prv modules/{monitoring,setup,doc,translation} %{buildroot}/%{basedir}/modules +cp -prv library/Icinga %{buildroot}/%{phpdir} +cp -prv library/vendor/{dompdf,HTMLPurifier*,JShrink,lessphp,Parsedown,Zend} %{buildroot}/%{basedir}/library/vendor +cp -prv public/{css,font,img,js,error_norewrite.html,error_unavailable.html} %{buildroot}/%{basedir}/public +%if 0%{?php_fpm:1} +cp -pv packages/files/apache/icingaweb2.fpm.conf %{buildroot}/%{wwwconfigdir}/icingaweb2.conf +%else +cp -pv packages/files/apache/icingaweb2.conf %{buildroot}/%{wwwconfigdir}/icingaweb2.conf +%endif +cp -pv packages/files/bin/icingacli %{buildroot}/%{bindir} +%if 0%{?php_bin:1} +sed -i '1 s~#!.*~#!%{php_bin}~' %{buildroot}/%{bindir}/icingacli +%endif +cp -pv packages/files/public/index.php %{buildroot}/%{basedir}/public +cp -prv etc/schema %{buildroot}/%{docsdir} +cp -prv packages/files/config/modules/{setup,translation} %{buildroot}/%{configdir}/modules +cd selinux +for selinuxvariant in %{selinux_variants} +do + install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant} + install -p -m 644 icingaweb2.pp.${selinuxvariant} %{buildroot}%{_datadir}/selinux/${selinuxvariant}/icingaweb2.pp +done +cd - +# TODO: Fix build problems on Icinga, see https://github.com/Icinga/puppet-icinga_build/issues/11 +#/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux + + +%pre +getent group icingacmd >/dev/null || groupadd -r icingacmd +usermod -a -G icingacmd,%{icingawebgroup} %{wwwuser} +exit 0 + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root) +%{basedir}/application/controllers +%{basedir}/application/fonts +%{basedir}/application/forms +%{basedir}/application/layouts +%{basedir}/application/views +%{basedir}/application/VERSION +%{basedir}/doc +%{basedir}/modules +%{basedir}/public +%config(noreplace) %{wwwconfigdir}/icingaweb2.conf +%attr(2775,root,%{icingawebgroup}) %dir %{logdir} +%attr(2770,root,%{icingawebgroup}) %config(noreplace) %dir %{configdir}/modules/setup +%attr(0660,root,%{icingawebgroup}) %config(noreplace) %{configdir}/modules/setup/config.ini +%attr(2770,root,%{icingawebgroup}) %config(noreplace) %dir %{configdir}/modules/translation +%attr(0660,root,%{icingawebgroup}) %config(noreplace) %{configdir}/modules/translation/config.ini +%{docsdir} +%docdir %{docsdir} + + +%pre common +getent group %{icingawebgroup} >/dev/null || groupadd -r %{icingawebgroup} +exit 0 + + +%files common +%defattr(-,root,root) +%dir %{basedir} +%dir %{basedir}/application +%dir %{basedir}/library +%dir %{basedir}/library/vendor +%dir %{basedir}/modules +%{basedir}/application/locale +%attr(2770,root,%{icingawebgroup}) %config(noreplace) %dir %{configdir} +%attr(2770,root,%{icingawebgroup}) %config(noreplace) %dir %{configdir}/modules + + +%files -n php-Icinga +%defattr(-,root,root) +%{phpdir}/Icinga + + +%files -n icingacli +%defattr(-,root,root) +%{basedir}/application/clicommands +%{_sysconfdir}/bash_completion.d/icingacli +%attr(0755,root,root) %{bindir}/icingacli + + +%post selinux +for selinuxvariant in %{selinux_variants} +do + %{_sbindir}/semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/icingaweb2.pp &> /dev/null || : +done +%{_sbindir}/restorecon -R %{basedir} &> /dev/null || : +%{_sbindir}/restorecon -R %{configdir} &> /dev/null || : +%{_sbindir}/restorecon -R %{logdir} &> /dev/null || : + +%postun selinux +if [ $1 -eq 0 ] ; then + for selinuxvariant in %{selinux_variants} + do + %{_sbindir}/semodule -s ${selinuxvariant} -r icingaweb2 &> /dev/null || : + done + [ -d %{basedir} ] && %{_sbindir}/restorecon -R %{basedir} &> /dev/null || : + [ -d %{configdir} ] && %{_sbindir}/restorecon -R %{configdir} &> /dev/null || : + [ -d %{logdir} ] && %{_sbindir}/restorecon -R %{logdir} &> /dev/null || : +fi + +%files selinux +%defattr(-,root,root,0755) +%doc selinux/* +%{_datadir}/selinux/*/icingaweb2.pp + + +%files vendor-dompdf +%defattr(-,root,root) +%{basedir}/library/vendor/dompdf + + +%files vendor-HTMLPurifier +%defattr(-,root,root) +%{basedir}/library/vendor/HTMLPurifier +%{basedir}/library/vendor/HTMLPurifier.autoload.php +%{basedir}/library/vendor/HTMLPurifier.php + + +%files vendor-JShrink +%defattr(-,root,root) +%{basedir}/library/vendor/JShrink + + +%files vendor-lessphp +%defattr(-,root,root) +%{basedir}/library/vendor/lessphp + + +%files vendor-Parsedown +%defattr(-,root,root) +%{basedir}/library/vendor/Parsedown + + +%files vendor-zf1 +%defattr(-,root,root) +%{basedir}/library/vendor/Zend + + +%changelog +* Tue Aug 18 2020 Johannes Meyer 2.8.2-1 +- Update to 2.8.2 + +* Mon Jun 29 2020 Johannes Meyer 2.8.1-1 +- Update to 2.8.1 + +* Mon Jun 8 2020 Johannes Meyer 2.8.0-1 +- Update to 2.8.0 +- Add new requirement for package icinga-l10n +- [EPEL 7] We now require PHP 7.3 instead of PHP 7.1 +- Please check uprading docs at /usr/share/icingaweb2/doc/80-Upgrading.md + +* Fri Oct 18 2019 Johannes Meyer 2.7.3-1 +- Update to 2.7.3 + +* Wed Oct 16 2019 Johannes Meyer 2.7.2-1 +- Update to 2.7.2 + +* Wed Aug 14 2019 Johannes Meyer 2.7.1-1 +- Update to 2.7.1 + +* Tue Jul 30 2019 Johannes Meyer 2.7.0-1 +- Update to 2.7.0 + +* Wed Apr 24 2019 Johannes Meyer 2.6.3-1 +- Update to 2.6.3 + +* Wed Nov 21 2018 Eric Lippmann 2.6.2-1 +- Update to 2.6.2 + +* Thu Aug 02 2018 Eric Lippmann 2.6.1-1 +- Update to 2.6.1 + +* Thu Jul 19 2018 Blerim Sheqa 2.6.0-1 +- Update to 2.6.0 + +* Fri Apr 27 2018 Eric Lippmann 2.5.3-1 +- Update to 2.5.3 + +* Thu Apr 26 2018 Eric Lippmann 2.5.2-1 +- Update to 2.5.2 + +* Mon Jan 22 2018 Markus Frosch 2.5.1-1 +- Update to 2.5.1 +- Remove FPM patches + +* Wed Nov 29 2017 Eric Lippmann 2.5.0-2 +- FPM: Add patch to support both Apache >= 2.4 and Apache < 2.4 + +* Tue Nov 28 2017 Eric Lippmann 2.5.0-1 +- Install error_unavailable.html +- Add patch to fix Apache FPM config + +* Mon Nov 27 2017 Markus Frosch 2.5.0-1 +- Update to 2.5.0 +- All packages now require PHP >= 5.6 +- [EPEL 6 + 7] We now require PHP 7 from SCL packages, php-fpm as runtime engine +- [SUSE / openSUSE] Requirements will force the installation of php7 +- Please check upgrading docs at /usr/share/icingaweb2/doc/80-Upgrading.md + +* Thu Sep 28 2017 Markus Frosch 2.4.2-1 +- Update to 2.4.2