5667b94
Name:		openvas-manager
5667b94
Summary:	Manager Module for the Open Vulnerability Assessment System (OpenVAS)
48491e2
Version:	2.0.3
48491e2
Release:	1%{?dist}
5667b94
URL:		http://www.openvas.org
5667b94
License:	GPLv2+
5667b94
Group:		System Environment/Libraries
5667b94
5667b94
Source0:	http://wald.intevation.org/frs/download.php/858/%{name}-%{version}.tar.gz
5667b94
Source1:	openvas-manager.initd
5667b94
Source2:	openvas-manager.logrotate
5667b94
Source3:	openvas-manager.sysconfig
5667b94
5667b94
#Patch to avoid compile-time errors about variable set but not used
5667b94
Patch0:		openvas-manager-notused.patch
5667b94
5667b94
#Put certs to /etc/pki as suggested by http://fedoraproject.org/wiki/PackagingDrafts/Certificates
5667b94
#Not reported upstream as it is RedHat/Fedora specific
5667b94
Patch1:		openvas-manager-pki.patch
5667b94
48491e2
#Patch to install to report templates with specified DESTDIR variabe
48491e2
Patch2:		openvas-manager-destdir.patch
48491e2
5667b94
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root
5667b94
BuildRequires:	openvas-libraries-devel
5667b94
BuildRequires:	cmake >= 2.6.0
5667b94
BuildRequires:	glib2-devel
5667b94
BuildRequires:	sqlite-devel
5667b94
BuildRequires:	gnutls-devel
5667b94
BuildRequires:	libpcap-devel
5667b94
BuildRequires:	gpgme-devel
5667b94
BuildRequires:	doxygen
5667b94
BuildRequires:	pkgconfig
6634bc7
# This is introduced to accomodate difference in RHEL5/CentOS5
6634bc7
%if %{defined rhel}
6634bc7
%if 0%{?rhel} <= 5
6634bc7
#RHEL5
48491e2
BuildRequires:	e2fsprogs-libs-devel
6634bc7
%else
6634bc7
#RHEL6
48491e2
BuildRequires:	libuuid-devel
6634bc7
%endif
6634bc7
%else
6634bc7
#Fedora 14 doesn't have "rhel" defined
48491e2
BuildRequires:	libuuid-devel
6634bc7
%endif
6634bc7
5667b94
Requires:	logrotate
5667b94
Requires:	/usr/bin/xsltproc
5667b94
5667b94
Requires(post):		chkconfig
5667b94
Requires(preun):	chkconfig
5667b94
Requires(preun):	initscripts
5667b94
5667b94
5667b94
%description
5667b94
The OpenVAS Manager is the central service that consolidates plain vulnerability
5667b94
scanning into a full vulnerability management solution. The Manager controls the
5667b94
Scanner via OTP and itself offers the XML-based, stateless OpenVAS Management 
5667b94
Protocol (OMP). All intelligence is implemented in the Manager so that it is
5667b94
possible to implement various lean clients that will behave consistently e.g. 
5667b94
with regard to filtering or sorting scan results. The Manager also controls 
5667b94
a SQL database (sqlite-based) where all configuration and scan result data is 
5667b94
centrally stored.
5667b94
5667b94
5667b94
%prep
5667b94
%setup -q
5667b94
%patch0 -p1 -b .notused
5667b94
%patch1 -p1 -b .pki
48491e2
%patch2 -p1 -b .destdir
5667b94
5667b94
%build
5667b94
export CFLAGS="$RPM_OPT_FLAGS -Werror=unused-but-set-variable"
5667b94
%cmake -DLOCALSTATEDIR:PATH=%{_var}
5667b94
make %{?_smp_mflags} VERBOSE=1
5667b94
5667b94
%install
5667b94
rm -rf %{buildroot}
5667b94
5667b94
make install DESTDIR=%{buildroot} INSTALL="install -p"
5667b94
5667b94
#Config directory
5667b94
mkdir -p %{buildroot}/%{_sysconfdir}/openvas
5667b94
chmod 755 %{buildroot}/%{_sysconfdir}/openvas
5667b94
5667b94
#Log direcotry
5667b94
mkdir -p %{buildroot}/%{_var}/log/openvas
5667b94
touch %{buildroot}%{_var}/log/openvas/openvasmd.log
5667b94
5667b94
#Runtime lib directory
5667b94
mkdir -p %{buildroot}/%{_var}/lib/openvas/mgr
5667b94
5667b94
# Install startup script
5667b94
install -Dp -m 755 %{SOURCE1} %{buildroot}/%{_initddir}/%{name}
5667b94
5667b94
# install log rotation stuff
5667b94
install -m 644 -Dp %{SOURCE2} \
5667b94
	%{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
5667b94
5667b94
# Install sysconfig configration
5667b94
install -Dp -m 644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
5667b94
5667b94
#Fix permissions on templates
5667b94
chmod -R a+r %{buildroot}%{_datadir}/openvas/openvasmd
5667b94
find %{buildroot}%{_datadir}/openvas/openvasmd -name generate | xargs chmod 755
5667b94
5667b94
%clean
5667b94
[ "%{buildroot}" = "/" ] || rm -rf %{buildroot}
5667b94
5667b94
5667b94
%post
5667b94
# This adds the proper /etc/rc*.d links for the script
5667b94
if [ "$1" -eq 1 ] ; then
5667b94
	/sbin/chkconfig --add openvas-manager
5667b94
fi
5667b94
5667b94
5667b94
%preun
5667b94
if [ "$1" -eq 0 ] ; then
5667b94
	/sbin/service openvas-manager stop >/dev/null 2>&1
5667b94
	/sbin/chkconfig --del openvas-manager
5667b94
fi
5667b94
5667b94
5667b94
%postun
5667b94
# only for upgrades not erasure
5667b94
if [ "$1" -eq 1 ] ; then
5667b94
	/sbin/service openvas-manager condrestart  >/dev/null 2>&1
5667b94
fi
5667b94
5667b94
5667b94
%files
5667b94
%defattr(-,root,root)
5667b94
%doc CHANGES COPYING README ChangeLog INSTALL TODO
5667b94
%doc doc/*.png doc/*.sql doc/*.html doc/report-format-HOWTO
5667b94
%doc report_formats
5667b94
%config(noreplace) %{_sysconfdir}/logrotate.d/openvas-manager
5667b94
%dir %{_sysconfdir}/openvas
5667b94
%dir %{_var}/lib/openvas
5667b94
%dir %{_var}/lib/openvas/mgr
48491e2
%dir %{_var}/lib/openvas/openvasmd
48491e2
%dir %{_var}/lib/openvas/openvasmd/report_formats
5667b94
%dir %{_var}/log/openvas
5667b94
%dir %{_datadir}/openvas
5667b94
%config(noreplace) %{_sysconfdir}/openvas/openvasmd_log.conf
5667b94
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
5667b94
%{_initrddir}/%{name}
5667b94
%{_sbindir}/openvasmd
5667b94
%{_mandir}/man8/openvasmd.8*
5667b94
%{_datadir}/openvas/openvasmd
5667b94
%ghost %{_var}/log/openvas/openvasmd.log
5667b94
5667b94
%changelog
48491e2
* Tue Apr 19 2011 Michal Ambroz <rebus at, seznam.cz> - 2.0.3-1
48491e2
- bump to bugfix release
48491e2
6634bc7
* Wed Apr 14 2011 Michal Ambroz <rebus at, seznam.cz> - 2.0.2-4
6634bc7
- apply BR for EL5 from openvas-scanner
6634bc7
5667b94
* Wed Mar 30 2011 Michal Ambroz <rebus at, seznam.cz> - 2.0.2-3
5667b94
- implement changes based on package review
5667b94
5667b94
* Wed Mar 30 2011 Michal Ambroz <rebus at, seznam.cz> - 2.0.2-2
5667b94
- implement changes based on package review
5667b94
5667b94
* Mon Mar 28 2011 Michal Ambroz <rebus at, seznam.cz> - 2.0.2-1
5667b94
- initial spec for openvas-manager based on openvas-scanner