[rss2email] - Upgrade to 2.70. - Update r2e wrapper script. - Patch config.py loader (now first look in current

Michael Schwendt mschwendt at fedoraproject.org
Wed Jan 12 18:55:48 UTC 2011


commit 8657ef4b7b350b1837b1b4a961f3899441b10f66
Author: Michael Schwendt <mschwendt at fedoraproject.org>
Date:   Wed Jan 12 19:55:37 2011 +0100

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

 .gitignore                                |    1 +
 rss2email-2.70-config-location.patch      |   22 +++++++++++
 rss2email-config.py.template              |   13 -------
 rss2email-r2e                             |   19 ++++++----
 rss2email-r2e.1                           |    4 +-
 rss2email-use-configpy-from-homedir.patch |   13 -------
 rss2email.spec                            |   55 +++++++++++++++++++---------
 sources                                   |    2 +-
 8 files changed, 74 insertions(+), 55 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 5fe7c04..80547ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 rss2email-2.66.tar.gz
+/rss2email-2.70.tar.gz
diff --git a/rss2email-2.70-config-location.patch b/rss2email-2.70-config-location.patch
new file mode 100644
index 0000000..a884141
--- /dev/null
+++ b/rss2email-2.70-config-location.patch
@@ -0,0 +1,22 @@
+diff -Nur rss2email-2.70-orig/rss2email.py rss2email-2.70/rss2email.py
+--- rss2email-2.70-orig/rss2email.py	2010-12-17 19:29:34.000000000 +0100
++++ rss2email-2.70/rss2email.py	2011-01-12 18:57:25.775331913 +0100
+@@ -254,11 +254,13 @@
+ 
+ # Read options from config file if present.
+ import sys
+-sys.path.insert(0,".")
+-try:
+-	from config import *
+-except:
+-	pass
++import os
++cfgpaths = [os.path.join(os.getcwd(),"config.py"),
++	    os.path.join(os.environ["HOME"],".rss2email/config.py"),]
++for cfgfile in cfgpaths:
++	if os.path.exists(cfgfile):
++		execfile(cfgfile)
++		break
+ 
+ warn = sys.stderr
+ 	
diff --git a/rss2email-r2e b/rss2email-r2e
index b72dfd4..7ec377a 100644
--- a/rss2email-r2e
+++ b/rss2email-r2e
@@ -1,21 +1,24 @@
 #!/bin/sh
-if [ ! -e "${HOME}/.rss2email" ]
+datadir=@datadir@
+r2ehome=${datadir}/rss2email
+cfgtemplate=${r2ehome}/config.py.example
+dotr2e=${HOME}/.rss2email
+
+if [ ! -e ${dotr2e} ]
 then
-	mkdir "${HOME}/.rss2email"
+	mkdir ${dotr2e}
 fi
 
-if [ ! -e "${HOME}/.rss2email/config.py" ] && [ -e /usr/share/rss2email/config.py.template ]
+if [ ! -e ${dotr2e}/config.py ] && [ -e ${cfgtemplate} ]
 then
-	cp -a "/usr/share/rss2email/config.py.template" "${HOME}/.rss2email/config.py"
+	cp -a ${cfgtemplate} ${dotr2e}/config.py
 fi
 
 if [ "${1}" = "--feedext" ] && [ "${2}" ]
 then
 	fileext="${2}"
 	shift 2
-	exec python /usr/share/rss2email/rss2email.py ${HOME}/.rss2email/feeds.dat."${fileext}" "$@"
+	exec python ${r2ehome}/rss2email.py ${dotr2e}/feeds.dat."${fileext}" "$@"
 else
-	exec python /usr/share/rss2email/rss2email.py ${HOME}/.rss2email/feeds.dat "$@"
+	exec python ${r2ehome}/rss2email.py ${dotr2e}/feeds.dat "$@"
 fi
-
-
diff --git a/rss2email-r2e.1 b/rss2email-r2e.1
index 80b4680..b54dcbf 100644
--- a/rss2email-r2e.1
+++ b/rss2email-r2e.1
@@ -6,7 +6,7 @@ r2e \- receive RSS feeds by email
 .SH DESCRIPTION
 .BR r2e
 is a simple program which you can run in your crontab.
-It watches RSS feeds and sends you nicely formatted email message
+It watches RSS feeds and sends you a nicely formatted email message
 for each new item.
 .P
 The program is configured by ~/.rss2email/config.py
@@ -70,6 +70,6 @@ The database of feeds. Use r2e to add, remove, or modify feeds, do not edit
 it directly.
 .TP
 .B ~/.rss2email/config.py
-If this file exists, it it read to configure the program.
+If this file exists, it is read to configure the program.
 .SH AUTHOR
 Aaron Swartz <rss2email at aaronsw.com>
diff --git a/rss2email.spec b/rss2email.spec
index 4203c4f..6db9b6a 100644
--- a/rss2email.spec
+++ b/rss2email.spec
@@ -1,23 +1,31 @@
 Name:           rss2email
-Version:        2.66
-Release:        1.1
-Summary:        Deliver news from RSS feeds to your smtp server as text or html mail
+Version:        2.70
+Release:        0.2
+Summary:        Deliver news from RSS feeds to your SMTP server as text or HTML mail
 
 Group:          Applications/Internet
-License:        GPLv3
+License:        GPLv2 or GPLv3
 URL:            http://www.allthingsrss.com/rss2email/
-Source0:        http://www.allthingsrss.com/rss2email/rss2email-2.66.tar.gz 
-# Fedora variant of http://lindsey.smith.googlepages.com/r2e , which since 2.66
-# is included in the rss2email tarball
+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.debian.org/debian/pool/main/r/rss2email/rss2email_2.60-3.diff.gz
 Source4:        rss2email-r2e.1
-Patch0:         rss2email-use-configpy-from-homedir.patch
-BuildArch:      noarch
 
+# 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
+
+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.
 Requires:       python-feedparser
 Requires:       python-html2text
 
@@ -25,15 +33,18 @@ Requires:       python-html2text
 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.
 
-A HTML mail will be send in the default configuration to the local smtp server.
-See the man page r2e for details how to set rss2email up.
+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
 %setup -q
-# let rss2email use ${HOME}/.rss2email/config.py
-%patch0 -b .patch0 
-sed -i -e 's/\r//' CHANGELOG rss2email.py
+chmod -x CHANGELOG readme* config*
+# prepare the custom "r2e" wrapper script
+cat %{SOURCE3} | sed -e 's!@datadir@!%{_datadir}!' > rss2email-r2e
+
+%patch0 -p1 -b .config-location
+sed -i -e 's/\r//' CHANGELOG rss2email.py config.py.example
 
 
 %build
@@ -48,10 +59,10 @@ mkdir -p  \
    $RPM_BUILD_ROOT%{_mandir}/man1/
 
 install -p -m 0755 rss2email.py $RPM_BUILD_ROOT%{_datadir}/%{name}/
-install -p -m 0755 %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/r2e
-sed -i -e 's;/usr/share;%{_datadir};g' $RPM_BUILD_ROOT%{_bindir}/r2e
+install -p -m 0755 rss2email-r2e $RPM_BUILD_ROOT%{_bindir}/r2e
 install -p -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man1/r2e.1
-install -p -m 0644 config.py $RPM_BUILD_ROOT%{_datadir}/%{name}/config.py.template
+# the copy in docdir may not be present for an --excludedocs install
+install -p -m 0644 config.py.example $RPM_BUILD_ROOT%{_datadir}/%{name}/
 
 
 %clean
@@ -60,12 +71,20 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
-%doc CHANGELOG readme.html
+%doc CHANGELOG readme.html config.py.example
 %{_bindir}/*
 %{_datadir}/%{name}/
 %{_mandir}/man1/*
 
 %changelog
+* Wed Jan 12 2011 Michael Schwendt <mschwendt at 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 
 
diff --git a/sources b/sources
index 9bfa107..9d080bf 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-84a7aa98b52952e37dd239fefb01e9d9  rss2email-2.66.tar.gz
+f99a273ce66712bdcdab04d203571290  rss2email-2.70.tar.gz


More information about the scm-commits mailing list