diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index e69de29..0000000 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4067c02 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +CHANGELOG +rss2email.py diff --git a/Makefile b/Makefile deleted file mode 100644 index 2a8b2b6..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: rss2email -# $Id$ -NAME := rss2email -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/rss2email-config.py.template b/rss2email-config.py.template new file mode 100644 index 0000000..3118aef --- /dev/null +++ b/rss2email-config.py.template @@ -0,0 +1,13 @@ +# Find some common used config options below; all can be found all and +# descriptions in the section titled "### Vaguely Customizable Options ###" +# near the top of /usr/share/rss2email/rss2email.py + +DEFAULT_FROM="bozo@dev.null.invalid" +HTML_MAIL=1 +SMTP_SEND=1 +SMTP_SERVER="localhost" +AUTHREQUIRED=0 +SMTP_USER="username" +SMTP_PASS="password" +DATE_HEADER=0 +# PROXY="" diff --git a/rss2email-r2e b/rss2email-r2e new file mode 100644 index 0000000..b72dfd4 --- /dev/null +++ b/rss2email-r2e @@ -0,0 +1,21 @@ +#!/bin/sh +if [ ! -e "${HOME}/.rss2email" ] +then + mkdir "${HOME}/.rss2email" +fi + +if [ ! -e "${HOME}/.rss2email/config.py" ] && [ -e /usr/share/rss2email/config.py.template ] +then + cp -a "/usr/share/rss2email/config.py.template" "${HOME}/.rss2email/config.py" +fi + +if [ "${1}" = "--feedext" ] && [ "${2}" ] +then + fileext="${2}" + shift 2 + exec python /usr/share/rss2email/rss2email.py ${HOME}/.rss2email/feeds.dat."${fileext}" "$@" +else + exec python /usr/share/rss2email/rss2email.py ${HOME}/.rss2email/feeds.dat "$@" +fi + + diff --git a/rss2email-r2e.1 b/rss2email-r2e.1 new file mode 100644 index 0000000..80b4680 --- /dev/null +++ b/rss2email-r2e.1 @@ -0,0 +1,75 @@ +.TH R2E 1a +.SH NAME +r2e \- receive RSS feeds by email +.SH SYNOPSIS +.B r2e action [options] +.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 +for each new item. +.P +The program is configured by ~/.rss2email/config.py +.P +For a quick start with r2e, try these steps: +.P +.RS +.nf +.BI "r2e new " your@address +.BI "r2e add " http://feed.url/somewhere.rss +.BI "r2e run " +.RE +.P +The last command should eventually be put into your crontab, if you +want things be sent you automatically. +.SH ACTIONS +.TP +.B new [youremail] +Create a new feedfile. If the second option is specified, it sets the +default email address that mails are sent to. +.TP +.B add url [youremail] +Subscribe to a feed. The first option is the URL of the feed. +The optional second option is the email address to send new items to. +Repeat for each feed you want to subscribe to. +.TP +.B run [--no-send] [num] +Scan the feeds and send emails for new items. This can be run in a cron +job. +.P +The --no-send option stops r2e from sending any email. This can be +useful the first time you run it, as otherwise it would send every +available story. +.P +If a number is specified, r2e will only download that feed. The list +command lists the feed numbers. +.TP +.B email yournewemail +Change the default email address. +.TP +.B list +List all your currently subscribed feeds. +.TP +.B delete n +Delete a feed, using its number from the list command. +.SH "CONFIGURATION" +The program's behavior can be controlled via the ~/.rss2email/config.py +config file. The file is a python file, so variables are set using a syntax +like this: VARIABLE = "value" +.P +If the value is a number, the quotes may be omitted. Most configuration +variables in the file are boolean values, where a 1 indicates the option is +set, and a 0 disables it. +.P +See the example config.py file for a full list of available configuration +variables. +.SH FILES +.TP +.B ~/.rss2email/feeds.dat +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. +.SH AUTHOR +Aaron Swartz diff --git a/rss2email-use-configpy-from-homedir.patch b/rss2email-use-configpy-from-homedir.patch new file mode 100644 index 0000000..5f2ee2c --- /dev/null +++ b/rss2email-use-configpy-from-homedir.patch @@ -0,0 +1,13 @@ +--- rss2email.py.org 2007-03-23 23:35:20.000000000 +0100 ++++ rss2email.py 2007-03-23 23:40:37.000000000 +0100 +@@ -199,8 +199,8 @@ + ### Load the Options ### + + # Read options from config file if present. +-import sys +-sys.path.append(".") ++import sys, os ++sys.path.append(os.path.join(os.environ["HOME"],".rss2email/")); + try: + from config import * + except: diff --git a/rss2email-warn-if-problems-with-local-mta.patch b/rss2email-warn-if-problems-with-local-mta.patch new file mode 100644 index 0000000..b0bed22 --- /dev/null +++ b/rss2email-warn-if-problems-with-local-mta.patch @@ -0,0 +1,14 @@ +--- rss2email.py.org 2007-03-23 23:35:20.000000000 +0100 ++++ rss2email.py 2007-03-25 09:42:39.000000000 +0200 +@@ -182,6 +182,11 @@ + i, o = os.popen2(["/usr/sbin/sendmail", recipient]) + i.write(msg_as_string) + i.close(); o.close() ++ pid, status = os.wait() ++ if status != 0: ++ print >>warn, "" ++ print >>warn, ('Fatal error: sendmail exited with code %s' % status) ++ sys.exit(1) + del i, o + return None + diff --git a/rss2email.spec b/rss2email.spec new file mode 100644 index 0000000..e30b2e6 --- /dev/null +++ b/rss2email.spec @@ -0,0 +1,92 @@ +Name: rss2email +Version: 2.60 +Release: 3%{?dist} +Summary: Deliver news from RSS feeds to your smtp server as text or html mail + +Group: Applications/Internet +License: GPL +URL: http://rss2email.infogami.com/ +Source0: http://rss2email.infogami.com/rss2email.py +Source1: http://rss2email.infogami.com/CHANGELOG +# Fedora variant of http://lindsey.smith.googlepages.com/r2e +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 +Source5: rss2email-config.py.template +Patch0: rss2email-use-configpy-from-homedir.patch +# patch taken from +# http://ftp.debian.org/debian/pool/main/r/rss2email/rss2email_2.60-3.diff.gz +Patch1: rss2email-warn-if-problems-with-local-mta.patch +BuildArch: noarch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Requires: python-feedparser +Requires: python-html2text + +%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. + +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. + + +%prep +%setup -q -c -T +install -p -m 0644 %{SOURCE0} rss2email.py +install -p -m 0644 %{SOURCE1} CHANGELOG.html +# let rss2email use ${HOME}/.rss2email/config.py +%patch0 -b .patch0 +%patch1 -b .patch1 +sed -i -e 's/\r//' CHANGELOG.html rss2email.py + + +%build +echo nothing to build + + +%install +rm -rf $RPM_BUILD_ROOT +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 %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/r2e +sed -i -e 's;/usr/share;%{_datadir};g' $RPM_BUILD_ROOT%{_bindir}/r2e +install -p -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man1/r2e.1 +install -p -m 0644 %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/%{name}/config.py.template + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc CHANGELOG.html +%{_bindir}/* +%{_datadir}/%{name}/ +%{_mandir}/man1/* + +%changelog +* Sun Mar 24 2007 Thorsten Leemhuis - 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 - 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 - 2.60-1 +- Initial package diff --git a/sources b/sources index e69de29..4d5bae9 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +6f64601b5f1b27bbe140ce869f166688 CHANGELOG +c1f452fffcbc03ad1b2fab2f9c42b76a rss2email.py