diff --git a/openvas-scanner.spec b/openvas-scanner.spec index 4f58fa6..4724f9a 100644 --- a/openvas-scanner.spec +++ b/openvas-scanner.spec @@ -1,10 +1,10 @@ #This number is the sequence number on intevation.org to download a file -%global tar_download 1791 -#%global tar_version 4.0.4 +%global tar_download 1791 +#%global tar_version 4.0.4 Name: openvas-scanner Version: 4.0.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Open Vulnerability Assessment (OpenVAS) Scanner License: GPLv2 @@ -12,13 +12,16 @@ URL: http://www.openvas.org Source0: http://wald.intevation.org/frs/download.php/%{tar_download}/%{name}-%{version}.tar.gz #Source0: http://wald.intevation.org/frs/download.php/%{tar_download}/%{name}-%{tar_version}.tar.gz +%if 0%{?rhel} >= 7 || 0%{?fedora} > 15 +Source7: openvas-scanner.service +%else Source1: openvas-scanner.initd +%endif Source2: openvassd.conf Source3: openvas-scanner.logrotate Source4: openvas-scanner.sysconfig Source5: openvas-nvt-sync-cron Source6: openvas-nvt-sync-cronjob -Source7: openvas-scanner.service # Put certs to /etc/pki as suggested by http://fedoraproject.org/wiki/PackagingDrafts/Certificates # Not reported upstream as it is RedHat/Fedora specific @@ -41,11 +44,9 @@ BuildRequires: glib2-devel BuildRequires: libpcap-devel BuildRequires: gnutls-devel BuildRequires: gpgme-devel -BuildRequires: libksba-devel +BuildRequires: libksba-devel BuildRequires: pkgconfig -BuildRequires: systemd-units BuildRequires: libgcrypt-devel -BuildRequires: systemd # This is introduced to accomodate difference in RHEL5/CentOS5 %if %{defined rhel} @@ -61,9 +62,18 @@ BuildRequires: libuuid-devel BuildRequires: libuuid-devel %endif -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd +%if 0%{?rhel} >= 7 || 0%{?fedora} > 15 +BuildRequires: systemd +BuildRequires: systemd-units +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +%else +Requires(post): chkconfig +Requires(preun): chkconfig +Requires(preun): initscripts +%endif + # Required by the openvas-nvt-sync and greenbone-nvt-sync Requires: /usr/bin/md5sum @@ -77,20 +87,8 @@ Requires: /usr/bin/curl %description Scanner module for the Open Vulnerability Assessment System (OpenVAS). -%package sysvinit -Summary: SysV style init script for %{name} -Group: Documentation -Requires: %{name} = %{version}-%{release} -Requires(post): chkconfig -Requires(preun): chkconfig -Requires(preun): initscripts - -%description sysvinit -SysV style init script for %{name}. -It needs to be installed only if systemd is not used as the system init process. - %prep -%setup -q +%setup -q #%setup -q -n %{name}-%{tar_version} # Separation of feeds not possible because nasl script_dependencies doesn't search in all include_folders #patch0 -p 1 -b .nvtfeed @@ -144,11 +142,14 @@ mkdir -p %{buildroot}/%{_var}/log/openvas # Make plugin cache directory mkdir -p %{buildroot}/%{_var}/cache/openvas -# Install startup script -install -Dp -m 755 %{SOURCE1} %{buildroot}/%{_initddir}/openvas-scanner +%if 0%{?rhel} >= 7 || 0%{?fedora} > 15 # Install systemd install -Dp -m 644 %{SOURCE7} %{buildroot}/%{_unitdir}/%{name}.service +%else +# Install startup script +install -Dp -m 755 %{SOURCE1} %{buildroot}/%{_initddir}/openvas-scanner +%endif # Install initial configuration sed -e "s:@@OPENVAS_PLUGINS@@:%{_var}/lib/openvas/plugins:g @@ -171,6 +172,8 @@ install -Dp -m 755 %{SOURCE5} %{buildroot}/%{_sbindir}/ # Install cront jobs to periodically update plugins install -Dp -m 644 %{SOURCE6} %{buildroot}/%{_sysconfdir}/cron.d/openvas-sync-plugins +%if 0%{?rhel} >= 7 || 0%{?fedora} > 15 +#systemd post %post %systemd_post %{name}.service @@ -180,42 +183,50 @@ install -Dp -m 644 %{SOURCE6} %{buildroot}/%{_sysconfdir}/cron.d/openvas-sync-pl %postun %systemd_postun_with_restart %{name}.service -%post sysvinit +%else +#initv post +%post # This adds the proper /etc/rc*.d links for the script if [ "$1" -eq 1 ]; then /sbin/chkconfig --add openvas-scanner fi -%preun sysvinit +%preun if [ $1 = 0 ]; then /sbin/service openvas-scanner stop >/dev/null 2>&1 /sbin/chkconfig --del openvas-scanner fi -%postun sysvinit +%postun if [ $1 -ge 1 ]; then /sbin/service openvas-scanner condrestart >/dev/null 2>&1 fi +%endif + %files %doc CHANGES ChangeLog COPYING COPYING.GPLv2 README -%dir %{_sysconfdir}/openvas -%dir %{_sysconfdir}/pki/openvas -%dir %{_sysconfdir}/pki/openvas/CA -%dir %{_sysconfdir}/pki/openvas/private -%dir %{_sysconfdir}/pki/openvas/private/CA -%dir %{_var}/lib/openvas -%dir %{_var}/lib/openvas/plugins +%dir %{_sysconfdir}/openvas/ +%dir %{_sysconfdir}/pki/openvas/ +%dir %{_sysconfdir}/pki/openvas/CA/ +%dir %{_sysconfdir}/pki/openvas/private/ +%dir %{_sysconfdir}/pki/openvas/private/CA/ +%dir %{_var}/lib/openvas/ +%dir %{_var}/lib/openvas/plugins/ #Separation of feeds not possible because nasl script_dependencies doesn't search in all include_folders -#_dir _{_var}/lib/openvas/plugins/nvt -#_dir _{_var}/lib/openvas/plugins/gsf -%dir %{_var}/log/openvas -%dir %{_var}/cache/openvas +#_dir _{_var}/lib/openvas/plugins/nvt/ +#_dir _{_var}/lib/openvas/plugins/gsf/ +%dir %{_var}/log/openvas/ +%dir %{_var}/cache/openvas/ %config(noreplace) %{_sysconfdir}/openvas/openvassd.conf %config(noreplace) %{_sysconfdir}/sysconfig/openvas-scanner %config(noreplace) %{_sysconfdir}/cron.d/openvas-sync-plugins %config(noreplace) %{_sysconfdir}/logrotate.d/openvas-scanner +%if 0%{?rhel} >= 7 || 0%{?fedora} > 15 %{_unitdir}/%{name}.service +%else +%{_initddir}/openvas-scanner +%endif %{_bindir}/openvas-mkcert-client %{_sbindir}/openvas-mkcert %{_sbindir}/openvas-nvt-sync @@ -226,11 +237,11 @@ fi %{_mandir}/man8/*.8.* #attr(644,root,root) _{_libdir}/openvas/plugins/*.nes -%files sysvinit -%{_initddir}/openvas-scanner - %changelog -* Tue Nov 05 2014 Michal Ambroz - 4.0.4-1 +* Fri Nov 07 2014 Michal Ambroz - 4.0.4-2 +- removed sysvinit subpackage - not needed anymore + +* Wed Nov 05 2014 Michal Ambroz - 4.0.4-1 - Update to OpenVAS-7 openvas-scanner release 4.0.4 * Fri Sep 12 2014 Michal Ambroz - 4.0.3-1