Michal Toman eee810c
%{!?python_site: %define python_site %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")}
Michal Toman eee810c
Michal Toman eee810c
Summary: Application for remote coredump analysis
Michal Toman eee810c
Name: retrace-server
Michal Toman 6e780c2
Version: 1.6
Michal Toman b23c1ac
Release: 1%{?dist}
Michal Toman eee810c
License: GPLv2+
Michal Toman eee810c
Group: Applications/System
Michal Toman eee810c
URL: https://fedorahosted.org/abrt/wiki/AbrtRetraceServer
Michal Toman eee810c
Source: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
Michal Toman eee810c
Michal Toman dbebecd
BuildArch: noarch
Michal Toman dbebecd
Michal Toman eee810c
BuildRequires: intltool
Michal Toman eee810c
BuildRequires: libtool
Michal Toman eee810c
BuildRequires: texinfo
Michal Toman 045cecb
BuildRequires: asciidoc
Michal Toman 045cecb
BuildRequires: xmlto
Michal Toman eee810c
Michal Toman eee810c
%{?el6:Requires: python-argparse}
Michal Toman eee810c
Requires: rsync
Michal Toman 0a774e0
Requires: mock >= 1.1.11
Michal Toman eee810c
Requires: xz
Michal Toman eee810c
Requires: elfutils
Michal Toman eee810c
Requires: createrepo
Michal Toman eee810c
Requires: mod_wsgi
Michal Toman eee810c
Requires: mod_ssl
Michal Toman eee810c
Requires: python-webob
Michal Toman 0a774e0
Requires: yum-utils
Michal Toman ccea95e
Requires: crash >= 5.1.7
Michal Toman eee810c
Requires(preun): /sbin/install-info
Michal Toman eee810c
Requires(post): /sbin/install-info
Michal Toman eee810c
Michal Toman eee810c
Obsoletes: abrt-retrace-server < 2.0.3
Michal Toman eee810c
Provides: abrt-retrace-server = 2.0.3
Michal Toman eee810c
Michal Toman eee810c
%description
Michal Toman eee810c
The retrace server provides a coredump analysis and backtrace
Michal Toman eee810c
generation service over a network using HTTP protocol.
Michal Toman eee810c
Michal Toman eee810c
%prep
Michal Toman eee810c
%setup -q
Michal Toman eee810c
Michal Toman eee810c
%build
Michal Toman eee810c
autoconf
Michal Toman eee810c
%configure
Michal Toman eee810c
make %{?_smp_mflags}
Michal Toman eee810c
Michal Toman eee810c
%install
Michal Toman eee810c
make install DESTDIR=${RPM_BUILD_ROOT} mandir=%{_mandir}
Michal Toman eee810c
Michal Toman eee810c
mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/cache/%{name}
Michal Toman ccea95e
mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/cache/%{name}/kernel
Michal Toman 045cecb
mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/log/%{name}
Michal Toman eee810c
mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/spool/%{name}
Michal Toman eee810c
mkdir -p ${RPM_BUILD_ROOT}/%{_datadir}/%{name}
Michal Toman eee810c
Michal Toman eee810c
rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir
Michal Toman eee810c
Michal Toman eee810c
%{find_lang} %{name}
Michal Toman eee810c
Michal Toman 045cecb
%pre
Michal Toman 045cecb
#retrace uid/gid reserved in setup, rhbz #706012
Michal Toman 045cecb
%define retrace_gid_uid 174
Michal Toman 045cecb
getent group retrace > /dev/null || groupadd -f -g %{retrace_gid_uid} --system retrace
Michal Toman 045cecb
getent passwd retrace > /dev/null || useradd --system -g retrace -u %{retrace_gid_uid} -d %{_datadir}/%{name} -s /sbin/nologin retrace
Michal Toman 045cecb
exit 0
Michal Toman 045cecb
Michal Toman eee810c
%post
Michal Toman eee810c
/sbin/install-info %{_infodir}/%{name} %{_infodir}/dir 2> /dev/null || :
Michal Toman dbebecd
/usr/sbin/usermod -a -G mock apache 2> /dev/null || :
Michal Toman dbebecd
Michal Toman 0a774e0
if [ "$1" = 1 ]
Michal Toman 0a774e0
then
Michal Toman dbebecd
#add disabled crontab entry to apache's crontab
Michal Toman 0a774e0
    %define apache_crontab_entry "# 0 * * * * /usr/bin/retrace-server-cleanup >> /var/log/retrace-server/cleanup_error.log 2>&1"
Michal Toman 0a774e0
    (crontab -u apache -l 2> /dev/null; echo %{apache_crontab_entry}) | crontab -u apache - 2> /dev/null
Michal Toman b23c1ac
Michal Toman b23c1ac
#add disabled crontab entries to retrace's crontab
Michal Toman b23c1ac
    %define retrace_crontab_entry1 "#0 0,12 * * * /usr/bin/retrace-server-reposync fedora 15 i386 >> /var/log/retrace-server/reposync_error.log 2>&1"
Michal Toman b23c1ac
    %define retrace_crontab_entry2 "#0 2,14 * * * /usr/bin/retrace-server-reposync fedora 15 x86_64 >> /var/log/retrace-server/reposync_error.log 2>&1"
Michal Toman b23c1ac
    %define retrace_crontab_entry3 "#0 4,16 * * * /usr/bin/retrace-server-reposync fedora 16 i386 >> /var/log/retrace-server/reposync_error.log 2>&1"
Michal Toman b23c1ac
    %define retrace_crontab_entry4 "#0 6,18 * * * /usr/bin/retrace-server-reposync fedora 16 x86_64 >> /var/log/retrace-server/reposync_error.log 2>&1"
Michal Toman b23c1ac
    %define retrace_crontab_entry5 "#0 8,20 * * * /usr/bin/retrace-server-reposync fedora rawhide i386 >> /var/log/retrace-server/reposync_error.log 2>&1"
Michal Toman b23c1ac
    %define retrace_crontab_entry6 "#0 10,22 * * * /usr/bin/retrace-server-reposync fedora rawhide x86_64 >> /var/log/retrace-server/reposync_error.log 2>&1"
Michal Toman b23c1ac
Michal Toman b23c1ac
    (crontab -u retrace -l 2> /dev/null; \
Michal Toman b23c1ac
     echo %{retrace_crontab_entry1}; echo %{retrace_crontab_entry2}; \
Michal Toman b23c1ac
     echo %{retrace_crontab_entry3}; echo %{retrace_crontab_entry4}; \
Michal Toman b23c1ac
     echo %{retrace_crontab_entry5}; echo %{retrace_crontab_entry6};) | crontab -u retrace - 2> /dev/null
Michal Toman 0a774e0
fi
Michal Toman eee810c
Michal Toman eee810c
%preun
Michal Toman eee810c
if [ "$1" = 0 ]
Michal Toman eee810c
then
Michal Toman 045cecb
    /sbin/install-info --delete %{_infodir}/retrace-server %{_infodir}/dir 2> /dev/null || :
Michal Toman dbebecd
#remove retrace-server related entries from apache's crontab
Michal Toman b23c1ac
    (crontab -u apache -l 2> /dev/null | grep -v "%{name}") | crontab -u apache - 2> /dev/null
Michal Toman b23c1ac
Michal Toman b23c1ac
#comment entries in retrace's crontab
Michal Toman b23c1ac
    (crontab -u retrace -l 2> /dev/null | sed "s,^\([^#].*\)$,#\1,g") | crontab -u retrace - 2> /dev/null
Michal Toman eee810c
fi
Michal Toman eee810c
Michal Toman eee810c
%files -f %{name}.lang
Michal Toman eee810c
%defattr(-,root,root,-)
Michal Toman eee810c
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}-httpd.conf
Michal Toman eee810c
%config(noreplace) %{_sysconfdir}/%{name}.conf
Michal Toman 045cecb
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
Michal Toman 045cecb
%dir %attr(0755,retrace,retrace) %{_localstatedir}/cache/%{name}
Michal Toman ccea95e
%dir %attr(0775,retrace,apache) %{_localstatedir}/cache/%{name}/kernel
Michal Toman 0a774e0
%dir %attr(0775,retrace,apache) %{_localstatedir}/log/%{name}
Michal Toman 045cecb
%dir %attr(0775,retrace,apache) %{_localstatedir}/spool/%{name}
Michal Toman eee810c
%dir %{_datadir}/%{name}
Michal Toman dbebecd
%{_bindir}/%{name}-worker
Michal Toman 6e780c2
%{_bindir}/%{name}-interact
Michal Toman eee810c
%{_bindir}/%{name}-cleanup
Michal Toman eee810c
%{_bindir}/%{name}-reposync
Michal Toman eee810c
%{_bindir}/coredump2packages
Michal Toman 0a774e0
%{python_site}/retrace/*
Michal Toman eee810c
%{_datadir}/%{name}/*
Michal Toman 045cecb
%doc %{_mandir}/man1/%{name}-cleanup.1.gz
Michal Toman 6e780c2
%doc %{_mandir}/man1/%{name}-interact.1.gz
Michal Toman 045cecb
%doc %{_mandir}/man1/%{name}-reposync.1.gz
Michal Toman 045cecb
%doc %{_mandir}/man1/%{name}-worker.1.gz
Michal Toman eee810c
%doc %{_infodir}/%{name}*
Michal Toman eee810c
%doc COPYING INSTALL README TODO
Michal Toman eee810c
Michal Toman eee810c
%changelog
Michal Toman 6e780c2
* Fri May 04 2012 Michal Toman <mtoman@redhat.com> 1.6-1
Michal Toman 6e780c2
- add support for interactive debugging
Michal Toman 6e780c2
- coredump2packages - handle malformed eu-unstrip output
Michal Toman 6e780c2
- expose repos via HTTP
Michal Toman 6e780c2
Michal Toman b23c1ac
* Mon Feb 27 2012 Michal Toman <mtoman@redhat.com> 1.5-1
Michal Toman b23c1ac
- add support for F17
Michal Toman b23c1ac
- add hacks helping to depsolver
Michal Toman b23c1ac
- read huge files buffered
Michal Toman b23c1ac
- get rid of retrace-server.repo file
Michal Toman b23c1ac
- add /<task_id>/delete action
Michal Toman b23c1ac
6bdcc09
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-2
6bdcc09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
Michal Toman ccea95e
* Tue Nov 22 2011 Michal Toman <mtoman@redhat.com> 1.4-1
Michal Toman ccea95e
- add support for vmcores
Michal Toman ccea95e
- add welcome page
Michal Toman ccea95e
- add statistics page
Michal Toman ccea95e
- add support for rawhide
Michal Toman ccea95e
Michal Toman 0a774e0
* Tue Aug 23 2011 Michal Toman <mtoman@redhat.com> 1.3-1
Michal Toman 0a774e0
- cron jobs are not enabled by default
Michal Toman 0a774e0
- support X-Task-Type header
Michal Toman 0a774e0
- use atomic operations to lock/rename
Michal Toman 0a774e0
- add support for http(s) and ftp in reposync
Michal Toman 0a774e0
- abort if release is not supported
Michal Toman 0a774e0
- add option to use createrepo --update
Michal Toman 0a774e0
- add support for F16
Michal Toman 0a774e0
Michal Toman dbebecd
* Wed Jun 29 2011 Michal Toman <mtoman@redhat.com> 1.2-1
Michal Toman dbebecd
- add option to verify GPG signatures
Michal Toman dbebecd
- make HTTPS optional
Michal Toman dbebecd
- use RetraceTask class
Michal Toman dbebecd
- validate input
Michal Toman dbebecd
- limit allowed files
Michal Toman dbebecd
- do not allow worker to start twice
Michal Toman dbebecd
- ship cron configuration
Michal Toman dbebecd
- do not require suid launcher
Michal Toman dbebecd
- minor bug and typo fixes
Michal Toman dbebecd
Michal Toman 045cecb
* Wed Jun 01 2011 Scott Dodson <sdodson@redhat.com> 1.1-2
Michal Toman 045cecb
- Add asciidocs xmlto to BuildRequires
Michal Toman 045cecb
* Wed Jun 01 2011 Michal Toman <mtoman@redhat.com> 1.1-1
Michal Toman 045cecb
- add logrotate script
Michal Toman 045cecb
- add asciidoc support and manpages
Michal Toman 045cecb
- replace rm by os.remove() and shutil.rmtree()
Michal Toman 045cecb
- call du and df without block factor
Michal Toman 045cecb
- use communicate() instead of .stdout.read()
Michal Toman 045cecb
- replace popen by execlp
Michal Toman 045cecb
- import manual from ABRT git, minor changes
Michal Toman 045cecb
- create log directory
Michal Toman 045cecb
- use 'retrace' user and group
Michal Toman 045cecb
Michal Toman eee810c
* Wed May 18 2011 Michal Toman <mtoman@redhat.com> 1.0-1
Michal Toman eee810c
- initial packaging