File openvas-manager.spec of Package openvas-manager
#
# spec file for package openvas-manager
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: openvas-manager
Version: 2.0.4
Release: 2
License: GPLv2+
Group: Productivity/Networking/Security
Url: http://www.openvas.org
Source0: %{name}-%{version}.tar.gz
Source1: openvasmd.logrotate
Source2: debian.openvas-manager.default
Source3: openvasmd.init.suse
Source4: openvasmd.init.fedora
Source5: openvasmd.init.mandriva
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?fedora_version} || 0%{?scientificlinux_version} || 0%{?centos_version}
BuildRequires: sqlite-devel
%endif
%if 0%{?mandriva_version}
BuildRequires: libsqlite3-devel
BuildRequires: pinentry-gtk2
%endif
%if 0%{?suse_version}
BuildRequires: sqlite3-devel
PreReq: %insserv_prereq
PreReq: %fillup_prereq
%endif
BuildRequires: cmake >= 2.6.0
BuildRequires: doxygen
BuildRequires: glib2-devel
BuildRequires: libopenvas-devel
BuildRequires: pkgconfig
Requires: logrotate
Summary: Manager Module of OpenVAS
Patch: ovas-man-add-needed.patch
%description
The OpenVAS-Manager is a layer between OpenVAS-Scanner and various client
applications such as OpenVAS-Client or Greenbone Security Assistant. Among
other features, it adds server-side storage of scan results and it makes it
unnecessary for scan clients to keep connection until a scan finishes.
%prep
%setup -q
%patch
%build
%if 0%{?mandriva_version}
%serverbuild
%endif
export CFLAGS="$RPM_OPT_FLAGS"
%__mkdir build
cd build
cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DSYSCONFDIR=%{_sysconfdir} \
-DLOCALSTATEDIR=%{_localstatedir} \
-DCMAKE_BUILD_TYPE=release
%__make %{?_smp_mflags} VERBOSE=1
%install
pushd build
%__make install DESTDIR=%{buildroot}
popd
%__install -Dm 0644 doc/openvasmd.8 %{buildroot}%{_mandir}/man8/openvasmd.8
%__install -Dm 0644 %{_sourcedir}/openvasmd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/openvas-manager
%if 0%{?suse_version}
%__install -Dm 0755 %{_sourcedir}/openvasmd.init.suse %{buildroot}%{_initrddir}/openvas-manager
%__ln_s %{_initrddir}/openvas-manager %{buildroot}%{_sbindir}/rcopenvas-manager
%__install -Dm 0644 %{_sourcedir}/debian.openvas-manager.default %{buildroot}%{_var}/adm/fillup-templates/sysconfig.openvas-manager
%endif
%if 0%{?fedora_version} || 0%{?scientificlinux_version} || 0%{?centos_version}
%__install -Dm 0755 %{_sourcedir}/openvasmd.init.fedora %{buildroot}%{_initrddir}/openvas-manager
%__install -Dm 0644 %{_sourcedir}/debian.openvas-manager.default %{buildroot}%{_sysconfdir}/sysconfig/openvas-manager
%endif
%if 0%{?mandriva_version}
%__install -Dm 0755 %{_sourcedir}/openvasmd.init.mandriva %{buildroot}%{_initrddir}/openvas-manager
%__install -Dm 0644 %{_sourcedir}/debian.openvas-manager.default %{buildroot}%{_sysconfdir}/sysconfig/openvas-manager
%endif
%__mkdir_p %{buildroot}%{_localstatedir}/lib/openvas/mgr
%__mkdir_p %{buildroot}%{_localstatedir}/log/openvas
touch %{buildroot}%{_localstatedir}/log/openvas/openvasmd.log
%clean
test "%{buildroot}" != "/" && %__rm -rf %{buildroot}
%post
%if 0%{?suse_version}
%fillup_and_insserv openvas-manager
%endif
%if 0%{?mandriva_version}
%_post_service openvas-manager
%endif
%if 0%{?fedora_version} || 0%{?scientificlinux_version} || 0%{?centos_version}
# only rpm -i (not rpm {-U|-F})
if [ $1 = 1 ]; then
/sbin/chkconfig --add openvas-manager
fi
%endif
%preun
%if 0%{?suse_version}
%stop_on_removal openvas-manager
%endif
%if 0%{?mandriva_version}
%_preun_service openvas-manager
%endif
%if 0%{?fedora_version} || 0%{?scientificlinux_version} || 0%{?centos_version}
# only rpm -e (not rpm {-U|-F})
if [ $1 = 0 ]; then
/sbin/service openvas-manager stop > /dev/null 2>&1 || :
/sbin/chkconfig --del openvas-manager
fi
%endif
%postun
%if 0%{?suse_version}
%restart_on_update openvas-manager
%insserv_cleanup
%endif
%if 0%{?fedora_version} || 0%{?scientificlinux_version} || 0%{?centos_version}
# only rpm {-U|-F} (not rpm -e)
if [ $1 = 1 ]; then
/sbin/service openvas-manager condrestart
fi
%endif
%files
%defattr(-,root,root)
%doc CHANGES README
%config(noreplace) %{_sysconfdir}/logrotate.d/openvas-manager
%dir %{_sysconfdir}/openvas
%config(noreplace) %{_sysconfdir}/openvas/openvasmd_log.conf
%{_initrddir}/openvas-manager
%{_sbindir}/openvasmd
%{_mandir}/man8/openvasmd.8*
%{_datadir}/openvas/openvasmd
%dir %{_localstatedir}/lib/openvas
%{_localstatedir}/lib/openvas/mgr
%{_localstatedir}/lib/openvas/openvasmd
%dir %{_localstatedir}/log/openvas
%ghost %{_localstatedir}/log/openvas/openvasmd.log
%if 0%{?suse_version}
%{_sbindir}/rcopenvas-manager
%{_var}/adm/fillup-templates/sysconfig.openvas-manager
%else
%config(noreplace) %{_sysconfdir}/sysconfig/openvas-manager
%endif
%changelog