File openvas-scanner.spec of Package openvas-scanner-playground
# norootforbuild
Name: openvas-scanner
Version: 3.0.0.beta7.SVN
Release: 1.0
License: GNU GPLv2
Group: Productivity/Networking/Security
URL: http://www.openvas.org
Source0: %{name}-%{version}.tar.gz
Source2: openvassd.logrotate
Source3: openvassd.init.suse
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
BuildRequires: libgpgme-devel
PreReq: %insserv_prereq %fillup_prereq
%endif
%if 0%{?mandriva_version}
BuildRequires: gpgme-devel
%if 0%{?mandriva_version} == 2009
BuildRequires: pinentry-gtk
%endif
%if 0%{?mandriva_version} > 200900
BuildRequires: pinentry-gtk2
%endif
%endif
%if 0%{?fedora_version}
BuildRequires: gpgme-devel
%endif
BuildRequires: glib2-devel
BuildRequires: gnutls-devel >= 2.0.3
BuildRequires: libopenvas-devel >= 3.0.0
BuildRequires: libpcap-devel
PreReq: logrotate
Summary: The Scanner Module for OpenVAS
%description
This is the scanner module for the Open Vulnerability Assessment System (OpenVAS).
%prep
%setup -q
%build
%if 0%{?mandriva_version}
%serverbuild
%endif
#prevent the key generation script from putting the keys in /usr/com (sharedstatedir default)
%configure --sharedstatedir=%{_localstatedir}/lib --enable-syslog
%__make %{?jobs:-j%jobs}
%install
%makeinstall
%__install -D -m 644 %{_sourcedir}/openvassd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/openvassd
%if 0%{?suse_version}
%__install -D -m 744 %{_sourcedir}/openvassd.init.suse %{buildroot}%{_initrddir}/openvassd
%__ln_s %{_initrddir}/openvassd %{buildroot}%{_sbindir}/rcopenvassd
%endif
%if 0%{?fedora_version}
%__install -D -m 744 %{_sourcedir}/openvassd.init.fedora %{buildroot}%{_initrddir}/openvassd
%endif
%if 0%{?mandriva_version}
%__install -D -m 744 %{_sourcedir}/openvassd.init.mandriva %{buildroot}%{_initrddir}/openvassd
%endif
%clean
test "%{buildroot}" != "/" && %__rm -rf %{buildroot}
%post
# Generate cert
#if [ ! -f %{_localstatedir}/lib/openvas/CA/servercert.pem ] ; then
# %{_sbindir}/openvas-mkcert -q > /dev/null 2>&1
#fi
%if 0%{?suse_version}
%fillup_and_insserv -f openvassd
%endif
%if 0%{?mandriva_version}
%_post_service openvassd
%endif
%if 0%{?fedora_version}
# only rpm -i (not rpm {-U|-F})
if [ $1 = 1 ]; then
/sbin/chkconfig --add openvassd
fi
%endif
%preun
%if 0%{?suse_version}
%stop_on_removal openvassd
%endif
%if 0%{?mandriva_version}
%_preun_service openvassd
%endif
%if 0%{?fedora_version}
# only rpm -e (not rpm {-U|-F})
if [ $1 = 0 ]; then
/sbin/service openvassd stop > /dev/null 2>&1 || :
/sbin/chkconfig --del openvassd
fi
%endif
%postun
%if 0%{?suse_version}
%restart_on_update openvassd
%insserv_cleanup
%endif
%if 0%{?fedora_version}
# only rpm {-U|-F} (not rpm -e)
if [ $1 = 1 ]; then
/sbin/service openvassd condrestart
fi
%endif
%files
%defattr(-,root,root)
%doc CHANGES COPYING ChangeLog README
%config %{_sysconfdir}/logrotate.d/openvassd
%{_initrddir}/openvassd
%{_bindir}/openvas-mkcert-client
%{_bindir}/openvas-mkrand
%{_sbindir}/openvas-adduser
%{_sbindir}/openvas-mkcert
%{_sbindir}/openvas-nvt-sync
%{_sbindir}/openvas-rmuser
%{_sbindir}/openvassd
%dir %{_libdir}/openvas/
%{_libdir}/openvas/plugins
%{_mandir}/man1/openvas-mkcert-client.1*
%{_mandir}/man1/openvas-mkrand.1*
%{_mandir}/man8/openvas-adduser.8*
%{_mandir}/man8/openvas-mkcert.8*
%{_mandir}/man8/openvas-nvt-sync.8*
%{_mandir}/man8/openvas-rmuser.8*
%{_mandir}/man8/openvassd.8*
##%{_localstatedir}/cache/openvas
%{_localstatedir}/lib/openvas
##%dir %{_localstatedir}/log/openvas
%if 0%{?suse_version}
%{_sbindir}/rcopenvassd
%endif
%changelog
* Wed Jun 03 2009 bitshuffler #suse@irc.freenode.org
- Updated to 2.0.2
* Wed Feb 18 2009 bitshuffler #suse@irc.freenode.org
- Updated to 2.0.1
* Thu Dec 21 2008 bitshuffler #suse@irc.freenode.org
- Updated to 2.0.0
* Mon Aug 25 2008 bitshuffler #suse@irc.freenode.org
- Updated to 1.0.2
* Mon Aug 11 2008 bitshuffler #suse@irc.freenode.org
- Init.d script added
* Thu Jul 03 2008 bitshuffler #suse@irc.freenode.org
- Updated to 1.0.1
* Wed Jun 11 2008 bitshuffler #suse@irc.freenode.org
- Initial RPM