File apport.spec of Package apport
#
# spec file for package apport
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2007-2008 Nikolay Derkach <nderkach@gmail.com>
#
# 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/
#
%define revno -rev1189
Name: apport
Summary: Automatic crash handler
License: GPL-2.0+
Group: System/Monitoring
Version: 0.114
Release: 0
Url: https://launchpad.net/apport
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: intltool
BuildRequires: python-devel
BuildRequires: texlive-latex
%if %suse_version > 1220
BuildRequires: texlive-amsfonts
BuildRequires: texlive-cm
BuildRequires: texlive-cm-super
BuildRequires: texlive-pdftex
%endif
Requires: apport-crashdb
Requires: python
Requires: python-m2crypto
Requires: python-xml
Requires: python-zypp
Requires: rpm-python
# Need the ability to use pipes in /proc/sys/kernel/core_pattern
Conflicts: kernel < 2.6.24
Requires: binutils
Requires: coreutils
Requires: cron
Requires: gdb
Requires: lsb-release
Requires: modutils
Requires: ptools
Source0: %{name}-%{version}%{revno}.tar.bz2
Source1: rc.apport
Source2: crashdb.conf
Source4: crashdb-gencert
Source99: apport-rpmlintrc
Patch0: apport-report_append.diff
Patch1: apport-lp357024.diff
Patch2: apport-fix_fail_msg.diff
Patch3: apport-cli_use_less.patch
Patch4: apport-anonymize-report.patch
Patch5: apport-use-default-cert.patch
%description
Apport automatically collects data from crashed processes and compiles
a problem report in /var/crash/.
See http://opensuse.org/Interactive_Crash_Analysis for more
information.
%package crashdb-opensuse
Summary: Automatic crash handler
Group: System/Monitoring
Requires: apport = %{version}-%{release}
Requires: ca-certificates
Requires: python-base >= 2.6
Requires: python-m2crypto
Provides: apport-crashdb
%description crashdb-opensuse
Apport automatically collects data from crashed processes and compiles
a problem report in /var/crash/.
See http://opensuse.org/Interactive_Crash_Analysis for more
information.
%package gtk
Summary: GTK frontend for the apport crash report system
Group: System/Monitoring
Requires: apport = %{version}-%{release}
Requires: procps
Requires: python-gtk
Supplements: packageand(apport:python-gtk)
%description gtk
This package contains the GTK frontend for the apport crash report system.
%package qt
Summary: Qt4 frontend for the apport crash report system
Group: System/Monitoring
Requires: apport = %{version}-%{release}
Requires: procps
Requires: python-qt4
Supplements: packageand(apport:python-qt4)
%description qt
This package contains the Qt4 frontend for the apport crash report system.
%prep
%setup -q -n apport-%{version}
%patch0 -p1
%patch1 -p1
%patch2
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
python setup.py build
make -C po %{?_smp_mflags}
make -C gtk %{?_smp_mflags}
make -C qt4 %{?_smp_mflags}
make -C doc %{?_smp_mflags}
# set up the packaging backend
cp backends/packaging_rpm.py apport
cp backends/packaging_opensuse.py apport/packaging_impl.py
%install
python setup.py install --root=%{buildroot} --prefix=/usr
%find_lang %{name}
# install init script
%__install -d -m755 %{buildroot}%{_sysconfdir}/init.d
%__install -m755 %SOURCE1 %{buildroot}%{_sysconfdir}/init.d/apport
%__install -d -m755 %{buildroot}%{_sbindir}
ln -s %{_sysconfdir}/init.d/apport %{buildroot}%{_sbindir}/rcapport
# install man pages
%__install -d -m755 %{buildroot}%{_mandir}/man1
%__install -m644 man/apport-{cli,unpack}.1 %{buildroot}%{_mandir}/man1
%__install -m644 man/dupdb-admin.1 %{buildroot}%{_mandir}/man1
%__install -d -m755 %{buildroot}%{_sysconfdir}/%{name}/blacklist.d
%__install -m644 doc/README.blacklist %{buildroot}%{_sysconfdir}/%{name}/blacklist.d
# cron job
%__install -d -m755 %{buildroot}%{_sysconfdir}/cron.daily
%__install -m755 debian/apport.cron.daily %{buildroot}%{_sysconfdir}/cron.daily/apport
# openSUSE crashdb files
%__install -m644 %SOURCE2 %{buildroot}%{_sysconfdir}/%{name}/crashdb.conf
# rm unneeded files
%__rm -f %{buildroot}%{_datadir}/%{name}/general-hooks/automatix.py
%__rm -rf %{buildroot}%{_datadir}/%{name}/testsuite/
%__rm -f %{buildroot}%{_bindir}/*_hook
%__rm -f %{buildroot}%{_bindir}/{kernel_crashdump,kernel_oops}
# We'll handle the docs in the %files section
%__rm -rf %{buildroot}%{_datadir}/doc/apport
#These apps aren't packaged at the moment
%__rm -f %{buildroot}%{_bindir}/apport-{chroot,retrace}
%preun
%stop_on_removal apport
%postun
%restart_on_update apport
%insserv_cleanup
%files -f %{name}.lang
%defattr(-,root,root)
%{_bindir}/dupdb-admin
%{_bindir}/apport-cli
%{_bindir}/apport-checkreports
%{_bindir}/apport-unpack
%{_sbindir}/rcapport
%doc doc/data-format.pdf doc/package-hooks.txt
%doc %{_mandir}/man1/apport-cli.1*
%doc %{_mandir}/man1/apport-unpack.1*
%doc %{_mandir}/man1/dupdb-admin.1*
%dir %{_sysconfdir}/apport
%dir %{_sysconfdir}/%{name}/blacklist.d
%doc %{_sysconfdir}/%{name}/blacklist.d/README.blacklist
%{_sysconfdir}/cron.daily/apport
%{_sysconfdir}/init.d/apport
# data files
%dir %{_datadir}/apport
%dir %{_datadir}/%{name}/general-hooks
%dir %{_datadir}/%{name}/package-hooks
%{_datadir}/%{name}/apport
%{_datadir}/%{name}/package-hooks/source_apport.py
%{_datadir}/%{name}/package-hooks/source_linux.py
%{_datadir}/icons/*
%{_datadir}/mime/packages/apport.xml
# python modules
%dir %python_sitelib/apport
%python_sitelib/%{name}/*.py*
%python_sitelib/problem_report.py*
%python_sitelib/apport_python_hook.py*
%python_sitelib/*egg-info
%files crashdb-opensuse
%defattr(-,root,root)
%config %{_sysconfdir}/%{name}/crashdb.conf
%doc doc/crashdb-conf.txt
%dir %python_sitelib/%{name}/crashdb_impl
%python_sitelib/%{name}/crashdb_impl/*
%files gtk
%defattr(-,root,root)
%{_bindir}/apport-gtk
%{_datadir}/%{name}/apport-gtk.glade
%files qt
%defattr(-,root,root)
%{_bindir}/apport-qt
%{_datadir}/%{name}/*.ui
%changelog