%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Summary: OsX Like Dashboard
Name: screenlets
Version: 0.0.14
Release: alt1

License: GPL
Url: http://www.screenlets.org/
Group: User Interface/Desktops
Packager: Radik Yusupov <Usupov.Radik@cg.ru>

Source: http://code.launchpad.net/screenlets/trunk/0.0.14/+download/%name-%version.tar.gz
Source1: logo24.png

BuildRequires: python-devel
BuildRequires: desktop-file-utils

Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils

Requires: gnome-python2 gnome-python2-rsvg
Requires: pygtk2
Requires: pyxdg
Requires: dbus-python
Requires: gnome-python2-desktop
Requires: gnome-python2-gnomekeyring
Requires: gnome-python2-libwnck
Requires: python-imaging

BuildArch: noarch

ExcludeArch: s390 s390x ppc64

%description
Screenlets are small owner-drawn applications (written in Python)
that can be described as "the virtual representation of things
lying/standing around on your desk". Sticknotes, clocks, rulers, ...
the possibilities are endless

You need Compiz or Beryl to use screenlets

%prep
%setup -q -n %name
# Fix paths
grep -rl '/usr/local' * | xargs sed -i 's,/usr/local,%prefix,g'
# Fix dodgy desktop files
find -name *.desktop -exec sed -i 's/^\(Exec=.*\) >.*$/\1/' {} \;

%build
%python_build

%install

%python_install

install -d %buildroot%_datadir/%name
install -m0644 %SOURCE1 %buildroot%_datadir/%name/logo24.png

install -d %buildroot%_iconsdir
install -m0644 desktop-menu/screenlets.svg %buildroot%_iconsdir/screenlets.svg

desktop-file-install --vendor fedora --delete-original \
  --dir %buildroot%_desktopdir \
  --add-category X-Fedora \
%buildroot%_desktopdir/%name-manager.desktop

%post
update-mime-database %_datadir/mime &>/dev/null || :
update-desktop-database %_desktopdir &> /dev/null || :

%postun
update-mime-database %_datadir/mime &>/dev/null || :
update-desktop-database %_desktopdir &> /dev/null || :




%files
%doc CHANGELOG README TODO
%_bindir/*
%dir %_datadir/%name
%_iconsdir/%name.svg
%python_sitelibdir/screenlets/*
%python_sitelibdir/screenlets-*-py2.5.egg-info
%_datadir/screenlets-*
%_datadir/screenlets/*
%_desktopdir/fedora-screenlets-manager.desktop

%changelog
* Mon Apr 21 2008 Arkady L. Shane <ashejn@yandex-team.ru> - 0.0.14-1
- initial build for Fedora