Michal Toman ce7e8a7
%{!?python_site: %define python_site %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")}
Michal Toman ce7e8a7
Michal Toman ce7e8a7
Summary: Application for remote coredump analysis
Michal Toman ce7e8a7
Name: retrace-server
Michal Toman 31295a7
Version: 1.3
Michal Toman 2cac60b
Release: 1%{?dist}
Michal Toman ce7e8a7
License: GPLv2+
Michal Toman ce7e8a7
Group: Applications/System
Michal Toman ce7e8a7
URL: https://fedorahosted.org/abrt/wiki/AbrtRetraceServer
Michal Toman ce7e8a7
Source: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
Michal Toman ce7e8a7
Michal Toman 2cac60b
BuildArch: noarch
Michal Toman 2cac60b
Michal Toman ce7e8a7
BuildRequires: intltool
Michal Toman ce7e8a7
BuildRequires: libtool
Michal Toman ce7e8a7
BuildRequires: texinfo
Michal Toman 162d376
BuildRequires: asciidoc
Michal Toman 162d376
BuildRequires: xmlto
Michal Toman ce7e8a7
Michal Toman ce7e8a7
%{?el6:Requires: python-argparse}
Michal Toman ce7e8a7
Requires: rsync
Michal Toman 31295a7
Requires: mock >= 1.1.11
Michal Toman ce7e8a7
Requires: xz
Michal Toman ce7e8a7
Requires: elfutils
Michal Toman ce7e8a7
Requires: createrepo
Michal Toman ce7e8a7
Requires: mod_wsgi
Michal Toman ce7e8a7
Requires: mod_ssl
Michal Toman ce7e8a7
Requires: python-webob
Michal Toman 31295a7
Requires: yum-utils
Michal Toman ce7e8a7
Requires(preun): /sbin/install-info
Michal Toman ce7e8a7
Requires(post): /sbin/install-info
Michal Toman ce7e8a7
Michal Toman ce7e8a7
Obsoletes: abrt-retrace-server < 2.0.3
Michal Toman ce7e8a7
Provides: abrt-retrace-server = 2.0.3
Michal Toman ce7e8a7
Michal Toman ce7e8a7
%description
Michal Toman ce7e8a7
The retrace server provides a coredump analysis and backtrace
Michal Toman ce7e8a7
generation service over a network using HTTP protocol.
Michal Toman ce7e8a7
Michal Toman ce7e8a7
%prep
Michal Toman ce7e8a7
%setup -q
Michal Toman ce7e8a7
Michal Toman ce7e8a7
%build
Michal Toman ce7e8a7
autoconf
Michal Toman ce7e8a7
%configure
Michal Toman ce7e8a7
make %{?_smp_mflags}
Michal Toman ce7e8a7
Michal Toman ce7e8a7
%install
Michal Toman ce7e8a7
make install DESTDIR=${RPM_BUILD_ROOT} mandir=%{_mandir}
Michal Toman ce7e8a7
Michal Toman ce7e8a7
mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/cache/%{name}
Michal Toman 162d376
mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/log/%{name}
Michal Toman ce7e8a7
mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/spool/%{name}
Michal Toman ce7e8a7
mkdir -p ${RPM_BUILD_ROOT}/%{_datadir}/%{name}
Michal Toman ce7e8a7
Michal Toman ce7e8a7
rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir
Michal Toman ce7e8a7
Michal Toman ce7e8a7
%{find_lang} %{name}
Michal Toman ce7e8a7
Michal Toman 162d376
%pre
Michal Toman 162d376
#retrace uid/gid reserved in setup, rhbz #706012
Michal Toman 162d376
%define retrace_gid_uid 174
Michal Toman 162d376
getent group retrace > /dev/null || groupadd -f -g %{retrace_gid_uid} --system retrace
Michal Toman 162d376
getent passwd retrace > /dev/null || useradd --system -g retrace -u %{retrace_gid_uid} -d %{_datadir}/%{name} -s /sbin/nologin retrace
Michal Toman 162d376
exit 0
Michal Toman 162d376
Michal Toman ce7e8a7
%post
Michal Toman ce7e8a7
/sbin/install-info %{_infodir}/%{name} %{_infodir}/dir 2> /dev/null || :
Michal Toman 2cac60b
/usr/sbin/usermod -a -G mock apache 2> /dev/null || :
Michal Toman 2cac60b
Michal Toman 31295a7
if [ "$1" = 1 ]
Michal Toman 31295a7
then
Michal Toman 2cac60b
#add disabled crontab entry to apache's crontab
Michal Toman 31295a7
    %define apache_crontab_entry "# 0 * * * * /usr/bin/retrace-server-cleanup >> /var/log/retrace-server/cleanup_error.log 2>&1"
Michal Toman 31295a7
    (crontab -u apache -l 2> /dev/null; echo %{apache_crontab_entry}) | crontab -u apache - 2> /dev/null
Michal Toman 31295a7
fi
Michal Toman ce7e8a7
Michal Toman ce7e8a7
%preun
Michal Toman ce7e8a7
if [ "$1" = 0 ]
Michal Toman ce7e8a7
then
Michal Toman 162d376
    /sbin/install-info --delete %{_infodir}/retrace-server %{_infodir}/dir 2> /dev/null || :
Michal Toman 2cac60b
#remove retrace-server related entries from apache's crontab
Michal Toman 2cac60b
    (crontab -u apache -l 2> /dev/null | sed "/%{name}/d") | crontab -u apache - 2> /dev/null
Michal Toman ce7e8a7
fi
Michal Toman ce7e8a7
Michal Toman ce7e8a7
%files -f %{name}.lang
Michal Toman ce7e8a7
%defattr(-,root,root,-)
Michal Toman ce7e8a7
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}-httpd.conf
Michal Toman ce7e8a7
%config(noreplace) %{_sysconfdir}/%{name}.conf
Michal Toman ce7e8a7
%config(noreplace) %{_sysconfdir}/yum.repos.d/%{name}.repo
Michal Toman 162d376
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
Michal Toman 162d376
%dir %attr(0755,retrace,retrace) %{_localstatedir}/cache/%{name}
Michal Toman 31295a7
%dir %attr(0775,retrace,apache) %{_localstatedir}/log/%{name}
Michal Toman 162d376
%dir %attr(0775,retrace,apache) %{_localstatedir}/spool/%{name}
Michal Toman ce7e8a7
%dir %{_datadir}/%{name}
Michal Toman 2cac60b
%{_bindir}/%{name}-worker
Michal Toman ce7e8a7
%{_bindir}/%{name}-cleanup
Michal Toman ce7e8a7
%{_bindir}/%{name}-reposync
Michal Toman ce7e8a7
%{_bindir}/coredump2packages
Michal Toman 31295a7
%{python_site}/retrace/*
Michal Toman ce7e8a7
%{_datadir}/%{name}/*
Michal Toman 2cac60b
%attr(0600,root,root) %{_localstatedir}/spool/cron/retrace
Michal Toman 162d376
%doc %{_mandir}/man1/%{name}-cleanup.1.gz
Michal Toman 162d376
%doc %{_mandir}/man1/%{name}-reposync.1.gz
Michal Toman 162d376
%doc %{_mandir}/man1/%{name}-worker.1.gz
Michal Toman ce7e8a7
%doc %{_infodir}/%{name}*
Michal Toman ce7e8a7
%doc COPYING INSTALL README TODO
Michal Toman ce7e8a7
Michal Toman ce7e8a7
%changelog
Michal Toman 31295a7
* Tue Aug 23 2011 Michal Toman <mtoman@redhat.com> 1.3-1
Michal Toman 31295a7
- cron jobs are not enabled by default
Michal Toman 31295a7
- support X-Task-Type header
Michal Toman 31295a7
- use atomic operations to lock/rename
Michal Toman 31295a7
- add support for http(s) and ftp in reposync
Michal Toman 31295a7
- abort if release is not supported
Michal Toman 31295a7
- add option to use createrepo --update
Michal Toman 31295a7
- add support for F16
Michal Toman 31295a7
Michal Toman 2cac60b
* Wed Jun 29 2011 Michal Toman <mtoman@redhat.com> 1.2-1
Michal Toman 2cac60b
- add option to verify GPG signatures
Michal Toman 2cac60b
- make HTTPS optional
Michal Toman 2cac60b
- use RetraceTask class
Michal Toman 2cac60b
- validate input
Michal Toman 2cac60b
- limit allowed files
Michal Toman 2cac60b
- do not allow worker to start twice
Michal Toman 2cac60b
- ship cron configuration
Michal Toman 2cac60b
- do not require suid launcher
Michal Toman 2cac60b
- minor bug and typo fixes
Michal Toman 2cac60b
Michal Toman 162d376
* Wed Jun 01 2011 Scott Dodson <sdodson@redhat.com> 1.1-2
Michal Toman 162d376
- Add asciidocs xmlto to BuildRequires
Michal Toman 162d376
* Wed Jun 01 2011 Michal Toman <mtoman@redhat.com> 1.1-1
Michal Toman 162d376
- add logrotate script
Michal Toman 162d376
- add asciidoc support and manpages
Michal Toman 162d376
- replace rm by os.remove() and shutil.rmtree()
Michal Toman 162d376
- call du and df without block factor
Michal Toman 162d376
- use communicate() instead of .stdout.read()
Michal Toman 162d376
- replace popen by execlp
Michal Toman 162d376
- import manual from ABRT git, minor changes
Michal Toman 162d376
- create log directory
Michal Toman 162d376
- use 'retrace' user and group
Michal Toman 162d376
Michal Toman ce7e8a7
* Wed May 18 2011 Michal Toman <mtoman@redhat.com> 1.0-1
Michal Toman ce7e8a7
- initial packaging