Blob Blame History Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:           gnome-activity-journal
Version:        0.3.3
Release:        1%{?dist}
Summary:        Browse and search your Zeitgeist activities

Group:          Applications/File
License:        GPLv3+
URL:            https://launchpad.net/%{name}
Source0:        http://launchpad.net/%{name}/0.3/%{version}/+download/%{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# Patch to try to get setup.py to make a better installation.
# Has been submitted to the gnome-activity-journal for comments.
Patch0:         %{name}-0.3.3-install-fixes.patch
# Simple patch to get rid of rpmlint error about non-executable script
Patch1:         %{name}-non-executable-script-fix.patch

BuildArch:      noarch
BuildRequires:  python-devel python-distutils-extra desktop-file-utils intltool
Requires:       zeitgeist
Requires:       hicolor-icon-theme
Requires:       pygtk2 pygobject2
Requires:       gnome-python2-gnome gnome-python2-gconf pycairo
Requires:       pyxdg python-pygments

Requires(pre):   GConf2
Requires(post):  GConf2
Requires(preun): GConf2

%pre
# From https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#GConf
if [ "$1" -gt 1 ]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule \
      %{_sysconfdir}/gconf/schemas/%{name}.schemas >/dev/null || :
fi

%post
# From https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Icon_Cache
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

# From https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#GConf
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
  %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :

%preun
# From https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#GConf
if [ "$1" -eq 0 ]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule \
      %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
fi

%postun
# From https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Icon_Cache
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
# From https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Icon_Cache
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%description
GNOME Activity Journal is a tool for easily
browsing and finding files on your computer.
It shows a chronological journal of all file
activity.

%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build
%{__python} setup.py build


%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

# The gconf schema file doesn't get installed by setup.py so we do it by hand here
%{__install} -Dp -m0644 build/etc/gconf/schemas/%{name}.schemas \
    %{buildroot}%{_sysconfdir}/gconf/schemas/%{name}.schemas

%find_lang %{name}
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop

# Make sure the bin script is executable
chmod 755 %{buildroot}/%{_bindir}/%{name}.sh

%clean
rm -rf $RPM_BUILD_ROOT


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc README PKG-INFO AUTHORS
%{_bindir}/*
%{_datadir}/gnome-activity-journal
%{_datadir}/icons/hicolor/*/*
%{_datadir}/pixmaps/*
%{_datadir}/applications/*
%{_datadir}/man/*/*
%{python_sitelib}/*

%{_sysconfdir}/gconf/schemas/%{name}.schemas

%changelog
* Sun Feb 21 2010 Mads Villadsen <maxx@krakoa.dk> - 0.3.3-1
- Update to new release
- Added a patch for better installation
- spec file updated to handle GConf schema, icons, languages, more
- Add intltool to BuildRequires

* Fri Jan 22 2010 Mads Villadsen <maxx@krakoa.dk> - 0.3.2-1
- Initial package