30e612b
#This number is the sequence number on intevation.org to download a file
03a6958
%global         tar_download 2287
03a6958
%global         tar_version 6.0.9
30e612b
%global         up_name greenbone-security-assistant
30e612b
%global         short_name gsad
30e612b
30e612b
30e612b
#Name not same as upstream package to match the naming convention of the OpenVAS suite
30e612b
Name:           openvas-gsa
30e612b
Version:        %{tar_version}
xambroz 2c36c19
Release:        3%{?dist}
30e612b
Summary:        Greenbone Security Assistant (GSA) is GUI to the OpenVAS
30e612b
30e612b
License:        GPLv2+
30e612b
URL:            http://www.openvas.org
30e612b
Source0:        http://wald.intevation.org/frs/download.php/%{tar_download}/%{up_name}-%{tar_version}.tar.gz
30e612b
Source2:        %{name}.logrotate
30e612b
Source3:        %{name}.sysconfig
30e612b
30e612b
%if 0%{?rhel} >= 7 || 0%{?fedora} > 15
30e612b
Source4:        %{name}.service
30e612b
%else
30e612b
Source1:        %{name}.initd
30e612b
%endif
30e612b
30e612b
30e612b
# Put certs to /etc/pki as suggested by http://fedoraproject.org/wiki/PackagingDrafts/Certificates
30e612b
# Not reported upstream as it is RedHat/Fedora specific
30e612b
Patch1:         %{name}-pki.patch
30e612b
5bba992
# Fix the order of definitions
5bba992
# already patched upstream
5bba992
Patch2:         %{name}-glib.patch
5bba992
xambroz 6216f00
# patch MHD_create_response_from_data => MHD_create_response_from_buffer
xambroz 6216f00
Patch3:         %{name}-libmicrohttpd.patch
xambroz 6216f00
xambroz 6216f00
30e612b
BuildRequires:  openvas-libraries-devel >= 7.0
30e612b
BuildRequires:  cmake >= 2.6.0
30e612b
BuildRequires:  glib2-devel
30e612b
BuildRequires:  libgcrypt-devel
30e612b
BuildRequires:  libxslt-devel
30e612b
BuildRequires:  libmicrohttpd-devel
30e612b
BuildRequires:  doxygen
30e612b
BuildRequires:  xmltoman
30e612b
BuildRequires:  gpgme-devel
98a1b6b
BuildRequires:  gettext
30e612b
30e612b
Requires:       logrotate
da4b2f3
Requires:       texlive-changepage
da4b2f3
Requires:       texlive-comment
30e612b
30e612b
%if 0%{?rhel} >= 7 || 0%{?fedora} > 15
30e612b
BuildRequires:          systemd
30e612b
Requires(post):         systemd
30e612b
Requires(preun):        systemd
30e612b
Requires(postun):       systemd
30e612b
%else
30e612b
Requires(post):         chkconfig
30e612b
Requires(preun):        chkconfig
30e612b
Requires(preun):        initscripts
30e612b
%endif
30e612b
30e612b
30e612b
%description
30e612b
The Greenbone Security Assistant (GSA) is a lean web service offering a user
30e612b
web interface for the Open Vulnerability Assessment System (OpenVAS).
30e612b
The GSA uses XSL transformation style-sheets that converts OMP responses
30e612b
from the OpenVAS infrastructure into presentable HTML.
30e612b
30e612b
%prep
30e612b
%setup -q -n %{up_name}-%{version}
30e612b
%patch1 -p1 -b .pki
5bba992
%patch2 -p1 -b .glib
xambroz 6216f00
%patch3 -p1 -b .libmicrohttpd
30e612b
#Fix encoding issues
30e612b
iconv -f Windows-1250 -t utf-8 < CHANGES > CHANGES.utf8
30e612b
touch -r CHANGES CHANGES.utf8
30e612b
mv CHANGES.utf8 CHANGES
30e612b
iconv -f Windows-1250 -t utf-8 < ChangeLog > ChangeLog.utf8
30e612b
touch -r ChangeLog ChangeLog.utf8
30e612b
mv ChangeLog.utf8 ChangeLog
30e612b
30e612b
30e612b
%build
30e612b
export CFLAGS="$RPM_OPT_FLAGS -Werror=unused-but-set-variable -lgpg-error -Wno-error=deprecated-declarations"
30e612b
%cmake -DLOCALSTATEDIR:PATH=%{_var} -DSYSCONFDIR:PATH=/etc/
30e612b
make %{?_smp_mflags} VERBOSE=1
30e612b
30e612b
%install
30e612b
make install DESTDIR=%{buildroot} INSTALL="install -p"
30e612b
30e612b
# Config directory
30e612b
mkdir -p %{buildroot}/%{_sysconfdir}/openvas
30e612b
chmod 755 %{buildroot}/%{_sysconfdir}/openvas
30e612b
30e612b
# Log directory
30e612b
mkdir -p %{buildroot}/%{_var}/log/openvas
30e612b
touch %{buildroot}%{_var}/log/openvas/%{name}.log
30e612b
30e612b
# Install log rotation stuff
30e612b
install -m 644 -Dp %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
30e612b
30e612b
# Install sysconfig configration
30e612b
install -Dp -m 644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
30e612b
30e612b
%if 0%{?rhel} >= 7 || 0%{?fedora} > 15
30e612b
# Install systemd
30e612b
install -Dp -m 644 %{SOURCE4} %{buildroot}/%{_unitdir}/%{name}.service
30e612b
%else
30e612b
# Install startup script
30e612b
install -Dp -m 755 %{SOURCE1} %{buildroot}/%{_initddir}/%{name}
30e612b
%endif
30e612b
424780d
%find_lang gsad_xsl
424780d
30e612b
%if 0%{?rhel} >= 7 || 0%{?fedora} > 15
30e612b
%post
30e612b
%systemd_post %{name}.service
30e612b
30e612b
%preun
30e612b
%systemd_preun %{name}.service
30e612b
30e612b
%postun
30e612b
%systemd_postun_with_restart %{name}.service
30e612b
30e612b
%else
30e612b
#Post scripts for systemv initd
30e612b
%post
30e612b
# This adds the proper /etc/rc*.d links for the script
30e612b
if [ "$1" -eq 1 ] ; then
30e612b
        /sbin/chkconfig --add openvas-gsa
30e612b
fi
30e612b
30e612b
%preun
30e612b
if [ "$1" -eq 0 ] ; then
30e612b
        /sbin/service openvas-gsa stop >/dev/null 2>&1
30e612b
        /sbin/chkconfig --del openvas-gsa
30e612b
fi
30e612b
30e612b
%postun
30e612b
# only for upgrades not erasure
30e612b
if [ "$1" -eq 1 ] ; then
30e612b
        /sbin/service openvas-gsa condrestart  >/dev/null 2>&1
30e612b
fi
30e612b
%endif
30e612b
30e612b
30e612b
424780d
%files -f gsad_xsl.lang
30e612b
%{!?_licensedir:%global license %%doc}
30e612b
%license COPYING
30e612b
%doc CHANGES ChangeLog README
30e612b
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
30e612b
%config(noreplace) %{_sysconfdir}/openvas/%{short_name}_log.conf
30e612b
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
30e612b
%dir %{_sysconfdir}/openvas
30e612b
%dir %{_datadir}/openvas
30e612b
%dir %{_datadir}/openvas/gsa
30e612b
%dir %{_var}/log/openvas
30e612b
%{_sbindir}/%{short_name}
30e612b
%{_mandir}/man8/%{short_name}.8*
30e612b
%{_datadir}/openvas/gsa/
30e612b
%dir %{_localstatedir}/log/openvas/
30e612b
%ghost %{_localstatedir}/log/openvas/%{name}.log
30e612b
424780d
30e612b
%if 0%{?rhel} >= 7 || 0%{?fedora} > 15
30e612b
%{_unitdir}/%{name}.service
30e612b
%else
30e612b
%{_initrddir}/%{name}
30e612b
%endif
30e612b
30e612b
30e612b
%changelog
xambroz 2c36c19
* Thu Feb 25 2016 Michal Ambroz <rebus at, seznam.cz> - 6.0.9-3
xambroz 2c36c19
- patch obsolete libmicrohttpd API for MHD_HTTP_METHOD_NOT_ACCEPTABLE 
xambroz 2c36c19
xambroz 6c0d1db
* Wed Feb 24 2016 Michal Ambroz <rebus at, seznam.cz> - 6.0.9-2
xambroz 6216f00
- patch obsolete libmicrohttpd API for MHD_create_response_from_data
xambroz 6216f00
xambroz 6216f00
* Tue Feb 23 2016 Michal Ambroz <rebus at, seznam.cz> - 6.0.9-1
03a6958
- bump to OpenVas-8 version 6.0.9
03a6958
b81c14e
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.6-4
b81c14e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
b81c14e
488cd4c
* Thu Nov 05 2015 Kalev Lember <klember@redhat.com> - 6.0.6-3
488cd4c
- Rebuilt for libmicrohttpd soname bump
488cd4c
da4b2f3
* Sun Oct 04 2015 josef radinger <cheese@nosuchhost.net> - 6.0.6-2
da4b2f3
- add Requires on texlive-comment and texlive-changepage
da4b2f3
9cb9c6b
* Tue Sep 29 2015 josef radinger <cheese@nosuchhost.net> - 6.0.6-1
9cb9c6b
- bump version
9cb9c6b
91d745a
* Sat Aug 22 2015 Michal Ambroz <rebus at, seznam.cz> - 6.0.5-1
91d745a
- bump to OpenVas-8 version 6.0.5
91d745a
- 1254456 - fix logrotate script
91d745a
424780d
* Wed Jul 15 2015 Michal Ambroz <rebus at, seznam.cz> - 6.0.4-1
424780d
- bump to OpenVas-8 version 6.0.4
424780d
30e612b
* Wed Jun 24 2015 Michal Ambroz <rebus at, seznam.cz> - 6.0.3-4
30e612b
- import to Fedora repository
30e612b
30e612b
* Wed Jun 17 2015 Michal Ambroz <rebus at, seznam.cz> - 6.0.3-3
30e612b
- changes from package review
30e612b
30e612b
* Wed Jun 17 2015 Michal Ambroz <rebus at, seznam.cz> - 6.0.3-1
30e612b
- bump to OpenVas-8 version 6.0.3
30e612b
30e612b
* Tue Nov 04 2014 Michal Ambroz <rebus at, seznam.cz> - 5.0.4-2
30e612b
- remove sysvinit support
30e612b
- add setgroups patch as noted by the rpmlint
30e612b
- fixed encoding problems for the changelogs
30e612b
- marked logrotate script as config
30e612b
30e612b
* Tue Nov 04 2014 Michal Ambroz <rebus at, seznam.cz> - 5.0.4-1
30e612b
- bump to OpenVas-7 version 5.0.4
30e612b
30e612b
* Tue Sep 16 2014 Michal Ambroz <rebus at, seznam.cz> - 5.0.3-1
30e612b
- bump to OpenVas-7 version 5.0.3
30e612b
30e612b
* Tue Sep 02 2014 Michal Ambroz <rebus at, seznam.cz> - 5.0.2-1
30e612b
- bump to OpenVas-7 version 5.0.2
30e612b
30e612b
* Tue Jun 17 2014 Michal Ambroz <rebus at, seznam.cz> - 5.0.1-1
30e612b
- initial build of OpenVas-7 version 5.0.1
30e612b