From 3df44c9af3cba09a0b16eaec80d19208c75b91b5 Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Tue, 11 Jul 2017 18:21:11 +0200 Subject: [PATCH 1/8] Original spec file for Fedora --- fedora/SPECS/pnp4nagios.spec | 112 +++++++++++++---------------------- 1 file changed, 40 insertions(+), 72 deletions(-) diff --git a/fedora/SPECS/pnp4nagios.spec b/fedora/SPECS/pnp4nagios.spec index 70e1647..2a30ea4 100644 --- a/fedora/SPECS/pnp4nagios.spec +++ b/fedora/SPECS/pnp4nagios.spec @@ -1,34 +1,28 @@ -# if not defined, we use icinga as dependency: -%define mon icinga -# command to install: -# rpmbuild -ba --define "with_nagios 1" --sign SPECS/pnp4nagios.spec -%{?with_nagios:%define mon nagios} - Name: pnp4nagios Version: 0.6.25 -Release: 1003%{?dist} -Summary: Nagios/Icinga performance data analysis tool +Release: 4%{?dist} +Summary: Nagios performance data analysis tool Group: Applications/System License: GPLv2 -URL: http://www.%{name}.org/ +URL: http://www.pnp4nagios.org/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -Source1: %{name}.logrotate.conf -Source2: %{name}-npcd.sysvinit -Source3: %{name}-README.fedora +Source1: pnp4nagios.logrotate.conf +Source2: pnp4nagios-npcd.sysvinit +Source3: pnp4nagios-README.fedora +Patch1: pnp4nagios-httpd24.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf, automake, libtool BuildRequires: rrdtool-perl BuildRequires: perl(Time::HiRes) -Requires: %mon +Requires: nagios Requires: rrdtool-perl Requires: php-gd Requires(post): chkconfig Requires(preun): chkconfig Requires(preun): initscripts Requires(postun): initscripts -Provides: /bin/perl %description PNP is an addon to nagios which analyzes performance data provided by plugins @@ -37,24 +31,24 @@ and stores them automatically into RRD-databases. %prep %setup -q +%patch1 -p1 autoreconf cp -p %{SOURCE3} README.fedora -sed -i -e 's/^INSTALL_OPTS="-o %{mon} -g %{mon}"/INSTALL_OPTS=""/' configure +sed -i -e 's/^INSTALL_OPTS="-o $nagios_user -g $nagios_grp"/INSTALL_OPTS=""/' \ + configure sed -i -e '/^\t$(MAKE) strip-post-install$/d' src/Makefile.in %build %configure --bindir=%{_sbindir} \ - --libexecdir=%{_libexecdir}/%{name} \ - --sysconfdir=%{_sysconfdir}/%{name} \ - --localstatedir=%{_localstatedir}/log/%{name} \ - --datadir=%{_datadir}/%{name}/html \ - --datarootdir=%{_datadir}/%{name}/html \ - --with-perfdata-dir=%{_localstatedir}/lib/%{name} \ - --with-perfdata-spool-dir=%{_localstatedir}/spool/%{name} \ - --with-nagios_user=%{mon} \ - --with-nagios_group=%{mon} + --libexecdir=%{_libexecdir}/%{name} \ + --sysconfdir=%{_sysconfdir}/%{name} \ + --localstatedir=%{_localstatedir}/log/%{name} \ + --datadir=%{_datadir}/nagios/html/%{name} \ + --datarootdir=%{_datadir}/nagios/html/%{name} \ + --with-perfdata-dir=%{_localstatedir}/lib/%{name} \ + --with-perfdata-spool-dir=%{_localstatedir}/spool/%{name} make %{?_smp_mflags} all @@ -63,8 +57,8 @@ rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT make install-config DESTDIR=$RPM_BUILD_ROOT # remove -sample from filename suffix -for i in $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/*-sample \ - $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/*/*-sample +for i in $RPM_BUILD_ROOT/%{_sysconfdir}/pnp4nagios/*-sample \ + $RPM_BUILD_ROOT/%{_sysconfdir}/pnp4nagios/*/*-sample do mv ${i} ${i%%-sample} done @@ -74,23 +68,23 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config_local.php mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name} mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name} mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name} -install -Dp -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} +install -Dp -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pnp4nagios install -Dp -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/npcd mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d -sed 's|/usr/local/nagios/etc/htpasswd.users|/etc/%{mon}/passwd|' \ +sed 's|/usr/local/nagios/etc/htpasswd.users|/etc/nagios/passwd|' \ sample-config/httpd.conf \ > $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf -mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{mon}/brokers +mkdir -p $RPM_BUILD_ROOT%{_libdir}/nagios/brokers mv $RPM_BUILD_ROOT%{_libdir}/npcdmod.o \ - $RPM_BUILD_ROOT%{_libdir}/%{mon}/brokers/npcdmod.o + $RPM_BUILD_ROOT%{_libdir}/nagios/brokers/npcdmod.o mv $RPM_BUILD_ROOT%{_prefix}/man $RPM_BUILD_ROOT%{_datadir}/ # Move kohana to pnp4nagios, there is another kohana in fedore/EPEL, # which can be installed. mv $RPM_BUILD_ROOT%{_libdir}/kohana \ - $RPM_BUILD_ROOT%{_datadir}/%{name}/html/kohana -sed -i 's|%{_libdir}/kohana|%{_datadir}/%{name}/html/kohana|' \ - $RPM_BUILD_ROOT%{_datadir}/%{name}/html/index.php + $RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/kohana +sed -i 's|%{_libdir}/kohana|%{_datadir}/nagios/html/%{name}/kohana|' \ + $RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/index.php %clean rm -rf $RPM_BUILD_ROOT @@ -117,55 +111,29 @@ fi %defattr(644,root,root,755) %doc AUTHORS ChangeLog COPYING INSTALL README README.fedora %doc THANKS contrib/ -%dir %{_sysconfdir}/%{name} -%config(noreplace) %attr(0640,root,%{mon}) %{_sysconfdir}/%{name}/process_perfdata.cfg -%config(noreplace) %{_sysconfdir}/%{name}/background.pdf -%config(noreplace) %{_sysconfdir}/%{name}/check_commands/*.cfg -%config(noreplace) %{_sysconfdir}/%{name}/config.d -%config(noreplace) %{_sysconfdir}/%{name}/config.php -%config(noreplace) %{_sysconfdir}/%{name}/misccommands.cfg -%config(noreplace) %{_sysconfdir}/%{name}/nagios.cfg -%config(noreplace) %{_sysconfdir}/%{name}/npcd.cfg -%config(noreplace) %{_sysconfdir}/%{name}/pages/* -%config(noreplace) %{_sysconfdir}/%{name}/rra.cfg -%config %{_sysconfdir}/%{name}/pnp4nagios_release +%dir %{_sysconfdir}/pnp4nagios +%config(noreplace) %attr(0640,root,nagios) %{_sysconfdir}/pnp4nagios/process_perfdata.cfg +%config(noreplace) %{_sysconfdir}/pnp4nagios/* %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf %attr(755,root,root) %{_initrddir}/npcd %attr(755,root,root) %{_sbindir}/npcd -%{_libdir}/%{mon}/brokers/npcdmod.o +%{_libdir}/nagios/brokers/npcdmod.o %dir %{_libexecdir}/%{name} %attr(755,root,root) %{_libexecdir}/%{name}/* -%attr(755,%{mon},%{mon}) %{_localstatedir}/lib/%{name} -%attr(755,%{mon},%{mon}) %{_localstatedir}/log/%{name} -%attr(755,%{mon},%{mon}) %{_localstatedir}/spool/%{name} -%{_datadir}/%{name}/html/application -%{_datadir}/%{name}/html/documents -%{_datadir}/%{name}/html/index.php -%{_datadir}/%{name}/html/media -%{_datadir}/%{name}/html/templates.dist -%{_datadir}/%{name}/html/templates -%{_datadir}/%{name}/html/templates.special +%attr(755,nagios,nagios) %{_localstatedir}/lib/%{name} +%attr(755,nagios,nagios) %{_localstatedir}/log/%{name} +%attr(755,nagios,nagios) %{_localstatedir}/spool/%{name} +%{_datadir}/nagios/html/%{name} # Remove install check script # as it is not required if all dependencies are met. -%exclude %{_datadir}/%{name}/html/install.php +%exclude %{_datadir}/nagios/html/%{name}/install.php %{_mandir}/man8/* # This is a different version of Kohana like in Fedora/EPEL. # Needed for pnp4nagios web interface to work. -%{_datadir}/%{name}/html/kohana +%{_datadir}/nagios/html/%{name}/kohana %changelog -* Thu Apr 23 2015 -- New perl version. -* Tue Feb 24 2015 -- New perl version. -* Thu Jan 8 2015 -- Update to 0.6.25. -* Fri Oct 17 2014 -- Perl version changed on system. -* Thu Aug 7 2014 -- Update to 0.6.24. -* Fri Jul 11 2014 -- Update to 0.6.22. -* Sat Dec 7 2013 -- New package. +* Tue Jul 11 2017 Daniel Steiner - 0.6.25-4 +- Rebuilt for Fedora 25 + From dcfe144792c910a24cabd878ed2b5f927cfc31b4 Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Sun, 16 Jul 2017 11:58:24 +0200 Subject: [PATCH 2/8] New goaccess package. --- fedora/SPECS/goaccess.spec | 89 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 fedora/SPECS/goaccess.spec diff --git a/fedora/SPECS/goaccess.spec b/fedora/SPECS/goaccess.spec new file mode 100644 index 0000000..53f25fd --- /dev/null +++ b/fedora/SPECS/goaccess.spec @@ -0,0 +1,89 @@ +Name: goaccess +Version: 1.2 +Release: 1%{?dist} +Summary: Real-time web log analyzer and interactive viewer +License: GPLv2+ +URL: https://goaccess.io/ +Source0: http://tar.goaccess.io/%{name}-%{version}.tar.gz +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: gcc +BuildRequires: GeoIP-devel +BuildRequires: ncurses-devel +BuildRequires: tokyocabinet-devel +BuildRequires: zlib-devel +BuildRequires: bzip2-devel + +%description +GoAccess is a real-time web log analyzer and interactive viewer that runs in a +terminal in *nix systems. It provides fast and valuable HTTP statistics for +system administrators that require a visual server report on the fly. + +Features: +GoAccess parses the specified web log file and outputs the data to terminal. + +* General statistics, bandwidth, etc. +* Time taken to serve the request (useful to track pages that are slowing down. +your site). +* Metrics for cumulative, average and slowest running requests. +* Top visitors. +* Requested files & static files. +* 404 or Not Found. +* Hosts, Reverse DNS, IP Location. +* Operating Systems. +* Browsers and Spiders. +* Referring Sites & URLs. +* Keyphrases. +* Geo Location - Continent/Country/City. +* Visitors Time Distribution. +* HTTP Status Codes. +* Ability to output JSON and CSV. +* Tailor GoAccess to suit your own color taste/schemes. +* Support for large datasets + data persistence. +* Support for IPv6. +* Output statistics to HTML. +and more... + +GoAccess allows any custom log format string. Predefined options include, but +not limited to: + +* Amazon CloudFront (Download Distribution). +* AWS Elastic Load Balancing. +* Apache/Nginx Common/Combined + VHosts. +* Google Cloud Storage. +* W3C format (IIS). + +%prep +%setup -q +# Prevent flags being overridden again and again. +#sed -i 's|-pthread|$CFLAGS \0|' configure.ac +sed -i '/-pthread/d' configure.ac + +%build +autoreconf -fiv +%configure \ + --enable-debug \ + --enable-geoip \ + --enable-utf8 \ + --enable-tcb=btree \ + --with-getline \ + --with-openssl \ + --enable-bzip \ + --enable-zlib + +%make_build + +%install +%make_install + +%files +%license COPYING +%config(noreplace) %{_sysconfdir}/%{name}.conf +%{_bindir}/%{name} +%{_mandir}/man1/%{name}.1* +%{_pkgdocdir} + +%changelog +* Sun Jul 16 2017 Daniel Steiner - 1.2-1 +- Initial release for Fedora 25. + From d64543ff42a2996ef8e12cb29f2c9b535d3cddbd Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Sun, 16 Jul 2017 16:20:37 +0200 Subject: [PATCH 3/8] Some fixes and systemd service added. --- fedora/SPECS/goaccess.spec | 39 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/fedora/SPECS/goaccess.spec b/fedora/SPECS/goaccess.spec index 53f25fd..16ea895 100644 --- a/fedora/SPECS/goaccess.spec +++ b/fedora/SPECS/goaccess.spec @@ -1,10 +1,13 @@ Name: goaccess Version: 1.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Real-time web log analyzer and interactive viewer License: GPLv2+ URL: https://goaccess.io/ Source0: http://tar.goaccess.io/%{name}-%{version}.tar.gz +Source1: %{name}.service +Source2: %{name}-get-logs.pl +Source3: %{name}-sysconfig BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc @@ -14,6 +17,12 @@ BuildRequires: tokyocabinet-devel BuildRequires: zlib-devel BuildRequires: bzip2-devel +%if 0%{?using_systemd} +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%endif + %description GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems. It provides fast and valuable HTTP statistics for @@ -63,7 +72,7 @@ sed -i '/-pthread/d' configure.ac autoreconf -fiv %configure \ --enable-debug \ - --enable-geoip \ + --enable-geoip=legacy \ --enable-utf8 \ --enable-tcb=btree \ --with-getline \ @@ -75,6 +84,25 @@ autoreconf -fiv %install %make_install +# install additional systemd service +install -D %{S:2} %{buildroot}%{_libexecdir}/%{name}-get-logs.pl +install -D %{S:1} %{buildroot}%{_unitdir}/%{name}.service +install -D %{S:3} %{buildroot}%{_sysconfdir}/sysconfig/%{name} +install -d %{buildroot}%{_var}/www/html/%{name} + +%post +%if 0%{?using_systemd} +%if 0%{?systemd_macro_scriptlet} +%systemd_post %{name}.service +%endif +%endif + +%postun +%if 0%{?using_systemd} +%if 0%{?systemd_macro_scriptlet} +%systemd_preun %{name}.service +%endif +%endif %files %license COPYING @@ -82,8 +110,15 @@ autoreconf -fiv %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* %{_pkgdocdir} +%{_unitdir}/%{name}.service +%dir %{_var}/www/html/%{name} +%attr(755,-,-) %{_libexecdir}/%{name}-get-logs.pl +%config() %{_sysconfdir}/sysconfig/%{name} %changelog +* Sun Jul 16 2017 Daniel Steiner - 1.2-2 +- Legacy GeoIP enabled. + * Sun Jul 16 2017 Daniel Steiner - 1.2-1 - Initial release for Fedora 25. From 33f23cdd9e520161cb570b30a1a4791c99fccd37 Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Sun, 16 Jul 2017 23:18:19 +0200 Subject: [PATCH 4/8] Better systemd integration with new config file --- fedora/SPECS/goaccess.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fedora/SPECS/goaccess.spec b/fedora/SPECS/goaccess.spec index 16ea895..9e086d0 100644 --- a/fedora/SPECS/goaccess.spec +++ b/fedora/SPECS/goaccess.spec @@ -1,6 +1,6 @@ Name: goaccess Version: 1.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Real-time web log analyzer and interactive viewer License: GPLv2+ URL: https://goaccess.io/ @@ -8,6 +8,7 @@ Source0: http://tar.goaccess.io/%{name}-%{version}.tar.gz Source1: %{name}.service Source2: %{name}-get-logs.pl Source3: %{name}-sysconfig +Source4: %{name}-systemd.conf BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc @@ -88,6 +89,7 @@ autoreconf -fiv install -D %{S:2} %{buildroot}%{_libexecdir}/%{name}-get-logs.pl install -D %{S:1} %{buildroot}%{_unitdir}/%{name}.service install -D %{S:3} %{buildroot}%{_sysconfdir}/sysconfig/%{name} +install -D %{S:4} %{buildroot}%{_sysconfdir}/%{name}-systemd.conf install -d %{buildroot}%{_var}/www/html/%{name} %post @@ -114,8 +116,12 @@ install -d %{buildroot}%{_var}/www/html/%{name} %dir %{_var}/www/html/%{name} %attr(755,-,-) %{_libexecdir}/%{name}-get-logs.pl %config() %{_sysconfdir}/sysconfig/%{name} +%config(noreplace) %{_sysconfdir}/%{name}-systemd.conf %changelog +* Sun Jul 16 2017 Daniel Steiner - 1.2-3 +- Live status enable with systemd + * Sun Jul 16 2017 Daniel Steiner - 1.2-2 - Legacy GeoIP enabled. From c2fb0fcfb304dbbc8e1925e70815f0e20f5a0f1f Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Tue, 18 Jul 2017 18:29:15 +0200 Subject: [PATCH 5/8] Changes for Fedora26 --- fedora/SPECS/goaccess.spec | 2 +- fedora/SPECS/kodi.spec | 143 ++++++++++++++++--------------------- fedora/SPECS/lnav.spec | 57 ++------------- 3 files changed, 67 insertions(+), 135 deletions(-) diff --git a/fedora/SPECS/goaccess.spec b/fedora/SPECS/goaccess.spec index 9e086d0..0559388 100644 --- a/fedora/SPECS/goaccess.spec +++ b/fedora/SPECS/goaccess.spec @@ -77,7 +77,7 @@ autoreconf -fiv --enable-utf8 \ --enable-tcb=btree \ --with-getline \ - --with-openssl \ + --with-openssl=%{_prefix} \ --enable-bzip \ --enable-zlib diff --git a/fedora/SPECS/kodi.spec b/fedora/SPECS/kodi.spec index 6c32fd0..cc1c522 100644 --- a/fedora/SPECS/kodi.spec +++ b/fedora/SPECS/kodi.spec @@ -1,14 +1,13 @@ -#global PRERELEASE rc1 -%global myversion 17.3 -%global DIRVERSION %{myversion} +#global PRERELEASE rc4 +%global DIRVERSION %{version} #global GITCOMMIT Gotham_r2-ge988513 # use the line below for pre-releases #global DIRVERSION %{version}%{PRERELEASE} %global _hardened_build 1 -%define debug_package %{nil} +%global _with_dvd 0 Name: kodi -Version: %myversion +Version: 17.3 Release: 1%{?dist} Summary: Media center @@ -25,25 +24,24 @@ Source0: %{name}-%{DIRVERSION}-patched.tar.xz # ./kodi-generate-tarball-xz.sh Source1: kodi-generate-tarball-xz.sh -# filed ticket, but patch still needs work -# http://trac.xbmc.org/ticket/9658 -Patch1: xbmc-13.0-dvdread.patch +%if 0%{?_with_dvd} +# kodi uses modified libdvd{css,nav,read} source and downloads at build time +# wget -O kodi-libdvdnav-master.tar.gz https://github.com/xbmc/libdvdnav/archive/master.tar.gz +Source2: kodi-libdvdnav-master.tar.gz +# wget -O kodi-libdvdread-master.tar.gz https://github.com/xbmc/libdvdread/archive/master.tar.gz +Source3: kodi-libdvdread-master.tar.gz +# wget -O kodi-libdvdcss-master.tar.gz https://github.com/xbmc/libdvdcss/archive/master.tar.gz +Source4: kodi-libdvdcss-master.tar.gz +%endif # Set program version parameters -Patch2: kodi-16.0-versioning.patch +Patch1: kodi-16.0-versioning.patch -# Remove call to internal ffmpeg function (misued anyway) -Patch3: kodi-14.0-dvddemux-ffmpeg.patch +# Drop DVD library support +Patch2: kodi-17a2-libdvd.patch -# Disable dcadec library detection when using external ffmpeg (dcadec is only -# needed to build bundled ffmpeg) -Patch4: kodi-16.0-dcadec.patch - -Patch5: ffmpeg-2.9.patch - -Patch6: gcc6.patch -Patch7: kodi-avicodec.patch -Patch8: kodi-AEDefines_disable.patch +# Problem with variable definitions in FTPParse module: +Patch3: kodi-ftpparse.patch # Optional deps (not in EPEL) %if 0%{?fedora} @@ -61,7 +59,8 @@ Patch8: kodi-AEDefines_disable.patch %endif # Upstream does not support ppc64 -ExcludeArch: ppc64 +# ARM support is restricted to one GPU per build +ExclusiveArch: i686 x86_64 BuildRequires: SDL2-devel BuildRequires: SDL_image-devel @@ -102,6 +101,7 @@ BuildRequires: gperf BuildRequires: jasper-devel BuildRequires: java-devel BuildRequires: lame-devel +BuildRequires: lcms2-devel BuildRequires: libXinerama-devel BuildRequires: libXmu-devel BuildRequires: libXtst-devel @@ -112,14 +112,17 @@ BuildRequires: libbluray-devel BuildRequires: libcap-devel BuildRequires: libcdio-devel %if 0%{?_with_libcec} -BuildRequires: libcec-devel >= 3.0.0 +%if 0%{?fedora} > 24 +BuildRequires: libcec-devel >= 4.0.0 +%else +BuildRequires: libcec-devel < 4.0.0 +%endif %endif %if 0%{?_with_crystalhd} BuildRequires: libcrystalhd-devel %endif BuildRequires: libcurl-devel BuildRequires: libdca-devel -BuildRequires: libdvdread-devel %if 0%{?el6} BuildRequires: libjpeg-devel %else @@ -183,7 +186,7 @@ BuildRequires: weston-devel BuildRequires: yajl-devel BuildRequires: zlib-devel -Requires: google-roboto-fonts +Requires: dejavu-sans-fonts # need explicit requires for these packages # as they are dynamically loaded via XBMC's arcane # pseudo-DLL loading scheme (sigh) @@ -191,7 +194,11 @@ Requires: google-roboto-fonts Requires: libbluray%{?_isa} %endif %if 0%{?_with_libcec} -Requires: libcec%{?_isa} >= 3.0.0 +%if 0%{?fedora} > 24 +Requires: libcec%{?_isa} >= 4.0.0 +%else +Requires: libcec%{?_isa} < 4.0.0 +%endif %endif %if 0%{?_with_crystalhd} Requires: libcrystalhd%{?_isa} @@ -253,16 +260,15 @@ library. %prep %setup -q -n %{name}-%{DIRVERSION} -#%patch1 -p1 -%patch2 -p1 -#%patch3 -p0 -#%patch4 -p0 -#%patch5 -p1 -#%if 0%{?fedora} >= 24 -#%patch6 -p1 -#%endif -%patch7 -%patch8 +%patch1 -p1 -b.versioning +%if 0%{?_with_dvd} +cp -p %{SOURCE2} tools/depends/target/libdvdnav/libdvdnav-master.tar.gz +cp -p %{SOURCE3} tools/depends/target/libdvdread/libdvdread-master.tar.gz +cp -p %{SOURCE4} tools/depends/target/libdvdcss/libdvdcss-master.tar.gz +%else +%patch2 -p1 -b.libdvd +%endif +%patch3 -p0 -b.ftpparse %build @@ -292,29 +298,29 @@ chmod +x bootstrap %else --disable-ssh \ %endif +%if ! 0%{?_with_dvd} +--disable-optical-drive \ +%endif --disable-optimizations --disable-debug \ %ifnarch %{arm} --enable-gl \ --disable-gles \ --enable-vdpau \ %else +--enable-gl \ --enable-gles \ ---disable-vdpau \ ---disable-vaapi \ +--enable-vdpau \ +--enable-vaapi \ %ifarch armv7hl \ --enable-tegra \ ---disable-neon \ -%endif -%ifarch armv7hnl ---enable-neon \ %endif %endif CFLAGS="$RPM_OPT_FLAGS -fPIC -I/usr/include/afpfs-ng/ -I/usr/include/samba-4.0/ -D__STDC_CONSTANT_MACROS" \ CXXFLAGS="$RPM_OPT_FLAGS -fPIC -I/usr/include/afpfs-ng/ -I/usr/include/samba-4.0/ -D__STDC_CONSTANT_MACROS" \ -LDFLAGS="-fPIC" \ +LDFLAGS="$RPM_LD_FLAGS -fPIC" \ ASFLAGS=-fPIC -make %{?_smp_mflags} VERBOSE=1 +make %{?_smp_mflags} V=1 %install @@ -328,6 +334,9 @@ desktop-file-install \ --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ $RPM_BUILD_ROOT%{_datadir}/applications/kodi.desktop +# Stop shipping the duplicate xsession file +rm -f $RPM_BUILD_ROOT/%{_datadir}/xsessions/xbmc.desktop + # Normally we are expected to build these manually. But since we are using # the system Python interpreter, we also want to use the system libraries install -d $RPM_BUILD_ROOT%{_libdir}/kodi/addons/script.module.pil/lib @@ -335,9 +344,8 @@ ln -s %{python_sitearch}/PIL $RPM_BUILD_ROOT%{_libdir}/kodi/addons/script.module #install -d $RPM_BUILD_ROOT%{_libdir}/xbmc/addons/script.module.pysqlite/lib #ln -s %{python_sitearch}/pysqlite2 $RPM_BUILD_ROOT%{_libdir}/xbmc/addons/script.module.pysqlite/lib/pysqlite2 -# Use external Roboto font files instead of bundled ones -#ln -sf %{_fontbasedir}/google-roboto/Roboto-Regular.ttf ${RPM_BUILD_ROOT}%{_datadir}/kodi/addons/skin.confluence/fonts/ -#ln -sf %{_fontbasedir}/google-roboto/Roboto-Bold.ttf ${RPM_BUILD_ROOT}%{_datadir}/kodi/addons/skin.confluence/fonts/ +# Use external font files instead of bundled ones +ln -sf %{_fontbasedir}/dejavu/DejaVuSans-Bold.ttf ${RPM_BUILD_ROOT}%{_datadir}/kodi/addons/skin.estouchy/fonts/ # Move man-pages into system dir mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/ @@ -358,7 +366,9 @@ fi %posttrans /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : if [ ! -L %{_libdir}/xbmc ] ; then - rmdir %{_libdir}/xbmc %{_datadir}/xbmc + if [ -d %{_libdir}/xbmc ] ; then + rmdir %{_libdir}/xbmc %{_datadir}/xbmc + fi ln -s kodi ${RPM_BUILD_ROOT}%{_libdir}/xbmc ln -s kodi ${RPM_BUILD_ROOT}%{_datadir}/xbmc fi @@ -366,7 +376,9 @@ fi %posttrans devel if [ ! -L %{_includedir}/xbmc ] ; then - rmdir %{_includedir}/xbmc + if [ -d %{_includedir}/xbmc ] ; then + rmdir %{_includedir}/xbmc + fi ln -s kodi ${RPM_BUILD_ROOT}%{_includedir}/xbmc fi @@ -383,7 +395,6 @@ fi %{_datadir}/kodi %ghost %{_datadir}/xbmc %{_datadir}/xsessions/kodi.desktop -%{_datadir}/xsessions/xbmc.desktop %{_datadir}/applications/kodi.desktop %{_datadir}/icons/hicolor/*/*/*.png %{_mandir}/man1/kodi.1.gz @@ -416,36 +427,6 @@ fi %changelog -* Thu Jun 6 2017 Daniel Steiner -- Update to Krypton 17.3 - -* Sat Feb 25 2017 Daniel Steiner -- Update to Krypton 17.1rc1 - -* Wed Feb 8 2017 Daniel Steiner -- Update to Krypton Final - -* Sun Jan 29 2017 Daniel Steiner -- Update to Krypton RC 4 - -* Sat Jan 14 2017 Daniel Steiner -- Update to Krypton RC 3 - -* Sat Dec 3 2016 Daniel Steiner -- Update to Krypton Beta6 - -* Fri Nov 25 2016 Daniel Steiner -- Update to Krypton Beta5, built on Fedora 25 - -* Wed Oct 26 2016 Daniel Steiner -- Update to Krypton Beta4 - -* Thu Oct 6 2016 Daniel Steiner -- Update to Krypton Beta3 - -* Tue Sep 20 2016 Daniel Steiner -- Update to Krypton Beta2 - -* Sun Jul 31 2016 Daniel Steiner -- New build for Fedora 24 +* Tue Jul 18 2017 Daniel Steiner - 17.3-1 +- Kodi 17.3 final for Fedora 26 diff --git a/fedora/SPECS/lnav.spec b/fedora/SPECS/lnav.spec index 058dbab..6067c3b 100644 --- a/fedora/SPECS/lnav.spec +++ b/fedora/SPECS/lnav.spec @@ -1,6 +1,6 @@ Name: lnav -Version: 0.8.0 -Release: 2%{?dist} +Version: 0.8.2 +Release: 1%{?dist} Summary: Curses-based tool for viewing and analyzing log files License: BSD URL: http://lnav.org @@ -48,54 +48,5 @@ autoreconf -fiv %{_mandir}/man1/lnav.1* %changelog -* Tue Feb 23 2016 Daniel Steiner -- Relinking for sqlite3 libraries. - -* Sat Jan 9 2016 Daniel Steiner -- Upgrade to 0.8.0. - -* Wed Jun 17 2015 Fedora Release Engineering - 0.7.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Sat May 02 2015 Kalev Lember - 0.7.2-2 -- Rebuilt for GCC 5 C++11 ABI change - -* Thu Mar 05 2015 Christopher Meng - 0.7.2-1 -- Update to 0.7.2 - -* Tue Nov 25 2014 Christopher Meng - 0.7.1-1 -- Update to 0.7.1 - -* Sun Aug 17 2014 Fedora Release Engineering - 0.7.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Sat Jun 07 2014 Fedora Release Engineering - 0.7.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Fri Apr 04 2014 Dan HorĂ¡k - 0.7.0-2 -- fix build on big endian arches - -* Tue Apr 01 2014 Christopher Meng - 0.7.0-1 -- Update to 0.7.0 - -* Thu Nov 21 2013 Christopher Meng - 0.6.2-1 -- Update to 0.6.2 - -* Thu Sep 12 2013 Christopher Meng - 0.6.1-1 -- Update to 0.6.1 -- Add python BR for environ detection. - -* Sat Aug 03 2013 Fedora Release Engineering - 0.5.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Thu May 09 2013 Christopher Meng - 0.5.1-2 -- Cleanup old stuffs. - -* Fri May 03 2013 Christopher Meng - 0.5.1-1 -- Update to 0.5.1 - -* Fri May 03 2013 Christopher Meng - 0.5.0-2 -- Patch with automake foreign option in order to support aarch64 - -* Sat Apr 27 2013 Christopher Meng - 0.5.0-1 -- Initial Package. +* Tue Jul 18 2017 Daniel Steiner +- First build for Fedora 26 From cb6587e1b3887c8ce37d59e0757fb31c88ce4596 Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Sat, 22 Jul 2017 01:46:34 +0200 Subject: [PATCH 6/8] Problem with sting to integer resolved, needed for pHP 7.1 --- fedora/SPECS/pnp4nagios.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fedora/SPECS/pnp4nagios.spec b/fedora/SPECS/pnp4nagios.spec index 2a30ea4..df7b308 100644 --- a/fedora/SPECS/pnp4nagios.spec +++ b/fedora/SPECS/pnp4nagios.spec @@ -1,6 +1,6 @@ Name: pnp4nagios Version: 0.6.25 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Nagios performance data analysis tool Group: Applications/System @@ -11,6 +11,7 @@ Source1: pnp4nagios.logrotate.conf Source2: pnp4nagios-npcd.sysvinit Source3: pnp4nagios-README.fedora Patch1: pnp4nagios-httpd24.patch +Patch2: pnp4nagios-pnp-helper.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf, automake, libtool @@ -23,6 +24,8 @@ Requires(post): chkconfig Requires(preun): chkconfig Requires(preun): initscripts Requires(postun): initscripts +# otherwise not installable: +Provides: /bin/perl %description PNP is an addon to nagios which analyzes performance data provided by plugins @@ -32,6 +35,7 @@ and stores them automatically into RRD-databases. %prep %setup -q %patch1 -p1 +%patch2 -p0 autoreconf cp -p %{SOURCE3} README.fedora @@ -134,6 +138,9 @@ fi %{_datadir}/nagios/html/%{name}/kohana %changelog +* Sat Jul 22 2017 Daniel Steiner - 0.6.25-5 +- PHP error fixed in pnp.php helper module + * Tue Jul 11 2017 Daniel Steiner - 0.6.25-4 - Rebuilt for Fedora 25 From dc6167cf0b038911abf83df42786562464a7f5de Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Sat, 22 Jul 2017 01:47:13 +0200 Subject: [PATCH 7/8] Several problems fixed for Fedora 26 --- fedora/SPECS/icinga2.spec | 755 ++++++++++++++++++++++++++++ fedora/SPECS/icingaweb2.spec | 356 ++++++++++++++ fedora/SPECS/nagios-plugins.spec | 815 +++++++++++++++++++++++++++++++ 3 files changed, 1926 insertions(+) create mode 100644 fedora/SPECS/icinga2.spec create mode 100644 fedora/SPECS/icingaweb2.spec create mode 100644 fedora/SPECS/nagios-plugins.spec diff --git a/fedora/SPECS/icinga2.spec b/fedora/SPECS/icinga2.spec new file mode 100644 index 0000000..80828f9 --- /dev/null +++ b/fedora/SPECS/icinga2.spec @@ -0,0 +1,755 @@ +#/****************************************************************************** +# * Icinga 2 * +# * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/) * +# * * +# * This program is free software; you can redistribute it and/or * +# * modify it under the terms of the GNU General Public License * +# * as published by the Free Software Foundation; either version 2 * +# * of the License, or (at your option) any later version. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU General Public License for more details. * +# * * +# * You should have received a copy of the GNU General Public License * +# * along with this program; if not, write to the Free Software Foundation * +# * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * +# ******************************************************************************/ + +%define revision 1 + +# make sure that _rundir is working on older systems +%if ! %{defined _rundir} +%define _rundir %{_localstatedir}/run +%endif + +%define _libexecdir %{_prefix}/lib/ + +%if "%{_vendor}" == "redhat" +%define apachename httpd +%define apacheconfdir %{_sysconfdir}/httpd/conf.d +%define apacheuser apache +%define apachegroup apache +%if 0%{?el5}%{?el6} +%define use_systemd 0 +%if %(uname -m) != "x86_64" +%define march_flag -march=i686 +%endif +%else +# fedora and el>=7 +%define use_systemd 1 +%endif +%endif + +%if "%{_vendor}" == "suse" +%define apachename apache2 +%define apacheconfdir %{_sysconfdir}/apache2/conf.d +%define apacheuser wwwrun +%define apachegroup www +%if 0%{?suse_version} >= 1310 +%define use_systemd 1 +%else +%define use_systemd 0 +%endif +%endif + +%define icinga_user icinga +%define icinga_group icinga +%define icingacmd_group icingacmd +%define icingaweb2name icingaweb2 +%define icingaweb2version 2.0.0 + +%define icingaclassicconfdir %{_sysconfdir}/icinga + +%define logmsg logger -t %{name}/rpm + +Summary: Network monitoring application +Name: icinga2 +Version: 2.6.3 +Release: %{revision}%{?dist} +License: GPL-2.0+ +Group: Applications/System +Source: icinga2.tar.gz +URL: https://www.icinga.com/ +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Requires: %{name}-bin = %{version}-%{release} + +%description +Meta package for Icinga 2 Core, DB IDO and Web. + +%package bin +Summary: Icinga 2 binaries and libraries +Group: Applications/System + +%if "%{_vendor}" == "suse" +PreReq: permissions +Provides: monitoring_daemon +Recommends: monitoring-plugins +%if 0%{?suse_version} >= 1310 +BuildRequires: libyajl-devel +%endif +%endif +BuildRequires: libedit-devel +BuildRequires: ncurses-devel +%if "%{_vendor}" == "suse" && 0%{?suse_version} < 1210 +BuildRequires: gcc48-c++ +BuildRequires: libstdc++48-devel +BuildRequires: libopenssl1-devel +%else +BuildRequires: gcc-c++ +BuildRequires: libstdc++-devel +BuildRequires: openssl-devel +%endif +BuildRequires: cmake +BuildRequires: flex >= 2.5.35 +BuildRequires: bison +BuildRequires: make +%if 0%{?fedora} +BuildRequires: wxGTK3-devel +%endif + +%if 0%{?build_icinga_org} && "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") +# el5 and el6 require packages.icinga.com +BuildRequires: boost153-devel +%else +%if 0%{?build_icinga_org} && "%{_vendor}" == "suse" && 0%{?suse_version} < 1310 +# sles 11 sp3 requires packages.icinga.com +BuildRequires: boost153-devel +%else +BuildRequires: boost-devel >= 1.41 +%endif +%endif + +%if 0%{?use_systemd} +BuildRequires: systemd +Requires: systemd +%endif + +Requires: %{name}-libs = %{version}-%{release} + +%description bin +Icinga 2 is a general-purpose network monitoring application. +Provides binaries for Icinga 2 Core. + +%package common +Summary: Common Icinga 2 configuration +Group: Applications/System +%if "%{_vendor}" == "redhat" +Requires(pre): shadow-utils +Requires(post): shadow-utils +%endif +%if "%{_vendor}" == "suse" +Recommends: logrotate +%endif + +%description common +Provides common directories, uid and gid among Icinga 2 related +packages. + + +%package doc +Summary: Documentation for Icinga 2 +Group: Applications/System +Requires: %{name} = %{version}-%{release} + +%description doc +Provides documentation for Icinga 2. + + +%package libs +Summary: Libraries for Icinga 2 +Group: Applications/System +Requires: %{name}-common = %{version}-%{release} + +%description libs +Provides internal libraries for the daemon or studio. + + +%package ido-mysql +Summary: IDO MySQL database backend for Icinga 2 +Group: Applications/System +%if "%{_vendor}" == "suse" +BuildRequires: libmysqlclient-devel +%if 0%{?suse_version} >= 1310 +BuildRequires: mysql-devel +%endif + +%else +BuildRequires: mysql-devel +%endif #suse + +Requires: %{name} = %{version}-%{release} + +%description ido-mysql +Icinga 2 IDO mysql database backend. Compatible with Icinga 1.x +IDOUtils schema >= 1.12 + + +%package ido-pgsql +Summary: IDO PostgreSQL database backend for Icinga 2 +Group: Applications/System +%if "%{_vendor}" == "suse" && 0%{?suse_version} < 1210 +BuildRequires: postgresql-devel >= 8.4 +%else +BuildRequires: postgresql-devel +%endif +Requires: %{name} = %{version}-%{release} + +%description ido-pgsql +Icinga 2 IDO PostgreSQL database backend. Compatible with Icinga 1.x +IDOUtils schema >= 1.12 + + +%package classicui-config +Summary: Icinga 2 Classic UI Standalone configuration +Group: Applications/System +BuildRequires: %{apachename} +Requires: %{apachename} +Requires: %{name} = %{version}-%{release} +%if "%{_vendor}" == "suse" +Recommends: icinga-www +%endif +Provides: icinga-classicui-config +Conflicts: icinga-gui-config + +%description classicui-config +Icinga 1.x Classic UI Standalone configuration with locations +for Icinga 2. + +%if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") +%global selinux_variants mls targeted +#%{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2>/dev/null)} +%global modulename %{name} + +%package selinux +Summary: SELinux policy module supporting icinga2 +Group: System Environment/Base +#BuildRequires: checkpolicy, selinux-policy-devel, /usr/share/selinux/devel/policyhelp, hardlink +BuildRequires: checkpolicy, selinux-policy-devel, hardlink +%if "%{_selinux_policy_version}" != "" +Requires: selinux-policy >= %{_selinux_policy_version} +%endif +Requires: %{name} = %{version}-%{release} +Requires(post): /usr/sbin/semodule, /sbin/restorecon +Requires(postun): /usr/sbin/semodule, /sbin/restorecon + +%description selinux +SELinux policy module supporting icinga2 +%endif + + +%if 0%{?fedora} +%package studio +Summary: Studio for Icinga 2 +Group: Applications/System +Requires: %{name}-libs = %{version}-%{release} +Requires: wxGTK3 + +%description studio +Provides a GUI for the Icinga 2 API. +%endif + + +%package -n vim-icinga2 +Summary: Vim syntax highlighting for icinga2 +Group: Applications/System +%if "%{_vendor}" == "suse" +Requires: vim-data +%else +Requires: vim-filesystem +%endif + +%description -n vim-icinga2 +Vim syntax highlighting for icinga2 + + +%package -n nano-icinga2 +Summary: Nano syntax highlighting for icinga2 +Group: Applications/System +Requires: nano + +%description -n nano-icinga2 +Nano syntax highlighting for icinga2 + +%prep +%setup -q -n icinga2 + +%build +CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_SYSCONFDIR=/etc \ + -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DICINGA2_LTO_BUILD=ON \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DBoost_NO_BOOST_CMAKE=ON \ + -DICINGA2_RUNDIR=%{_rundir} \ + -DICINGA2_USER=%{icinga_user} \ + -DICINGA2_GROUP=%{icinga_group} \ + -DICINGA2_COMMAND_GROUP=%{icingacmd_group}" +%if 0%{?fedora} +CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true" +%endif +%if "%{_vendor}" == "redhat" +%if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6" +# Boost_VERSION 1.41.0 vs 101400 - disable build tests +# details in https://dev.icinga.com/issues/5033 +CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \ + -DBOOST_INCLUDEDIR=/usr/include/boost153 \ + -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \ + -DBoost_NO_SYSTEM_PATHS=TRUE \ + -DBUILD_TESTING=FALSE \ + -DBoost_NO_BOOST_CMAKE=TRUE" +%endif +%if 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6" +CMAKE_OPTS="$CMAKE_OPTS -DBUILD_TESTING=FALSE" +%endif +%endif + +%if "%{_vendor}" != "suse" +CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_libdir}/nagios/plugins" +%else +%if 0%{?suse_version} < 1310 +CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \ + -DBOOST_INCLUDEDIR=/usr/include/boost153 \ + -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \ + -DBoost_NO_SYSTEM_PATHS=TRUE \ + -DBUILD_TESTING=FALSE \ + -DBoost_NO_BOOST_CMAKE=TRUE" +%endif +CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_prefix}/lib/nagios/plugins" +%endif + +%if 0%{?use_systemd} +CMAKE_OPTS="$CMAKE_OPTS -DUSE_SYSTEMD=ON" +%endif + +cmake $CMAKE_OPTS -DCMAKE_C_FLAGS:STRING="%{optflags} %{?march_flag}" -DCMAKE_CXX_FLAGS:STRING="%{optflags} %{?march_flag}" . + +make %{?_smp_mflags} + +%if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") +cd tools/selinux +for selinuxvariant in %{selinux_variants} +do + make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile + mv %{modulename}.pp %{modulename}.pp.${selinuxvariant} + make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean +done +cd - +%endif + +%install +make install \ + DESTDIR="%{buildroot}" + +# install classicui config +install -D -m 0644 etc/icinga/icinga-classic.htpasswd %{buildroot}%{icingaclassicconfdir}/passwd +install -D -m 0644 etc/icinga/cgi.cfg %{buildroot}%{icingaclassicconfdir}/cgi.cfg +install -D -m 0644 etc/icinga/icinga-classic-apache.conf %{buildroot}%{apacheconfdir}/icinga.conf + +# remove features-enabled symlinks +rm -f %{buildroot}/%{_sysconfdir}/%{name}/features-enabled/*.conf + +# enable suse rc links +%if "%{_vendor}" == "suse" +%if 0%{?use_systemd} + ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name} +%else + ln -sf ../../%{_initrddir}/%{name} "%{buildroot}%{_sbindir}/rc%{name}" +%endif +mkdir -p "%{buildroot}%{_localstatedir}/adm/fillup-templates/" +mv "%{buildroot}%{_sysconfdir}/sysconfig/%{name}" "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}" +%endif + +%if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") +cd tools/selinux +for selinuxvariant in %{selinux_variants} +do + install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant} + install -p -m 644 %{modulename}.pp.${selinuxvariant} \ + %{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp +done +cd - + +/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux +%endif + +%if 0%{?fedora} +mkdir -p "%{buildroot}%{_datadir}/icinga2-studio" +install -p -m 644 icinga-studio/icinga.ico %{buildroot}%{_datadir}/icinga2-studio + +mkdir -p "%{buildroot}%{_datadir}/applications" +echo "[Desktop Entry] +Name=Icinga 2 Studio +Comment=API viewer for Icinga 2 +TryExec=icinga-studio +Exec=icinga-studio +Icon=/usr/share/icinga2-studio/icinga.ico +StartupNotify=true +Terminal=false +Type=Application +Categories=GTK;Utility; +Keywords=Monitoring;" > %{buildroot}%{_datadir}/applications/icinga2-studio.desktop +%endif + +%if "%{_vendor}" == "suse" +%if 0%{?suse_version} >= 1310 +install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vim74/syntax/%{name}.vim +install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vim74/ftdetect/%{name}.vim +%else +install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vim72/syntax/%{name}.vim +install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vim72/ftdetect/%{name}.vim +%endif +%else +install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/%{name}.vim +install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim +%endif + +install -D -m 0644 tools/syntax/nano/%{name}.nanorc %{buildroot}%{_datadir}/nano/%{name}.nanorc + +%clean +[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot} + +%pre common +getent group %{icinga_group} >/dev/null || %{_sbindir}/groupadd -r %{icinga_group} +getent group %{icingacmd_group} >/dev/null || %{_sbindir}/groupadd -r %{icingacmd_group} +getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /sbin/nologin -r -d %{_localstatedir}/spool/%{name} -G %{icingacmd_group} -g %{icinga_group} %{icinga_user} + +%if "%{_vendor}" == "suse" +%if 0%{?use_systemd} + %service_add_pre %{name}.service +%endif +%endif + +%if "%{_vendor}" == "suse" +%verifyscript bin +%verify_permissions -e %{_rundir}/%{name}/cmd +%endif + +%post bin + +# suse +%if "%{_vendor}" == "suse" + +%if 0%{?suse_version} >= 1310 +%set_permissions %{_rundir}/%{name}/cmd +%endif + +%endif #suse/rhel + +%post common +# suse +%if "%{_vendor}" == "suse" +%if 0%{?use_systemd} +%fillup_only %{name} +%service_add_post %{name}.service +%else +%fillup_and_insserv %{name} +%endif + +# initial installation, enable default features +for feature in checker notification mainlog; do + ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf +done + +exit 0 + +%else +# rhel + +%if 0%{?use_systemd} +%systemd_post %{name}.service +%else +/sbin/chkconfig --add %{name} +%endif + +if [ ${1:-0} -eq 1 ] +then + # initial installation, enable default features + for feature in checker notification mainlog; do + ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf + done +fi + +exit 0 + +%endif +# suse/rhel + +%postun common +# suse +%if "%{_vendor}" == "suse" +%if 0%{?using_systemd} + %service_del_postun %{name}.service +%else + %restart_on_update %{name} + %insserv_cleanup +%endif + +%else +# rhel + +%if 0%{?use_systemd} +%systemd_postun_with_restart %{name}.service +%else +if [ "$1" -ge "1" ]; then + /sbin/service %{name} condrestart >/dev/null 2>&1 || : +fi +%endif + +%endif +# suse / rhel + +if [ "$1" = "0" ]; then + # deinstallation of the package - remove enabled features + rm -rf %{_sysconfdir}/%{name}/features-enabled +fi + +exit 0 + +%preun common +# suse +%if "%{_vendor}" == "suse" + +%if 0%{?use_systemd} + %service_del_preun %{name}.service +%else + %stop_on_removal %{name} +%endif + +exit 0 + +%else +# rhel + +%if 0%{?use_systemd} +%systemd_preun %{name}.service +%else +if [ "$1" = "0" ]; then + /sbin/service %{name} stop > /dev/null 2>&1 || : + /sbin/chkconfig --del %{name} || : +fi +%endif + +exit 0 + +%endif +# suse / rhel + +%post ido-mysql +if [ ${1:-0} -eq 1 ] +then + # initial installation, enable ido-mysql feature + ln -sf ../features-available/ido-mysql.conf %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf +fi + +exit 0 + +%postun ido-mysql +if [ "$1" = "0" ]; then + # deinstallation of the package - remove feature + rm -f %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf +fi + +exit 0 + +%post ido-pgsql +if [ ${1:-0} -eq 1 ] +then + # initial installation, enable ido-pgsql feature + ln -sf ../features-available/ido-pgsql.conf %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf +fi + +exit 0 + +%postun ido-pgsql +if [ "$1" = "0" ]; then + # deinstallation of the package - remove feature + rm -f %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf +fi + +exit 0 + +%post classicui-config +if [ ${1:-0} -eq 1 ] +then + # initial installation, enable features + for feature in statusdata compatlog command; do + ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf + done +fi + +exit 0 + +%postun classicui-config +if [ "$1" = "0" ]; then + # deinstallation of the package - remove feature + for feature in statusdata compatlog command; do + rm -f %{_sysconfdir}/%{name}/features-enabled/${feature}.conf + done +fi + +exit 0 + +%if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") +%post selinux +for selinuxvariant in %{selinux_variants} +do + /usr/sbin/semodule -s ${selinuxvariant} -i \ + %{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp &> /dev/null || : +done +/sbin/fixfiles -R icinga2-bin restore &> /dev/null || : +/sbin/fixfiles -R icinga2-common restore &> /dev/null || : +/sbin/semanage port -a -t icinga2_port_t -p tcp 5665 &> /dev/null || : + +%postun selinux +if [ $1 -eq 0 ] ; then + /sbin/semanage port -d -t icinga2_port_t -p tcp 5665 &> /dev/null || : + for selinuxvariant in %{selinux_variants} + do + /usr/sbin/semodule -s ${selinuxvariant} -r %{modulename} &> /dev/null || : + done + /sbin/fixfiles -R icinga2-bin restore &> /dev/null || : + /sbin/fixfiles -R icinga2-common restore &> /dev/null || : +fi +%endif + + +%files +%defattr(-,root,root,-) +%doc COPYING + +%files bin +%defattr(-,root,root,-) +%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog +%{_sbindir}/%{name} +%dir %{_libdir}/%{name}/sbin +%{_libdir}/%{name}/sbin/%{name} +%{_datadir}/%{name} +%exclude %{_datadir}/%{name}/include +%{_mandir}/man8/%{name}.8.gz + +%attr(0750,%{icinga_user},%{icingacmd_group}) %{_localstatedir}/cache/%{name} +%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name} +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/crash +%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat +%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat/archives +%attr(0750,%{icinga_user},%{icinga_group}) %{_localstatedir}/lib/%{name} + +%attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name} +%attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd + +%files libs +%defattr(-,root,root,-) +%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog +%exclude %{_libdir}/%{name}/libdb_ido_mysql* +%exclude %{_libdir}/%{name}/libdb_ido_pgsql* +%dir %{_libdir}/%{name} +%{_libdir}/%{name}/*.so* + +%files common +%defattr(-,root,root,-) +%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog tools/syntax +%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name} +%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%{_sysconfdir}/bash_completion.d/%{name} +%if 0%{?use_systemd} +%attr(644,root,root) %{_unitdir}/%{name}.service +%else +%attr(755,root,root) %{_sysconfdir}/init.d/%{name} +%endif +%if "%{_vendor}" == "suse" +%{_sbindir}/rc%{name} +%{_localstatedir}/adm/fillup-templates/sysconfig.%{name} +%else +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%endif +%attr(0750,root,%{icinga_group}) %dir %{_sysconfdir}/%{name} +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available +%exclude %{_sysconfdir}/%{name}/features-available/ido-*.conf +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-enabled +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/repository.d +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/scripts +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/repository.d +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/zones.d +%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf +%config(noreplace) %attr(0640,root,%{icinga_group}) %{_sysconfdir}/%{name}/init.conf +%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf +%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf +%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf +%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf +%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/repository.d/* +%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.d/* +%config(noreplace) %{_sysconfdir}/%{name}/scripts/* +%dir %{_libexecdir}/%{name} +%{_libexecdir}/%{name}/prepare-dirs +%{_libexecdir}/%{name}/safe-reload +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name} +%attr(0770,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/perfdata +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/tmp +%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_datadir}/%{name}/include +%{_datadir}/%{name}/include + +%files doc +%defattr(-,root,root,-) +%{_datadir}/doc/%{name} +%docdir %{_datadir}/doc/%{name} + +%files ido-mysql +%defattr(-,root,root,-) +%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog +%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-mysql.conf +%{_libdir}/%{name}/libdb_ido_mysql* +%{_datadir}/icinga2-ido-mysql + +%files ido-pgsql +%defattr(-,root,root,-) +%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog +%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-pgsql.conf +%{_libdir}/%{name}/libdb_ido_pgsql* +%{_datadir}/icinga2-ido-pgsql + +%files classicui-config +%defattr(-,root,root,-) +%attr(0751,%{icinga_user},%{icinga_group}) %dir %{icingaclassicconfdir} +%config(noreplace) %{icingaclassicconfdir}/cgi.cfg +%config(noreplace) %{apacheconfdir}/icinga.conf +%config(noreplace) %attr(0640,root,%{apachegroup}) %{icingaclassicconfdir}/passwd + +%if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") +%files selinux +%defattr(-,root,root,0755) +%doc tools/selinux/* +%{_datadir}/selinux/*/%{modulename}.pp +%endif + +%if 0%{?fedora} +%files studio +%defattr(-,root,root,-) +%{_bindir}/icinga-studio +%{_datadir}/icinga2-studio +%{_datadir}/applications/icinga2-studio.desktop +%endif + +%files -n vim-icinga2 +%defattr(-,root,root,-) +%if "%{_vendor}" == "suse" +%if 0%{?suse_version} >= 1310 +%{_datadir}/vim/vim74/syntax/%{name}.vim +%{_datadir}/vim/vim74/ftdetect/%{name}.vim +%else +%{_datadir}/vim/vim72/syntax/%{name}.vim +%{_datadir}/vim/vim72/ftdetect/%{name}.vim +%endif +%else +%{_datadir}/vim/vimfiles/syntax/%{name}.vim +%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim +%endif + +%files -n nano-icinga2 +%defattr(-,root,root,-) +%{_datadir}/nano/%{name}.nanorc + +%changelog diff --git a/fedora/SPECS/icingaweb2.spec b/fedora/SPECS/icingaweb2.spec new file mode 100644 index 0000000..fb3172e --- /dev/null +++ b/fedora/SPECS/icingaweb2.spec @@ -0,0 +1,356 @@ +# Icinga Web 2 | (c) 2013-2016 Icinga Development Team | GPLv2+ + +%define revision 1 + +Name: icingaweb2 +Version: 2.4.1 +Release: %{revision}%{?dist} +Summary: Icinga Web 2 +Group: Applications/System +License: GPLv2+ and MIT and BSD +URL: https://icinga.com +Source: icingaweb2.tar.gz +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} +Packager: Icinga Team + +%if 0%{?fedora} || 0%{?rhel} || 0%{?amzn} +%define php php +%define php_cli php-cli +%define wwwconfigdir %{_sysconfdir}/httpd/conf.d +%define wwwuser apache +%endif + +%if 0%{?suse_version} +%define wwwconfigdir %{_sysconfdir}/apache2/conf.d +%define wwwuser wwwrun +%if 0%{?suse_version} == 1110 +%define php php53 +Requires: apache2-mod_php53 +%else +%define php php5 +Requires: apache2-mod_php5 +%endif +%endif + +%{?amzn:Requires(pre): shadow-utils} +%{?fedora:Requires(pre): shadow-utils} +%{?rhel:Requires(pre): shadow-utils} +%{?suse_version:Requires(pre): pwdutils} +Requires: %{name}-common = %{version}-%{release} +Requires: php-Icinga = %{version}-%{release} +Requires: %{name}-vendor-dompdf = 0.7.0-1%{?dist} +Requires: %{name}-vendor-HTMLPurifier = 4.8.0-1%{?dist} +Requires: %{name}-vendor-JShrink = 1.1.0-1%{?dist} +Requires: %{name}-vendor-lessphp = 0.4.0-1%{?dist} +Requires: %{name}-vendor-Parsedown = 1.6.0-1%{?dist} + +%if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") +%define selinux 1 +%define selinux_variants mls targeted +#%{!?_selinux_policy_version: %define _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2>/dev/null)} +%endif + +%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} + + +%description +Icinga Web 2 + + +%package common +Summary: Common files for Icinga Web 2 and the Icinga CLI +Group: Applications/System +%{?amzn:Requires(pre): shadow-utils} +%{?fedora:Requires(pre): shadow-utils} +%{?rhel:Requires(pre): shadow-utils} +%{?suse_version:Requires(pre): pwdutils} + +%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} >= 5.3.0 +Requires: %{php}-gd %{php}-intl +Requires: %{name}-vendor-zf1 = 1.12.20-1%{?dist} +%{?amzn:Requires: %{php}-pecl-imagick} +%{?fedora:Requires: php-pecl-imagick} +%{?rhel:Requires: php-pecl-imagick} +%{?suse_version:Requires: %{php}-gettext %{php}-json %{php}-openssl %{php}-posix} + +%description -n php-Icinga +Icinga Web 2 PHP library + + +%package -n icingacli +Summary: Icinga CLI +Group: Applications/System +Requires: %{name}-common = %{version}-%{release} +Requires: php-Icinga = %{version}-%{release} +%{?amzn:Requires: %{php_cli} >= 5.3.0 bash-completion} +%{?fedora:Requires: %{php_cli} >= 5.3.0 bash-completion} +%{?rhel:Requires: %{php_cli} >= 5.3.0 bash-completion} +%{?suse_version:Requires: %{php} >= 5.3.0} + +%description -n icingacli +Icinga CLI + + +%if 0%{?selinux} +%package selinux +Summary: SELinux policy for Icinga Web 2 +#BuildRequires: checkpolicy, selinux-policy-devel, /usr/share/selinux/devel/policyhelp, hardlink +BuildRequires: checkpolicy, selinux-policy-devel, hardlink +%if "%{_selinux_policy_version}" != "" +Requires: selinux-policy >= %{_selinux_policy_version} +%endif +Requires: %{name} = %{version}-%{release} +Requires(post): policycoreutils +Requires(postun): policycoreutils + +%description selinux +SELinux policy for Icinga Web 2 +%endif + + +%package vendor-dompdf +Version: 0.7.0 +Release: 1%{?dist} +Summary: Icinga Web 2 vendor library dompdf +Group: Development/Libraries +License: LGPLv2.1 +Requires: %{php} >= 5.3.0 + +%description vendor-dompdf +Icinga Web 2 vendor library dompdf + + +%package vendor-HTMLPurifier +Version: 4.8.0 +Release: 1%{?dist} +Summary: Icinga Web 2 vendor library HTMLPurifier +Group: Development/Libraries +License: LGPLv2.1 +Requires: %{php} >= 5.3.0 + +%description vendor-HTMLPurifier +Icinga Web 2 vendor library HTMLPurifier + + +%package vendor-JShrink +Version: 1.1.0 +Release: 1%{?dist} +Summary: Icinga Web 2 vendor library JShrink +Group: Development/Libraries +License: BSD +Requires: %{php} >= 5.3.0 + +%description vendor-JShrink +Icinga Web 2 vendor library JShrink + + +%package vendor-lessphp +Version: 0.4.0 +Release: 1%{?dist} +Summary: Icinga Web 2 vendor library lessphp +Group: Development/Libraries +License: MIT +Requires: %{php} >= 5.3.0 + +%description vendor-lessphp +Icinga Web 2 vendor library lessphp + + +%package vendor-Parsedown +Version: 1.6.0 +Release: 1%{?dist} +Summary: Icinga Web 2 vendor library Parsedown +Group: Development/Libraries +License: MIT +Requires: %{php} >= 5.3.0 + +%description vendor-Parsedown +Icinga Web 2 vendor library Parsedown + + +%package vendor-zf1 +Version: 1.12.20 +Release: 1%{?dist} +Summary: Icinga Web 2's fork of Zend Framework 1 +Group: Development/Libraries +License: BSD +Requires: %{php} >= 5.3.0 +Obsoletes: %{name}-vendor-Zend + +%description vendor-zf1 +Icinga Web 2's fork of Zend Framework 1 + + +%prep +%setup -q -n icingaweb2 +%if 0%{?selinux} +mkdir selinux +cp -p packages/selinux/icingaweb2.{fc,if,te} selinux +%endif + +%build +%if 0%{?selinux} +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 - +%endif + +%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} %{buildroot}/%{basedir}/public +cp -pv packages/files/apache/icingaweb2.conf %{buildroot}/%{wwwconfigdir}/icingaweb2.conf +cp -pv packages/files/bin/icingacli %{buildroot}/%{bindir} +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 +%if 0%{?selinux} +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 - +/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux +%endif + +%pre +getent group icingacmd >/dev/null || groupadd -r icingacmd +%if 0%{?suse_version} && 0%{?suse_version} < 01200 +usermod -A icingacmd,%{icingawebgroup} %{wwwuser} +%else +usermod -a -G icingacmd,%{icingawebgroup} %{wwwuser} +%endif +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) +%{basedir}/application/locale +%dir %{basedir}/modules +%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 + + +%if 0%{?selinux} +%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 +%endif + + +%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 diff --git a/fedora/SPECS/nagios-plugins.spec b/fedora/SPECS/nagios-plugins.spec new file mode 100644 index 0000000..607d6a1 --- /dev/null +++ b/fedora/SPECS/nagios-plugins.spec @@ -0,0 +1,815 @@ +%global _hardened_build 1 + +Name: nagios-plugins +Version: 2.2.1 +Release: 2%{?dist} +Summary: Host/service/network monitoring program plugins for Nagios + +Group: Applications/System +License: GPLv2+ +URL: https://www.nagios-plugins.org/ +Source0: https://www.nagios-plugins.org/download/%{name}-%{version}.tar.gz +Source1: nagios-plugins.README.Fedora +Patch2: nagios-plugins-0002-Remove-assignment-of-not-parsed-to-jitter.patch +# https://bugzilla.redhat.com/512559 +Patch5: nagios-plugins-0005-Prevent-check_swap-from-returning-OK-if-no-swap-acti.patch +Patch7: nagios-plugins-0007-Fix-the-use-lib-statement-and-the-external-ntp-comma.patch +# Patch 8 no longer needed +# Patch 9 no longer needed +# Patch 10 no longer needed +Patch11: nagios-plugins-0011-various_bugzilla_fixes.patch + + +BuildRequires: openldap-devel +BuildRequires: mysql-devel +BuildRequires: net-snmp-devel +BuildRequires: net-snmp-utils +BuildRequires: samba-client +BuildRequires: postgresql-devel +BuildRequires: gettext +BuildRequires: %{_bindir}/ssh +BuildRequires: bind-utils +BuildRequires: ntp +BuildRequires: %{_bindir}/mailq +BuildRequires: fping +BuildRequires: perl-generators +BuildRequires: perl-Net-SNMP +BuildRequires: qstat + +%if 0%{?rhel} +BuildRequires: radiusclient-ng-devel +%else +BuildRequires: freeradius-client-devel +%endif +BuildRequires: qstat +BuildRequires: libdbi-devel +%if 0%{?fedora} >25 +## This is due to the patch to fix openssl +BuildRequires: automake +BuildRequires: autoconf +%endif + +Requires: nagios-common >= 3.3.1-1 +Requires: openssl + +Obsoletes: nagios-plugins-linux_raid < 1.4.16-11 + +# nagios-plugins-1.4.16: the included gnulib files were last updated +# in June/July 2010 +# Bundled gnulib exception (https://fedorahosted.org/fpc/ticket/174) +Provides: bundled(gnulib) + +%global reqfilt sh -c "%{__perl_requires} | sed -e 's!perl(utils)!nagios-plugins-perl!'" +%global __perl_requires %{reqfilt} + + +%description +Nagios is a program that will monitor hosts and services on your +network, and to email or page you when a problem arises or is +resolved. Nagios runs on a Unix server as a background or daemon +process, intermittently running checks on various services that you +specify. The actual service checks are performed by separate "plugin" +programs which return the status of the checks to Nagios. This package +contains those plugins. + +%package all +Summary: Nagios Plugins - All plugins +Group: Applications/System +Requires: nagios-plugins-breeze, nagios-plugins-by_ssh, nagios-plugins-dhcp, nagios-plugins-dig, nagios-plugins-disk, nagios-plugins-disk_smb, nagios-plugins-dns, nagios-plugins-dummy, nagios-plugins-file_age, nagios-plugins-flexlm, nagios-plugins-fping, nagios-plugins-hpjd, nagios-plugins-http, nagios-plugins-icmp, nagios-plugins-ide_smart, nagios-plugins-ircd, nagios-plugins-ldap, nagios-plugins-load, nagios-plugins-log, nagios-plugins-mailq, nagios-plugins-mrtg, nagios-plugins-mrtgtraf, nagios-plugins-mysql, nagios-plugins-nagios, nagios-plugins-nt, nagios-plugins-ntp, nagios-plugins-ntp-perl, nagios-plugins-nwstat, nagios-plugins-oracle, nagios-plugins-overcr, nagios-plugins-pgsql, nagios-plugins-ping, nagios-plugins-procs, nagios-plugins-game, nagios-plugins-real, nagios-plugins-rpc, nagios-plugins-smtp, nagios-plugins-snmp, nagios-plugins-ssh, nagios-plugins-swap, nagios-plugins-tcp, nagios-plugins-time, nagios-plugins-ups, nagios-plugins-users, nagios-plugins-wave, nagios-plugins-cluster +%ifnarch ppc ppc64 ppc64p7 sparc sparc64 +Requires: nagios-plugins-sensors +%endif + +%description all +This package provides all Nagios plugins. + +%package apt +Summary: Nagios Plugin - check_apt +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description apt +Provides check_apt support for Nagios. + +%package breeze +Summary: Nagios Plugin - check_breeze +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description breeze +Provides check_breeze support for Nagios. + +%package by_ssh +Summary: Nagios Plugin - check_by_ssh +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: %{_bindir}/ssh + +%description by_ssh +Provides check_by_ssh support for Nagios. + +%package cluster +Summary: Nagios Plugin - check_cluster +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description cluster +Provides check_cluster support for Nagios. + +%package dbi +Summary: Nagios Plugin - check_dbi +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description dbi +Provides check_dbi support for Nagios. + +%package dhcp +Summary: Nagios Plugin - check_dhcp +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: group(nagios) +Requires(pre): group(nagios) + +%description dhcp +Provides check_dhcp support for Nagios. + +%package dig +Summary: Nagios Plugin - check_dig +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: %{_bindir}/dig + +%description dig +Provides check_dig support for Nagios. + +%package disk +Summary: Nagios Plugin - check_disk +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description disk +Provides check_disk support for Nagios. + +%package disk_smb +Summary: Nagios Plugin - check_disk_smb +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: %{_bindir}/smbclient + +%description disk_smb +Provides check_disk_smb support for Nagios. + +%package dns +Summary: Nagios Plugin - check_dns +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: %{_bindir}/nslookup + +%description dns +Provides check_dns support for Nagios. + +%package dummy +Summary: Nagios Plugin - check_dummy +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description dummy +Provides check_dummy support for Nagios. +This plugin does not actually check anything, simply provide it with a flag +0-4 and it will return the corresponding status code to Nagios. + +%package file_age +Summary: Nagios Plugin - check_file_age +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description file_age +Provides check_file_age support for Nagios. + +%package flexlm +Summary: Nagios Plugin - check_flexlm +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description flexlm +Provides check_flexlm support for Nagios. + +%package fping +Summary: Nagios Plugin - check_fping +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: %{_sbindir}/fping +Requires: group(nagios) +Requires(pre): group(nagios) + +%description fping +Provides check_fping support for Nagios. + +%package game +Summary: Nagios Plugin - check_game +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: qstat + +%description game +Provides check_game support for Nagios. + +%package hpjd +Summary: Nagios Plugin - check_hpjd +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description hpjd +Provides check_hpjd support for Nagios. + +%package http +Summary: Nagios Plugin - check_http +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description http +Provides check_http support for Nagios. + +%package icmp +Summary: Nagios Plugin - check_icmp +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: group(nagios) +Requires(pre): group(nagios) + +%description icmp +Provides check_icmp support for Nagios. + +%package ide_smart +Summary: Nagios Plugin - check_ide_smart +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: group(nagios) +Requires(pre): group(nagios) + +%description ide_smart +Provides check_ide_smart support for Nagios. + +%package ifoperstatus +Summary: Nagios Plugin - check_ifoperstatus +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description ifoperstatus +Provides check_ifoperstatus support for Nagios to monitor network interfaces. + +%package ifstatus +Summary: Nagios Plugin - check_ifstatus +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description ifstatus +Provides check_ifstatus support for Nagios to monitor network interfaces. + +%package ircd +Summary: Nagios Plugin - check_ircd +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description ircd +Provides check_ircd support for Nagios. + +%package ldap +Summary: Nagios Plugin - check_ldap +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description ldap +Provides check_ldap support for Nagios. + +%package load +Summary: Nagios Plugin - check_load +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description load +Provides check_load support for Nagios. + +%package log +Summary: Nagios Plugin - check_log +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: /bin/egrep +Requires: /bin/mktemp + +%description log +Provides check_log support for Nagios. + +%package mailq +Summary: Nagios Plugin - check_mailq +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: %{_bindir}/mailq + +%description mailq +Provides check_mailq support for Nagios. + +%package mrtg +Summary: Nagios Plugin - check_mrtg +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description mrtg +Provides check_mrtg support for Nagios. + +%package mrtgtraf +Summary: Nagios Plugin - check_mrtgtraf +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description mrtgtraf +Provides check_mrtgtraf support for Nagios. + +%package mysql +Summary: Nagios Plugin - check_mysql +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description mysql +Provides check_mysql and check_mysql_query support for Nagios. + +%package nagios +Summary: Nagios Plugin - check_nagios +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description nagios +Provides check_nagios support for Nagios. + +%package nt +Summary: Nagios Plugin - check_nt +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description nt +Provides check_nt support for Nagios. + +%package ntp +Summary: Nagios Plugin - check_ntp +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description ntp +Provides check_ntp support for Nagios. + +%package ntp-perl +Summary: Nagios Plugin - check_ntp.pl +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: %{_sbindir}/ntpdate +Requires: %{_sbindir}/ntpq + +%description ntp-perl +Provides check_ntp.pl support for Nagios. + +%package nwstat +Summary: Nagios Plugin - check_nwstat +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description nwstat +Provides check_nwstat support for Nagios. + +%package oracle +Summary: Nagios Plugin - check_oracle +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description oracle +Provides check_oracle support for Nagios. + +%package overcr +Summary: Nagios Plugin - check_overcr +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description overcr +Provides check_overcr support for Nagios. + +%package perl +Summary: Nagios plugins perl dep. +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description perl +Perl dep for nagios plugins. This is *NOT* an actual plugin it simply provides +utils.pm + +%package pgsql +Summary: Nagios Plugin - check_pgsql +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description pgsql +Provides check_pgsql (PostgreSQL) support for Nagios. + +%package ping +Summary: Nagios Plugin - check_ping +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: /bin/ping +Requires: /bin/ping6 + +%description ping +Provides check_ping support for Nagios. + +%package procs +Summary: Nagios Plugin - check_procs +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description procs +Provides check_procs support for Nagios. + +%package radius +Summary: Nagios Plugin - check_radius +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description radius +Provides check_radius support for Nagios. + +%package real +Summary: Nagios Plugin - check_real +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description real +Provides check_real (rtsp) support for Nagios. + +%package rpc +Summary: Nagios Plugin - check_rpc +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: %{_sbindir}/rpcinfo + +%description rpc +Provides check_rpc support for Nagios. + +%ifnarch ppc ppc64 sparc sparc64 +%package sensors +Summary: Nagios Plugin - check_sensors +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: /bin/egrep +Requires: %{_bindir}/sensors + +%description sensors +Provides check_sensors support for Nagios. +%endif + +%package smtp +Summary: Nagios Plugin - check_smtp +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description smtp +Provides check_smtp support for Nagios. + +%package snmp +Summary: Nagios Plugin - check_snmp +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Requires: %{_bindir}/snmpgetnext +Requires: %{_bindir}/snmpget + +%description snmp +Provides check_snmp support for Nagios. + +%package ssh +Summary: Nagios Plugin - check_ssh +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description ssh +Provides check_ssh support for Nagios. + +%package swap +Summary: Nagios Plugin - check_swap +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description swap +Provides check_swap support for Nagios. + +%package tcp +Summary: Nagios Plugin - check_tcp +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} +Provides: nagios-plugins-ftp = %{version}-%{release} +Provides: nagios-plugins-imap = %{version}-%{release} +Provides: nagios-plugins-jabber = %{version}-%{release} +Provides: nagios-plugins-nntp = %{version}-%{release} +Provides: nagios-plugins-nntps = %{version}-%{release} +Provides: nagios-plugins-pop = %{version}-%{release} +Provides: nagios-plugins-simap = %{version}-%{release} +Provides: nagios-plugins-spop = %{version}-%{release} +Provides: nagios-plugins-ssmtp = %{version}-%{release} +Provides: nagios-plugins-udp = %{version}-%{release} +Provides: nagios-plugins-udp2 = %{version}-%{release} +Obsoletes: nagios-plugins-udp < 1.4.15-2 + +%description tcp +Provides check_tcp, check_ftp, check_imap, check_jabber, check_nntp, +check_nntps, check_pop, check_simap, check_spop, check_ssmtp, check_udp +and check_clamd support for Nagios. + +%package time +Summary: Nagios Plugin - check_time +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description time +Provides check_time support for Nagios. + +%package ups +Summary: Nagios Plugin - check_ups +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description ups +Provides check_ups support for Nagios. + +%package uptime +Summary: Nagios Plugin - check_uptime +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description uptime +Provides check_uptime support for Nagios. + +%package users +Summary: Nagios Plugin - check_users +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description users +Provides check_users support for Nagios. + +%package wave +Summary: Nagios Plugin - check_wave +Group: Applications/System +Requires: nagios-plugins = %{version}-%{release} + +%description wave +Provides check_wave support for Nagios. + +%prep +%setup -q + +%patch2 -p1 -b .not_parsed +#%patch5 -p1 -b .fix_missing_swap +%patch7 -p1 -b .ext_ntp_cmds + +#%patch11 -p1 -b .fixes_for_release_201702 + +%build + +%configure \ + --libexecdir=%{_libdir}/nagios/plugins \ + --with-dbi \ + --with-mysql \ + PATH_TO_QSTAT=%{_bindir}/quakestat \ + PATH_TO_FPING=%{_sbindir}/fping \ + PATH_TO_NTPQ=%{_sbindir}/ntpq \ + PATH_TO_NTPDC=%{_sbindir}/ntpdc \ + PATH_TO_NTPDATE=%{_sbindir}/ntpdate \ + PATH_TO_RPCINFO=%{_sbindir}/rpcinfo \ + --with-ps-command="`which ps` -eo 's uid pid ppid vsz rss pcpu etime comm args'" \ + --with-ps-format='%s %d %d %d %d %d %f %s %s %n' \ + --with-ps-cols=10 \ + --enable-extra-opts \ + --with-ps-varlist='procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos' + +make %{?_smp_mflags} +cd plugins +make check_ide_smart +make check_ldap +make check_radius +make check_pgsql + +cd .. + + +cp %{SOURCE1} ./README.Fedora + +%install +sed -i 's,^MKINSTALLDIRS.*,MKINSTALLDIRS = ../mkinstalldirs,' po/Makefile +make AM_INSTALL_PROGRAM_FLAGS="" DESTDIR=%{buildroot} install +install -m 0755 plugins-root/check_icmp %{buildroot}/%{_libdir}/nagios/plugins +install -m 0755 plugins-root/check_dhcp %{buildroot}/%{_libdir}/nagios/plugins +install -m 0755 plugins/check_ide_smart %{buildroot}/%{_libdir}/nagios/plugins +install -m 0755 plugins/check_ldap %{buildroot}/%{_libdir}/nagios/plugins +install -m 0755 plugins-scripts/check_ntp.pl %{buildroot}/%{_libdir}/nagios/plugins +install -m 0755 plugins/check_radius %{buildroot}/%{_libdir}/nagios/plugins +install -m 0755 plugins/check_pgsql %{buildroot}/%{_libdir}/nagios/plugins + +%ifarch ppc ppc64 ppc64p7 sparc sparc64 +rm -f %{buildroot}/%{_libdir}/nagios/plugins/check_sensors +%endif + +chmod 644 %{buildroot}/%{_libdir}/nagios/plugins/utils.pm + +%find_lang %{name} + +%files -f %{name}.lang +%doc ACKNOWLEDGEMENTS AUTHORS ChangeLog CODING COPYING FAQ LEGAL NEWS README REQUIREMENTS SUPPORT THANKS README.Fedora +%{_libdir}/nagios/plugins/negate +%{_libdir}/nagios/plugins/urlize +%{_libdir}/nagios/plugins/utils.sh + +%files all + +%files apt +%{_libdir}/nagios/plugins/check_apt + +%files breeze +%{_libdir}/nagios/plugins/check_breeze + +%files by_ssh +%{_libdir}/nagios/plugins/check_by_ssh + +%files cluster +%{_libdir}/nagios/plugins/check_cluster + +%files dbi +%{_libdir}/nagios/plugins/check_dbi + +%files dhcp +%defattr(4750,root,nagios,-) +%{_libdir}/nagios/plugins/check_dhcp + +%files dig +%{_libdir}/nagios/plugins/check_dig + +%files disk +%{_libdir}/nagios/plugins/check_disk + +%files disk_smb +%{_libdir}/nagios/plugins/check_disk_smb + +%files dns +%{_libdir}/nagios/plugins/check_dns + +%files dummy +%{_libdir}/nagios/plugins/check_dummy + +%files file_age +%{_libdir}/nagios/plugins/check_file_age + +%files flexlm +%{_libdir}/nagios/plugins/check_flexlm + +%files fping +%defattr(4750,root,nagios,-) +%{_libdir}/nagios/plugins/check_fping + +%files game +%{_libdir}/nagios/plugins/check_game + +%files hpjd +%{_libdir}/nagios/plugins/check_hpjd + +%files http +%{_libdir}/nagios/plugins/check_http + +%files icmp +%defattr(4750,root,nagios,-) +%{_libdir}/nagios/plugins/check_icmp + +%files ifoperstatus +%{_libdir}/nagios/plugins/check_ifoperstatus + +%files ifstatus +%{_libdir}/nagios/plugins/check_ifstatus + +%files ide_smart +%defattr(4750,root,nagios,-) +%{_libdir}/nagios/plugins/check_ide_smart + +%files ircd +%{_libdir}/nagios/plugins/check_ircd + +%files ldap +%{_libdir}/nagios/plugins/check_ldap +%{_libdir}/nagios/plugins/check_ldaps + +%files load +%{_libdir}/nagios/plugins/check_load + +%files log +%{_libdir}/nagios/plugins/check_log + +%files mailq +%{_libdir}/nagios/plugins/check_mailq + +%files mrtg +%{_libdir}/nagios/plugins/check_mrtg + +%files mrtgtraf +%{_libdir}/nagios/plugins/check_mrtgtraf + +%files mysql +%{_libdir}/nagios/plugins/check_mysql +%{_libdir}/nagios/plugins/check_mysql_query + +%files nagios +%{_libdir}/nagios/plugins/check_nagios + +%files nt +%{_libdir}/nagios/plugins/check_nt + +%files ntp +%{_libdir}/nagios/plugins/check_ntp +%{_libdir}/nagios/plugins/check_ntp_peer +%{_libdir}/nagios/plugins/check_ntp_time + +%files ntp-perl +%{_libdir}/nagios/plugins/check_ntp.pl + +%files nwstat +%{_libdir}/nagios/plugins/check_nwstat + +%files oracle +%{_libdir}/nagios/plugins/check_oracle + +%files overcr +%{_libdir}/nagios/plugins/check_overcr + +%files perl +%{_libdir}/nagios/plugins/utils.pm + +%files pgsql +%{_libdir}/nagios/plugins/check_pgsql + +%files ping +%{_libdir}/nagios/plugins/check_ping + +%files procs +%{_libdir}/nagios/plugins/check_procs + +%files radius +%{_libdir}/nagios/plugins/check_radius + +%files real +%{_libdir}/nagios/plugins/check_real + +%files rpc +%{_libdir}/nagios/plugins/check_rpc + +%ifnarch ppc ppc64 ppc64p7 sparc sparc64 +%files sensors +%{_libdir}/nagios/plugins/check_sensors +%endif + +%files smtp +%{_libdir}/nagios/plugins/check_smtp + +%files snmp +%{_libdir}/nagios/plugins/check_snmp + +%files ssh +%{_libdir}/nagios/plugins/check_ssh + +%files swap +%{_libdir}/nagios/plugins/check_swap + +%files tcp +%{_libdir}/nagios/plugins/check_clamd +%{_libdir}/nagios/plugins/check_ftp +%{_libdir}/nagios/plugins/check_imap +%{_libdir}/nagios/plugins/check_jabber +%{_libdir}/nagios/plugins/check_nntp +%{_libdir}/nagios/plugins/check_nntps +%{_libdir}/nagios/plugins/check_pop +%{_libdir}/nagios/plugins/check_simap +%{_libdir}/nagios/plugins/check_spop +%{_libdir}/nagios/plugins/check_ssmtp +%{_libdir}/nagios/plugins/check_tcp +%{_libdir}/nagios/plugins/check_udp + +%files time +%{_libdir}/nagios/plugins/check_time + +%files ups +%{_libdir}/nagios/plugins/check_ups + +%files uptime +%{_libdir}/nagios/plugins/check_uptime + +%files users +%{_libdir}/nagios/plugins/check_users + +%files wave +%{_libdir}/nagios/plugins/check_wave + +%changelog +* Fri Jul 21 2017 Daniel Steiner +- First own build + From d7d0658a5a454e0fe7f662cac4195feb4df94800 Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Sat, 22 Jul 2017 09:27:52 +0200 Subject: [PATCH 8/8] Nagios dependencies removed, but icinga2 dependencies added --- fedora/SPECS/pnp4nagios.spec | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fedora/SPECS/pnp4nagios.spec b/fedora/SPECS/pnp4nagios.spec index df7b308..b2f7ff3 100644 --- a/fedora/SPECS/pnp4nagios.spec +++ b/fedora/SPECS/pnp4nagios.spec @@ -1,6 +1,6 @@ Name: pnp4nagios Version: 0.6.25 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Nagios performance data analysis tool Group: Applications/System @@ -14,10 +14,14 @@ Patch1: pnp4nagios-httpd24.patch Patch2: pnp4nagios-pnp-helper.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# this package requires icinga2 instead of nagios! +%define user icinga +%define grp icinga BuildRequires: autoconf, automake, libtool BuildRequires: rrdtool-perl BuildRequires: perl(Time::HiRes) -Requires: nagios +# this package requires icinga2 instead of nagios! +Requires: icinga2 Requires: rrdtool-perl Requires: php-gd Requires(post): chkconfig @@ -125,9 +129,9 @@ fi %{_libdir}/nagios/brokers/npcdmod.o %dir %{_libexecdir}/%{name} %attr(755,root,root) %{_libexecdir}/%{name}/* -%attr(755,nagios,nagios) %{_localstatedir}/lib/%{name} -%attr(755,nagios,nagios) %{_localstatedir}/log/%{name} -%attr(755,nagios,nagios) %{_localstatedir}/spool/%{name} +%attr(755,%{user},%{grp}) %{_localstatedir}/lib/%{name} +%attr(755,%{user},%{grp}) %{_localstatedir}/log/%{name} +%attr(755,%{user},%{grp}) %{_localstatedir}/spool/%{name} %{_datadir}/nagios/html/%{name} # Remove install check script # as it is not required if all dependencies are met. @@ -138,6 +142,9 @@ fi %{_datadir}/nagios/html/%{name}/kohana %changelog +* Sat Jul 22 2017 Daniel Steiner - 0.6.25-6 +- Package requires now icinga2 instead of nagios. User/group changed to icinga + * Sat Jul 22 2017 Daniel Steiner - 0.6.25-5 - PHP error fixed in pnp.php helper module