Blob Blame History Raw
%define pyver %(python -c 'import sys ; print sys.version[:3]')
%define pynext %(python -c 'print %{pyver} + 0.1')

Name:           straw
Version:        0.22.1
Release:        4
Epoch:          0
Summary:        GNOME desktop news aggregator

Group:          Applications/Internet
License:        GPL
URL:            http://www.nongnu.org/straw
Source0:	http://savannah.nongnu.org/download/straw/straw-0.22.1.tar.bz2
Patch1:         straw-desktop.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:	noarch

BuildRequires:  python-devel, pygtk2-libglade, pyorbit
BuildRequires:	desktop-file-utils
BuildRequires:	gnome-python2, gnome-python2-gconf, gnome-python2-gnomevfs, gnome-python2-gtkhtml2
# FC2 does not need python-bsddb as this is part of python >= 2.3
%if "%{pyver}" < "2.3"
BuildRequires:	python-bsddb >= 0:4.1
Requires:	python-bsddb >= 0:4.1
%endif
Requires:	python >= 0:%{pyver}, python < 0:%{pynext}
Requires:	gnome-python2-gconf, gnome-python2-gnomevfs, gnome-python2-gtkhtml2
# Note: python-adns optional but recommended
Requires:	python-adns
Requires:       pygtk2-libglade, gnome-python2, gnome-python2-gnomevfs, pyorbit
# Dropped for versions >= 0.22
# Requires:	mx
Requires(post):		GConf2
Requires(preun):	GConf2

%description
Straw is a desktop news aggregator for the GNOME environment.
Its aim is to be a faster, easier and more accessible way
to read news and blogs than the traditional browser.


%prep
%setup -q
%patch1 -p1 -b .baddesktop

%build
python setup.py build


%install
rm -rf $RPM_BUILD_ROOT
python setup.py install --root $RPM_BUILD_ROOT \
    --prefix %_prefix --sysconfdir %_sysconfdir \
    --disable-schemas-install
# Produce .pyo files to be %ghost'ed.
python -Oc 'from compileall import *; compile_dir("'$RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/%{name}'")'

desktop-file-install \
  --vendor fedora \
  --mode 644 \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  --add-category X-Fedora \
  --delete-original \
  $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop

%post
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
	%{_sysconfdir}/gconf/schemas/straw.schemas >/dev/null

%clean
rm -rf $RPM_BUILD_ROOT

%preun
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule \
	%{_sysconfdir}/gconf/schemas/straw.schemas >/dev/null

%files
%defattr(-,root,root,-)
%doc LICENSE NEWS README TODO
%config %{_sysconfdir}/gconf/schemas/*.schemas
%{_bindir}/*
%dir %{_libdir}/python%{pyver}/site-packages/%{name}
%{_libdir}/python%{pyver}/site-packages/%{name}/*.py
%{_libdir}/python%{pyver}/site-packages/%{name}/*.pyc
%ghost %{_libdir}/python%{pyver}/site-packages/%{name}/*.pyo
%{_datadir}/applications/*.desktop
%{_datadir}/locale/*/LC_MESSAGES/%{name}.mo
%{_datadir}/pixmaps/*
%{_datadir}/%{name}


%changelog
* Tue May  4 2004 Michael Schwendt <mschwendt[AT]users.sf.net> 0:0.22.1-0.fdr.4
- Fix python-bsddb requirement.

* Sat Apr 17 2004 Michel Salim <salimma[AT]users.sf.net> 0:0.22.1-0.fdr.3
- Put back conditional python-bsddb dep in cleaner form; Vim is happy now
- Split GConf2 post,preun req

* Fri Apr 16 2004 Michel Salim <salimma[AT]users.sf.net> 0:0.22.1-0.fdr.2
- removed troublesome conditional python-bsddb dependency; made it compulsory
  (just comment out the line if building under FC2)
- Touched up desktop file patch
- Added missing BuildRequires and Requires
- Dropped mx dependency; only needed for upgrades

* Wed Mar 17 2004 Noa Resare <noa@resare.com> 0:0.22.1-0.fdr.1
- bumped to new version
- added build dependencies python-bsddb, gnome-python2-gconf and
  gnome-python2-gnomevfs
- fixed overly long name in desktop file

* Sat Jan 10 2004 Michel Alexandre Salim <salimma[AT]users.sf.net> 0:0.21.2-0.fdr.3
- Now uses build system's Python version instead of hardcoded 2.2
- Added missing dependency on gnome-python2-gconf

* Thu Dec 25 2003 Michel Alexandre Salim <salimma[AT]users.sf.net> 0:0.21.2-0.fdr.2
- Provided GConf schema uninstall

* Wed Dec 24 2003 Michel Alexandre Salim <salimma[AT]users.sf.net> 0:0.21.2-0.fdr.1
- Update to new stable release

* Sun Nov 02 2003 Michel Alexandre Salim <salimma[AT]users.sf.net> 0:0.20-0.fdr.1
- Update to new stable release, 0.20

* Fri Oct 24 2003 Michel Alexandre Salim <salimma[AT]users.sourceforge.net>  0:0.20-0.fdr.0.cvs031027
- CVS build
- removed PyXML dependency
                                                                                
* Sat May 31 2003 Michel Alexandre Salim <salimma[AT]users.sourceforge.net> 0:0.18.1-0.fdr.1
- Initial RPM release.