File rss2email.spec of Package rss2email

Name:           rss2email
Version:        2.71
Release:        7%{?dist}
Summary:        Deliver news from RSS feeds to your SMTP server as text or HTML mail

Group:          Applications/Internet
License:        GPLv2 or GPLv3
URL:            http://www.allthingsrss.com/rss2email/
Source0:        http://www.allthingsrss.com/rss2email/rss2email-%{version}.tar.gz 
# Fedora variant of the "r2e" shell-wrapper script to run rss2email.py
# in its home directory.
Source3:        rss2email-r2e
# man page taken from
# http://ftp.de.debian.org/debian/pool/main/r/rss2email/rss2email_2.71-2.debian.tar.gz
# but with a few modifications and fixes
Source4:        rss2email-r2e.1

# Let rss2email also look for ${HOME}/.rss2email/config.py
# Remove the sys.path.insert(0,'.') module search path list alteration.
# Problem and intended purpose of the patch reported upstream.
Patch0:         rss2email-2.70-config-location.patch

# Patches included in Debian package.
Patch1003: 0003-Setup-the-correct-version-number-in-rss2email.py.patch
Patch1006: 0006-Prefer-utf8-in-CHARSET_LIST.patch
Patch1008: 0008-Fix-encoding-of-From-and-To-headers.patch.diff

BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# These Python modules are imported by rss2email.
# The rss2email tarball contains copies of them, because some dists ship
# old modules which result in rss2email bug reports. We want to use the
# external packages due to Fedora packaging policies.
#
# 2011-01-12
#  - feedparser in Fedora 14 : 4.1
#  - feedparser in rss2email 2.66 to 2.70 : 4.2-pre
# 2011-04-11
#  - feedparser 5.0.2 in Fedora >= 14
#  - html2text 3.02 on its way to Fedora >= 15
Requires:       python-feedparser >= 5.0.1
Requires:       python-html2text >= 3.01

%description
rss2email lets you subscribe to a list of XML newsfeeds (RSS or Atom). It can
parse them regularly with the help of cron and send new items to you by email.

An HTML mail will be send in the default configuration to the local SMTP server.
See the manual page r2e for details on how to set up rss2email.


%prep
# 2.71 tarball contains bad file permissions
# even for the top dir
%setup -q -c -n %{name}-fakeroot
chmod +x *
chmod +rw * -R
cp -a %{name}-%{version}/* .

chmod -x CHANGELOG readme* config*
# prepare the custom "r2e" wrapper script
cat %{SOURCE3} | sed -e 's!@datadir@!%{_datadir}!' > r2e

%patch0 -p1 -b .config-location
%patch1003 -p1 -b .correct-version-number
%patch1006 -p1 -b .prefer-utf8-in-charset-list
%patch1008 -p1 -b .fix-encoding-of-from-and-to-headers

sed -i -e 's/\r//' CHANGELOG rss2email.py config.py.example


%build


%install
mkdir -p  \
   $RPM_BUILD_ROOT%{_bindir}/ \
   $RPM_BUILD_ROOT%{_datadir}/%{name}/  \
   $RPM_BUILD_ROOT%{_mandir}/man1/

install -p -m 0755 rss2email.py $RPM_BUILD_ROOT%{_datadir}/%{name}/
install -p -m 0755 r2e $RPM_BUILD_ROOT%{_bindir}/r2e
install -p -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man1/r2e.1
# the copy in docdir may not be present for an --excludedocs install
install -p -m 0644 config.py.example $RPM_BUILD_ROOT%{_datadir}/%{name}/


%files
%doc CHANGELOG readme.html config.py.example
%{_bindir}/*
%{_datadir}/%{name}/
%{_mandir}/man1/*


%changelog
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.71-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.71-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Mar  4 2013 Michael Schwendt <mschwendt@fedoraproject.org> - 2.71-5
- Add a few patches from Debian package:
  0003-Setup-the-correct-version-number-in-rss2email.py.patch
  0006-Prefer-utf8-in-CHARSET_LIST.patch
  0008-Fix-encoding-of-From-and-To-headers.patch.diff
- Merge a few updates for the manual page.
- Minor spec clean-up to remove superfluous items.

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.71-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.71-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.71-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Apr 11 2011 Michael Schwendt <mschwendt@fedoraproject.org> - 2.71-1
- Upgrade to 2.71.
- Fix bad tarball permissions.
- Increase minimum version in python-feedparser and python-html2text
  dependencies to match what upstream wants for this release.

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.70-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Jan 12 2011 Michael Schwendt <mschwendt@fedoraproject.org> - 2.70-1
- Upgrade to 2.70.
- Update r2e wrapper script.
- Patch config.py loader (now first look in current dir like upstream,
  but if not found look for $HOME/.rss2email/config.py).
- Include config.py.example also in the documentation directory.
- Various minor spec file adjustments.

* Sun Jul 04 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.66-1
- update to 2.66, which now is shipped in a tarball 

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.65-3.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.65-2.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Jan 06 2009 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.65-1
- update to 2.65
- recreate rss2email-use-configpy-from-homedir.patch

* Sun Oct 26 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.64-1
- update to 2.64
- drop rss2email-warn-if-problems-with-local-mta.patch, something similar now
  upstream

* Fri Jul 04 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.63-1
- update to 2.63 (GPLv3 now)

* Sat Jan 19 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.62-1
- Update to 2.62

* Fri Dec 14 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 2.61-1
- Update to 2.61

* Fri Aug 03 2007 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info>
- Update License field due to the "Licensing guidelines changes"

* Sun Mar 25 2007 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.60-3
- Use sed instead of dos2unix
- Some small fixes from review bug #233715
- Apply one patch from Debian that should warn if there are problems with
  local delivery via sendmail

* Sat Mar 24 2007 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.60-2
- Seperate package for html2text, as it might be useful for other stuff
  as well
- update r2e and make it possible to manage different feed files (optional,
  use r2e option "--feedext foo" to use it)
- add some common used, but-no-so-well documented configuration parameters
  to config.py template and give a hint where to find docs what they do

* Fri Mar 23 2007 Thorsten Leemhuis <fedora[AT]leemhuis.info> - 2.60-1
- Initial package
openSUSE Build Service is sponsored by