rpms/suck/devel README.Fedora, 1.2, 1.3 suck-4.3.2-samples.patch, 1.1, 1.2 suck.spec, 1.13, 1.14

Jochen Schmitt (s4504kr) fedora-extras-commits at redhat.com
Tue Sep 11 15:49:45 UTC 2007


Author: s4504kr

Update of /cvs/extras/rpms/suck/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14281

Modified Files:
	README.Fedora suck-4.3.2-samples.patch suck.spec 
Log Message:
Allow use of alternative sites


Index: README.Fedora
===================================================================
RCS file: /cvs/extras/rpms/suck/devel/README.Fedora,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- README.Fedora	15 Aug 2007 15:53:21 -0000	1.2
+++ README.Fedora	11 Sep 2007 15:49:12 -0000	1.3
@@ -64,6 +64,9 @@
 
 NNTP_PASS	Password for NNTP authorization (if required)
 
+NNTP_POST       yes = Posting articles to remote host (Default)
+                no  = Don't post articles to remote host
+
 Creating Newsgroups
 
 Befor you can fetch news from the remote newsserver, you have to create
@@ -125,3 +128,27 @@
 If you have posted any article in a newsgroup, you can run getnews as
 described above to transfer the new articles to the newsserver of your 
 provider.
+
+Use of alternative sites
+
+If you want to use an alternative sites, you can create a configuration
+file for each site on the directory:
+
+/etc/news/suck.d/
+
+You can use a random file name for each configuration file.
+
+The content of this file is similar of the site file in
+
+/etc/sysconfig/suck/site
+
+if you want to exchange news to an alternative site, you can call
+getnews as:
+
+getnews <filename>
+
+in this case /etc/news/suck.d/<filename> will be used instead of
+/etc/sysconfig/suck/site.
+
+If you are using several site, please avoid posting articles received
+from one site to anonther site.
\ No newline at end of file

suck-4.3.2-samples.patch:

Index: suck-4.3.2-samples.patch
===================================================================
RCS file: /cvs/extras/rpms/suck/devel/suck-4.3.2-samples.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- suck-4.3.2-samples.patch	8 Nov 2004 05:23:08 -0000	1.1
+++ suck-4.3.2-samples.patch	11 Sep 2007 15:49:12 -0000	1.2
@@ -1,30 +1,6 @@
---- suck-4.3.2/sample/get.news.generic.bak	1999-02-20 00:32:57.000000000 +0100
-+++ suck-4.3.2/sample/get.news.generic	2004-03-25 19:15:48.437267328 +0100
-@@ -9,16 +9,18 @@
- REMOTE_HOST=news.pixi.com
- LOCAL_HOST=localhost
- 
--SPOOLDIR=/usr/spool/news		# base directory for articles to be rposted
--NEWSDIR=/usr/lib/news			# base directory for news binaries 
--BASEDIR=/home/boby/doNews		# base directory for suck rpost and scripts
-+SPOOLDIR=/var/spool/news		# base directory for articles to be rposted
-+NEWSDIR=/var/lib/news			# base directory for news binaries 
-+BASEDIR=/var/lib/news/suck		# base directory for suck rpost and scripts
- 
- SHLOCK=${NEWSDIR}/bin/shlock
- 
- TMPDIR=${BASEDIR}			# location for suck.* files
- MSGDIR=${BASEDIR}/Msgs			# where to put MultiFile articles when getting them
- 
--OUTGOING=${SPOOLDIR}/out.going/pixi	# location of the list of articles to upload
-+SITE=pixie
-+
-+OUTGOING=${SPOOLDIR}/outgoing/${SITE}	# location of the list of articles to upload
- SCRIPT=${BASEDIR}/put.news		# my filter for rpost
- OUTFILE=/tmp/tmp$$			# used by rpost as article after it is filtered
- LOCKFILE=${BASEDIR}/getnews.lock	# lock file to prevent multiple instances of script
---- suck-4.3.2/sample/get.news.inn.bak	1997-09-27 09:29:59.000000000 +0200
-+++ suck-4.3.2/sample/get.news.inn	2004-03-25 19:16:26.430491480 +0100
+diff -up suck-4.3.2/sample/get.news.inn.samp suck-4.3.2/sample/get.news.inn
+--- suck-4.3.2/sample/get.news.inn.samp	1997-09-27 09:29:59.000000000 +0200
++++ suck-4.3.2/sample/get.news.inn	2007-09-10 17:43:34.000000000 +0200
 @@ -5,12 +5,11 @@
  #NOTE: this script probably needs to be run by root.  Most systems will
  # not let a normal user run ctlinnd 
@@ -40,7 +16,7 @@
  
  CTLINND=${NEWSDIR}/bin/ctlinnd		# location of binary
  SHLOCK=${NEWSDIR}/bin/shlock		# location of binary
-@@ -18,12 +17,7 @@
+@@ -18,12 +17,7 @@ SHLOCK=${NEWSDIR}/bin/shlock		# location
  TMPDIR=${BASEDIR}			# location for suck.* files
  MSGDIR=${BASEDIR}/Msgs			# where to put MultiFile messages when getting them
  
@@ -54,16 +30,25 @@
  OUTFILE=/tmp/tmp$$			# used by rpost as article after it is filtered
  LOCKFILE=${BASEDIR}/getnews.lock	# lock file to prevent multiple instances of script
  NEWSGROUP=news				# which group owns the file in out.going, typically either news or uucp.
-@@ -32,6 +26,8 @@
+@@ -32,6 +26,17 @@ TESTHOST=testhost
  RPOST=rpost
  SUCK=suck
  
-+CONFIG=/etc/sysconfig/suck/site
++if [ $# -gt 1 ]; then
++  echo "Usage: getnew [<sitename>]"
++  exit
++fi
++
++if [ -n "$1" ]; then
++  CONFIG=/etc/news/suck.d/$1
++else
++  CONFIG=/etc/sysconfig/suck/site
++fi
 +
  # if we are already running, abort 
  
  trap 'rm -f ${LOCKFILE} ; echo "Aborting" ; exit 1' 1 2 3 15
-@@ -41,18 +37,46 @@
+@@ -41,18 +46,55 @@ if [ $? -ne 0 ]; then
  	exit
  fi
  
@@ -86,7 +71,16 @@
 +
 +if [ -n "$NNTP_USER" -a -n "$NNTP_PASS" ]; then
 +    AUTHINFO="-u -Q"
-+fi;
++fi
++
++if [ -z $POST ]; then
++  POST="yes"
++fi
++
++if [ $POST != "yes" -a $POST != "no" ]; then
++  echo "Invalid value for post"
++  exit
++fi
 +
 +export NNTP_USER
 +export NNTP_PASS
@@ -112,16 +106,22 @@
  	SUCK_STATUS=$?
  
  	if [ ${SUCK_STATUS} -eq 0 ]; then
-@@ -70,7 +94,7 @@
+@@ -68,9 +110,12 @@ if [ ${REMOTE_RESULT} -eq 0 -a ${LOCAL_R
+ 	fi
+ 
  	# now upload messages
- 	if [ -s ${OUTGOING}  -o -s ${OUTGOINGNEW} ]; then
+-	if [ -s ${OUTGOING}  -o -s ${OUTGOINGNEW} ]; then
  
 -		${TESTHOST} ${REMOTE_HOST} -s
++	if [ $POST = "yes" ]; then
++
++	    if [ -s ${OUTGOING}  -o -s ${OUTGOINGNEW} ]; then
++
 +		${TESTHOST} ${NNTP_HOST} -s
  
  		if [ $? -ne 0 ]; then
  			echo "Remote posting host not responding"
-@@ -93,12 +117,11 @@
+@@ -93,12 +138,11 @@ if [ ${REMOTE_RESULT} -eq 0 -a ${LOCAL_R
  			fi
  
  			# outgoing messages to post
@@ -135,8 +135,22 @@
  			elif [ ${ERRLEV} -eq 1 ]; then
  				echo "Error posting a message"
  			elif [ ${ERRLEV} -eq 2 ]; then
---- suck-4.3.2/sample/put.news.sm.bak	2002-06-04 15:20:16.000000000 +0200
-+++ suck-4.3.2/sample/put.news.sm	2004-03-25 19:15:48.439267024 +0100
+@@ -115,8 +159,11 @@ if [ ${REMOTE_RESULT} -eq 0 -a ${LOCAL_R
+ 				chmod 664 ${OUTGOINGNEW}
+ 			fi
+ 		fi
+-	fi	
+ 	
++	    fi	
++	
++	fi
++
+ 	echo "You can hang up the modem now"
+ 
+ fi
+diff -up suck-4.3.2/sample/put.news.sm.samp suck-4.3.2/sample/put.news.sm
+--- suck-4.3.2/sample/put.news.sm.samp	2002-06-04 15:20:16.000000000 +0200
++++ suck-4.3.2/sample/put.news.sm	2007-09-10 17:40:27.000000000 +0200
 @@ -10,15 +10,18 @@
  # this to somewhere normal users can read or write.
  
@@ -159,20 +173,36 @@
  		
  	if [ $? -ne 0 ]; then
  		echo "Error"
---- suck-4.3.2/sample/put.news.sm.pl.bak	2002-06-04 15:20:43.000000000 +0200
-+++ suck-4.3.2/sample/put.news.sm.pl	2004-03-25 19:15:48.439267024 +0100
-@@ -26,7 +26,7 @@
- 	# rpost will then handle the error
- 	# We do this since rpost can't differentiate between
- 	# a missing file or a script file
--	open IFP, "/usr/news/bin/sm $infile |" or return $infile;
-+	open IFP, "/usr/lib/news/bin/sm $infile |" or return $infile;
- #	open IFP, "<${infile}" or die "Can't read ${infile}";
- 	open OFP, ">${outfile}" or die "Can't create ${outfile}";
+diff -up suck-4.3.2/sample/get.news.generic.samp suck-4.3.2/sample/get.news.generic
+--- suck-4.3.2/sample/get.news.generic.samp	1999-02-20 00:32:57.000000000 +0100
++++ suck-4.3.2/sample/get.news.generic	2007-09-10 17:40:27.000000000 +0200
+@@ -9,16 +9,18 @@
+ REMOTE_HOST=news.pixi.com
+ LOCAL_HOST=localhost
+ 
+-SPOOLDIR=/usr/spool/news		# base directory for articles to be rposted
+-NEWSDIR=/usr/lib/news			# base directory for news binaries 
+-BASEDIR=/home/boby/doNews		# base directory for suck rpost and scripts
++SPOOLDIR=/var/spool/news		# base directory for articles to be rposted
++NEWSDIR=/var/lib/news			# base directory for news binaries 
++BASEDIR=/var/lib/news/suck		# base directory for suck rpost and scripts
+ 
+ SHLOCK=${NEWSDIR}/bin/shlock
  
---- suck-4.3.2/sample/put.news.bak	1998-10-04 21:32:26.000000000 +0200
-+++ suck-4.3.2/sample/put.news	2004-03-25 19:15:48.440266872 +0100
-@@ -14,14 +14,17 @@
+ TMPDIR=${BASEDIR}			# location for suck.* files
+ MSGDIR=${BASEDIR}/Msgs			# where to put MultiFile articles when getting them
+ 
+-OUTGOING=${SPOOLDIR}/out.going/pixi	# location of the list of articles to upload
++SITE=pixie
++
++OUTGOING=${SPOOLDIR}/outgoing/${SITE}	# location of the list of articles to upload
+ SCRIPT=${BASEDIR}/put.news		# my filter for rpost
+ OUTFILE=/tmp/tmp$$			# used by rpost as article after it is filtered
+ LOCKFILE=${BASEDIR}/getnews.lock	# lock file to prevent multiple instances of script
+diff -up suck-4.3.2/sample/put.news.samp suck-4.3.2/sample/put.news
+--- suck-4.3.2/sample/put.news.samp	1998-10-04 21:32:26.000000000 +0200
++++ suck-4.3.2/sample/put.news	2007-09-10 17:40:27.000000000 +0200
+@@ -14,14 +14,17 @@ if [ $# -ne 2 ]; then
  	exit -1
  fi
  
@@ -192,3 +222,15 @@
  		
  	if [ $? -ne 0 ]; then
  		echo "Error"
+diff -up suck-4.3.2/sample/put.news.sm.pl.samp suck-4.3.2/sample/put.news.sm.pl
+--- suck-4.3.2/sample/put.news.sm.pl.samp	2002-06-04 15:20:43.000000000 +0200
++++ suck-4.3.2/sample/put.news.sm.pl	2007-09-10 17:40:27.000000000 +0200
+@@ -26,7 +26,7 @@ sub perl_rpost {
+ 	# rpost will then handle the error
+ 	# We do this since rpost can't differentiate between
+ 	# a missing file or a script file
+-	open IFP, "/usr/news/bin/sm $infile |" or return $infile;
++	open IFP, "/usr/lib/news/bin/sm $infile |" or return $infile;
+ #	open IFP, "<${infile}" or die "Can't read ${infile}";
+ 	open OFP, ">${outfile}" or die "Can't create ${outfile}";
+ 


Index: suck.spec
===================================================================
RCS file: /cvs/extras/rpms/suck/devel/suck.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- suck.spec	15 Aug 2007 17:15:15 -0000	1.13
+++ suck.spec	11 Sep 2007 15:49:12 -0000	1.14
@@ -1,7 +1,7 @@
 Name: suck
 Summary: Download news from remote NNTP server
 Version: 4.3.2
-Release: 17%{?dist}
+Release: 18%{?dist}
 Source: http://www.sucknews.org/%{name}-%{version}.tar.gz
 Source1: active-ignore
 Source2: suck-4.3.2.site
@@ -30,15 +30,15 @@
 %setup -q
 %patch -p1
 %patch1 -p1
-%patch2 -p1
+%patch2 -p1 -b .samp
 %patch3 -p1
 %patch4 -p1
 
 cp %{SOURCE3} .
 
 autoconf
-%configure --with-inn-lib=/usr/lib/news/lib \
-           --with-inn-include=/usr/include/inn
+%configure --with-inn-lib=%{_libdir}/news/lib \
+           --with-inn-include=%{_includedir}/inn
 
 %build
 make %{?_smp_mflags}
@@ -51,6 +51,7 @@
 
 mkdir -p ${RPM_BUILD_ROOT}/var/lib/news/suck
 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/suck
+mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/news/suck.d
 mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/news/bin
 
 cp sample/get.news.inn ${RPM_BUILD_ROOT}%{_prefix}/lib/news/bin/getnews
@@ -82,10 +83,14 @@
 %{_mandir}/man1/testhost.1*
 %{_mandir}/man1/lmove.1*
 
-%dir /etc/sysconfig/suck/
+%dir %{_sysconfdir}/sysconfig/suck/
 %config(noreplace) %{_sysconfdir}/sysconfig/suck/site
+%dir %{_sysconfdir}/news/suck.d/
 
 %changelog
+* Mon Sep 10 2007 Jochen Schmitt <Jochen herr-schmitt de> 4.3.2-18
+- Allow usage of several sites
+
 * Wed Aug 15 2007 Jochen Schmitt <Jochen herr-schmitt de> 4.3.2-17
 - Rework for 64-bit systems (use /usr/lib instead of /usr/lib64)
 




More information about the fedora-extras-commits mailing list