File apport.spec of Package apport

#
# spec file for package apport (Version 0.114)
#
# Copyright (c) 2007-2008 Nikolay Derkach <nderkach@gmail.com>
# Copyright (c) 2008 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

%define revno -rev1166

Name:           apport
Version:        0.120
Release:        0
License:        GPL v2 or later
Url:            https://launchpad.net/apport
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  intltool python-devel texlive-latex
# Need the ability to use pipes in /proc/sys/kernel/core_pattern
Requires:       kernel-default >= 2.6.24
Requires:       rpm-python python-zypp cron
Requires:       lsb-core-noarch
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/service
Source0:        %{name}-%{version}%{revno}.tar.bz2
Group:          System/Monitoring
Summary:        Automatic crash handler

%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.



Authors:
--------
    Martin Pitt

%package gtk
License:        GPL v2 or later
Summary:        GTK frontend for the apport crash report system
Group:          System/Monitoring
Requires:       python-gtk procps
Requires:       apport = %{version}-%{release}

%description gtk
GTK frontend for the apport crash report system



Authors:
--------
    Martin Pitt

%package qt
License:        GPL v2 or later
Summary:        Qt4 frontend for the apport crash report system
Group:          System/Monitoring
Requires:       python-qt4 procps
Requires:       apport = %{version}-%{release}

%description qt
Qt4 frontend for the apport crash report system



Authors:
--------
    Martin Pitt

%prep
%setup -n apport-%{version}%{revno}

%build
python setup.py build
make -C po
make -C gtk
make -C qt4
make -C doc
# 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}/etc/init.d 
%__install -m755 apport.init.opensuse %{buildroot}/etc/init.d/apport
# install man pages
%__install -d -m755 %{buildroot}%{_mandir}/man1
%__install -m644 man/apport-{cli,unpack}.1 %{buildroot}%{_mandir}/man1
%__install -d -m755 %{buildroot}/etc/apport/blacklist.d
# cron job
%__install -d -m755 %{buildroot}/etc/cron.daily
%__install -m755 debian/apport.cron.daily %{buildroot}/etc/cron.daily/apport
# rm unneeded files
%__rm -f %{buildroot}/usr/bin/apport-{chroot,retrace}
%__rm -f %{buildroot}/usr/bin/kernel_{crashdump,oops}
%__rm -f %{buildroot}/usr/share/apport/general-hooks/automatix.py
%__rm -rf %{buildroot}/usr/share/apport/testsuite/
%__rm -f %{buildroot}/usr/bin/*_hook
# We'll handle the docs in the %files section
%__rm -rf %{buildroot}/usr/share/doc/apport                      

%clean
%__rm -rf %{buildroot}

%post
# Add proper symlinks in /etc/init.d/rc*.d
/sbin/chkconfig --add apport
# start apport service
if [ -f /proc/sys/kernel/core_pattern ] ; then
    /sbin/service apport start
fi

%preun
# Really uninstalling? Stop the service and remove its links
if [ "$1" == "0" ]; then
    %stop_on_removal apport
    /sbin/chkconfig --del apport
fi

%postun
# Upgrading? Restart the service, if it's running
if [ "$1" -ge "1" ]; then
    %restart_on_update apport
    %insserv_cleanup
fi

%files -f %{name}.lang
%defattr(-,root,root)
/usr/bin/dupdb-admin
/usr/bin/apport-cli
/usr/bin/apport-checkreports
/usr/bin/apport-unpack
%doc doc/data-format.pdf doc/crashdb-conf.txt doc/package-hooks.txt
%doc %{_mandir}/man1/apport-cli.1*
%doc %{_mandir}/man1/apport-unpack.1*
%dir /etc/apport
%config /etc/apport/crashdb.conf
%dir /etc/apport/blacklist.d
%doc doc/README.blacklist
/etc/cron.daily/apport
/etc/init.d/apport
# data files
%dir /usr/share/apport
# FIXME: unable to package empty dirs?
#%dir /usr/share/apport/general-hooks
%dir /usr/share/apport/package-hooks
/usr/share/apport/apport
/usr/share/apport/package-hooks/source_apport.py
/usr/share/apport/package-hooks/source_linux.py
/usr/share/icons/*
/usr/share/mime/packages/apport.xml
# python modules
%dir %py_sitedir/apport
%py_sitedir/apport/*
%py_sitedir/problem_report.py*
%py_sitedir/apport_python_hook.py*
%py_sitedir/*egg-info

%files gtk
%defattr(-,root,root)
/usr/bin/apport-gtk
/usr/share/apport/apport-gtk.glade

%files qt
%defattr(-,root,root)
/usr/bin/apport-qt
/usr/share/apport/*.ui

%changelog
openSUSE Build Service is sponsored by