encumbered/SFEnntpcached.spec: *new* good old newscache, see license,
authortom68
Sun, 25 Nov 2007 00:09:15 +0000
changeset 682 4c1100afb29b
parent 681 27823e5b3f8d
child 683 99ef5a0e7635
encumbered/SFEnntpcached.spec: *new* good old newscache, see license, needs some more love and testing
ChangeLog
encumbered/SFEnntpcached.spec
patches/nntpcache-01-3.0.2_3.0.2a_gn_s11_pointer.diff
patches/nntpcache-05-Makefile.in_DESTDIR.diff
patches/nntpcache-05b
patches/nntpcache-06-list.h.diff
patches/nntpcache-07-list.c.diff
patches/nntpcache-08-libproff.h.diff
patches/nntpcache-09-list.ext.diff
patches/nntpcache-10-Makefile.am_debuginstall.diff
patches/nntpcache-11-Makefile.in_debuginstall.diff
--- a/ChangeLog	Sat Nov 24 14:35:07 2007 +0000
+++ b/ChangeLog	Sun Nov 25 00:09:15 2007 +0000
@@ -1,3 +1,7 @@
+2007-11-25  Thomas Wagner <[email protected]>
+        * encumbered/SFEnntpcached.spec: *new* good old newscache, see license,
+             needs some more love and testing
+
 2007-11-24  Thomas Wagner <[email protected]>
         * SFEperl-Net-DNS.spec SFEperl-TimeDate.spec SFEperl-DBD-mysql.spec 
           SFEperl-DBD-Pg.spec SFEperl-IO-Socket-INET6.spec SFEperl-DBI.spec 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/encumbered/SFEnntpcached.spec	Sun Nov 25 00:09:15 2007 +0000
@@ -0,0 +1,124 @@
+#
+# spec file for package SFEnntpcache
+#
+# includes module(s): nntpcache
+#
+%include Solaris.inc
+
+#TODO# if possible, solve the automake/* stuff - to have Makefile.am patchable
+#TODO# move cp sysconf/*dist syscon/* into postinstall class action script and mark as editable
+
+%define	src_name nntpcache
+#%define	src_url	ftp://ftp.nntpcache.com/pub/nntpcache
+%define	src_url	http://fresh.t-systems-sfr.com/unix/src/privat2
+
+Name:                SFEnntpcache
+License:		Other (read License carefully)
+Summary:             nntpcache daemon - not sure if actively maintened
+Version:             3.0.2
+#Source:              %{src_url}/%{src_name}.tar.gz
+Source:              %{src_url}/%{src_name}-%{version}.tar.gz
+Patch1:		     nntpcache-01-3.0.2_3.0.2a_gn_s11_pointer.diff
+Patch5:		     nntpcache-05-Makefile.in_DESTDIR.diff
+Patch6:		     nntpcache-06-list.h.diff
+Patch7:			nntpcache-07-list.c.diff
+Patch8:			nntpcache-08-libproff.h.diff
+Patch9:			nntpcache-09-list.ext.diff
+#Patch10:		nntpcache-10-Makefile.am_debuginstall.diff 
+Patch11:		nntpcache-11-Makefile.in_debuginstall.diff 
+
+
+SUNW_BaseDir:        %{_basedir}
+BuildRoot:           %{_tmppath}/%{name}-%{version}-build
+%include default-depend.inc
+
+%package root
+Summary:                 %{summary} - root
+SUNW_BaseDir:            /
+%include default-depend.inc
+
+
+%prep
+%setup -q  -n %{src_name}-%{version}
+%patch1 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+#%patch10 -p1
+%patch11 -p1
+
+mv libproff/list.h libproff/nn_list.h
+
+#TODO# is this the right thing to do?
+# perl -w -pi.bak_nn_list.h -e "s/list.h/nn_list.h/g" libproff/Makefile.in libproff/Makefile.am
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+     CPUS=1
+fi
+
+export CFLAGS="%optflags"
+export LDFLAGS="%_ldflags"
+
+#aclocal
+#automake
+
+./configure --prefix=%{_prefix} \
+	--mandir=%{_mandir} \
+	--libdir=%{_libdir}              \
+	--libexecdir=%{_prefix}/%{src_name}/libexec      \
+	--sysconfdir=%{_sysconfdir}      \
+        --localstatedir=%{_localstatedir}/%{src_name} \
+
+#	--libexecdir=%{_libexecdir}      \
+
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/nntpcache/
+make install DESTDIR=$RPM_BUILD_ROOT
+
+#clean unwanted files
+rm -r $RPM_BUILD_ROOT/%{_prefix}/include
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-, root, bin)
+%doc README ChangeLog CREDITS COPYING INSTALL NEWS AUTHORS TODO ABOUT-NLS
+%dir %attr (0755, root, bin) %{_bindir}
+%{_bindir}/*
+%dir %attr (0755, root, bin) %{_prefix}/%{src_name}
+%dir %attr (0755, root, bin) %{_prefix}/%{src_name}/libexec
+%{_prefix}/%{src_name}/libexec/*
+%dir %attr (0755, root, bin) %{_sbindir}
+%{_sbindir}/*
+%dir %attr (0755, root, bin) %{_mandir}
+%dir %attr (0755, root, bin) %{_mandir}/man8
+%{_mandir}/man8/*
+
+
+%files root
+%defattr (-, root, sys)
+%dir %attr (0755, root, sys) %{_sysconfdir}
+%dir %attr (0755, root, bin) %{_sysconfdir}/nntpcache
+%{_sysconfdir}/nntpcache/*
+#TODO# mark this as volatile /var/nntpache/*
+%dir %attr (0755, root, sys) %{_localstatedir}
+%dir %attr (0755, root, sys) %{_localstatedir}/%{src_name}
+%{_localstatedir}/%{src_name}/*
+#%dir %attr (0755, root, sys) %{_datadir}
+#%{_datadir}/*
+
+
+%changelog
+* Sat Nov 24 2007 - Thomas Wagner
+- Initial spec
+- list.h from system is included, names/struct redefine errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nntpcache-01-3.0.2_3.0.2a_gn_s11_pointer.diff	Sun Nov 25 00:09:15 2007 +0000
@@ -0,0 +1,31 @@
+--- nntpcache-3.0.2/src/nntpcache.c	Sun Apr 11 13:43:56 2004
++++ nntpcache-3.0.2a_gn_s11/src/nntpcache.c	Thu May 25 18:10:46 2006
+@@ -810,7 +810,7 @@
+ 				loge (("missing password in %s:%d: %s", file, n, buf));
+ 				continue;
+ 			}
+-			if ((hostname = strrchr(password-2, '@')) != NULL) {
++			if ((hostname = strrchr(password, '@')) != NULL) {
+ 				*(hostname++) = '\0';
+ 				username = host;
+ 				list->user = Sstrdup (username);
+--- nntpcache-3.0.2/src/article.c	Sun Apr 11 13:43:55 2004
++++ nntpcache-3.0.2a_gn_s11/src/article.c	Thu May 25 18:20:48 2006
+@@ -234,7 +234,7 @@
+ 		if (safePath(buf))
+ 		{
+ 			bool ok;
+-			rfc822lower (msgid);
++			/* rfc822lower (msgid); */
+ 			ok = hisAdd (msgid, buf);
+ 			logd (("adding <%s>:%s to %s (%s)", msgid, buf, con->historyFile, ok ? "suceeded" : "failed"));
+ 		} else
+@@ -488,7 +488,7 @@
+ 		if (getbyid) /* find <msgid> -> server/group/article in history file */
+ 		{
+ 			char *p;
+-			rfc822lower (msgid);
++			/* rfc822lower (msgid); */
+ 			/*
+ 			 * heads are stored as group/artnum_head
+ 			 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nntpcache-05-Makefile.in_DESTDIR.diff	Sun Nov 25 00:09:15 2007 +0000
@@ -0,0 +1,86 @@
+--- nntpcache-3.0.2/cf/Makefile.in.orig	2006-03-05 22:49:25.000000000 +0100
++++ nntpcache-3.0.2/cf/Makefile.in	2007-11-24 21:11:52.004691138 +0100
+@@ -271,15 +271,15 @@
+ 	echo @VERSION@ >$@
+ 
+ install-data-hook:
+-	for f in $(distf); do { cd $(sysconfdir) && (orig=`basename $$f -dist`; test -e $$orig || cp $$f $$orig) ;} done
++	for f in $(distf); do { cd $(DESTDIR)$(sysconfdir) && (orig=`basename $$f -dist`; test -f $$orig || cp $$f $$orig) ;} done
+ 
+ nntpcache.config-dist : nnconf.cf
+ 	sed -e 's/^ *[a-zA-Z_][a-zA-Z_]* //;s/"//g' <nnconf.cf >$@
+ 
+ # this is ugly, but more flexible than merely redefining INSTALL_DATA
+ install-data-local:
+-	cd $(sysconfdir) && chmod 700 . && chown @nntpcacheUID@ . && chgrp @nntpcacheUID@ . && chmod 600 $(sysconf_DATA) && chown @nntpcacheUID@ $(sysconf_DATA) && chgrp @nntpcacheGID@ $(sysconf_DATA)
+-	cd $(localstatedir) && chmod 700 . && chown @nntpcacheUID@ . && chgrp @nntpcacheUID@ . && chmod 600 $(localstate_DATA) && chown @nntpcacheUID@ $(localstate_DATA) && chgrp @nntpcacheGID@ $(localstate_DATA)
++	cd $(DESTDIR)$(sysconfdir) && chmod 700 . 
++	cd $(DESTDIR)$(localstatedir) && chmod 700 . 
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+--- nntpcache-3.0.2/http/Makefile.in.orig	2006-03-05 22:50:01.000000000 +0100
++++ nntpcache-3.0.2/http/Makefile.in	2007-11-24 20:20:25.779685118 +0100
+@@ -216,10 +216,10 @@
+ 
+ 
+ install-data-local:
+-	-mkdir $(sysconfdir)/http
+-	cp $(httpdata) $(sysconfdir)/http
+-	cd $(sysconfdir)/http && chown @nntpcacheUID@ $(ch)
+-	cd $(sysconfdir)/http && chgrp @nntpcacheUID@ $(ch)
++	-mkdir $(DESTDIR)$(sysconfdir)/http
++	cp $(httpdata) $(DESTDIR)$(sysconfdir)/http
++	#cd $(DESTDIR)$(sysconfdir)/http && chown @nntpcacheUID@ $(ch)
++	#cd $(DESTDIR)$(sysconfdir)/http && chgrp @nntpcacheUID@ $(ch)
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+--- nntpcache-3.0.2/innreport/Makefile.in.orig	2006-03-05 22:50:09.000000000 +0100
++++ nntpcache-3.0.2/innreport/Makefile.in	2007-11-24 20:23:34.102126641 +0100
+@@ -265,10 +265,10 @@
+ 
+ # the trailing slash is to force symlink transversal
+ install-data-local:
+-	cd $(sysconfdir) && chmod 700 . && chown @nntpcacheUID@ . && chgrp @nntpcacheUID@ . && chmod 600 $(sysconf_DATA) && chown @nntpcacheUID@ $(sysconf_DATA) && chgrp @nntpcacheGID@ $(sysconf_DATA)
+-	-mkdir $(sysconfdir)/http $(sysconfdir)/http/innreport $(sysconfdir)/http/innreport/pics
+-	chown @nntpcacheUID@ $(sysconfdir)/http $(sysconfdir)/http/innreport $(sysconfdir)/http/innreport/pics
+-	chgrp @nntpcacheGID@ $(sysconfdir)/http $(sysconfdir)/http/innreport $(sysconfdir)/http/innreport/pics
++	cd $(DESTDIR)$(sysconfdir) && chmod 700 . # && chown @nntpcacheUID@ . && chgrp @nntpcacheUID@ . && chmod 600 $(sysconf_DATA) && chown @nntpcacheUID@ $(sysconf_DATA) && chgrp @nntpcacheGID@ $(sysconf_DATA)
++	-mkdir $(DESTDIR)$(sysconfdir)/http $(DESTDIR)$(sysconfdir)/http/innreport $(DESTDIR)$(sysconfdir)/http/innreport/pics
++	# chown @nntpcacheUID@ $(DESTDIR)$(sysconfdir)/http $(DESTDIR)$(sysconfdir)/http/innreport $(DESTDIR)$(sysconfdir)/http/innreport/pics
++	# chgrp @nntpcacheGID@ $(DESTDIR)$(sysconfdir)/http $(DESTDIR)$(sysconfdir)/http/innreport $(DESTDIR)$(sysconfdir)/http/innreport/pics
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+--- nntpcache-3.0.2/pgp/Makefile.in.orig	2006-03-05 22:50:04.000000000 +0100
++++ nntpcache-3.0.2/pgp/Makefile.in	2007-11-24 21:16:48.229811895 +0100
+@@ -236,10 +236,10 @@
+ 
+ # the trailing slash is to force symlink transversal
+ install-data-local:
+-	cd $(sysconfdir) && chmod 700 . && chown @nntpcacheUID@ . && chgrp @nntpcacheUID@ . && chmod 600 $(sysconf_DATA) && chown @nntpcacheUID@ $(sysconf_DATA) && chgrp @nntpcacheGID@ $(sysconf_DATA)
++	cd $(DESTDIR)$(sysconfdir) && chmod 700 .
+ 
+ install-data-hook:
+-	for f in $(sysconf_DATA); do { cd $(sysconfdir) && (orig=`basename $$f -dist`; test -e $$orig || cp $$f $$orig) ;} done
++	for f in $(sysconf_DATA); do { cd $(DESTDIR)$(sysconfdir) && (orig=`basename $$f -dist`; test -f $$orig || cp $$f $$orig) ;} done
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+--- nntpcache-3.0.2/unixauth/Makefile.in.orig	2006-03-05 22:50:12.000000000 +0100
++++ nntpcache-3.0.2/unixauth/Makefile.in	2007-11-24 20:22:33.623722195 +0100
+@@ -327,9 +327,9 @@
+ 
+ 
+ install-exec-hook:
+-	chown root $(libexecdir)/unixauth
+-	chgrp @nntpcacheGID@ $(libexecdir)/unixauth
+-	chmod u+s,g+x,o-x $(libexecdir)/unixauth 
++	# chown root $(DESTDIR)$(libexecdir)/unixauth
++	# chgrp @nntpcacheGID@ $(DESTDIR)$(libexecdir)/unixauth
++	# chmod u+s,g+x,o-x $(DESTDIR)$(libexecdir)/unixauth 
+ 
+ %.ext : %.c %.h $(top_srcdir)/config.h $(top_srcdir)/scripts/genextern.sh
+ 	CPP="$(CPP)";export CPP; sh $(top_srcdir)/scripts/genextern.sh $< > [email protected] $(DEFS) $(INCLUDES) $(CPPFLAGS) && mv -f [email protected] $@ || rm -f [email protected]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nntpcache-05b	Sun Nov 25 00:09:15 2007 +0000
@@ -0,0 +1,15 @@
+--- nntpcache-3.0.2/pgp/Makefile.in.orig	2006-03-05 22:50:04.000000000 +0100
++++ nntpcache-3.0.2/pgp/Makefile.in	2007-11-24 21:16:48.229811895 +0100
+@@ -236,10 +236,10 @@
+ 
+ # the trailing slash is to force symlink transversal
+ install-data-local:
+-	cd $(sysconfdir) && chmod 700 . && chown @nntpcacheUID@ . && chgrp @nntpcacheUID@ . && chmod 600 $(sysconf_DATA) && chown @nntpcacheUID@ $(sysconf_DATA) && chgrp @nntpcacheGID@ $(sysconf_DATA)
++	cd $(DESTDIR)$(sysconfdir) && chmod 700 .
+ 
+ install-data-hook:
+-	for f in $(sysconf_DATA); do { cd $(sysconfdir) && (orig=`basename $$f -dist`; test -e $$orig || cp $$f $$orig) ;} done
++	for f in $(sysconf_DATA); do { cd $(DESTDIR)$(sysconfdir) && (orig=`basename $$f -dist`; test -e $$orig || cp $$f $$orig) ;} done
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nntpcache-06-list.h.diff	Sun Nov 25 00:09:15 2007 +0000
@@ -0,0 +1,16 @@
+--- nntpcache-3.0.2/libproff/list.h.orig	2004-04-11 13:43:51.000000000 +0200
++++ nntpcache-3.0.2/libproff/list.h	2007-11-24 21:58:29.984750213 +0100
+@@ -10,10 +10,10 @@
+ 
+ /* l = list, e = element, t = type */
+ 
+-struct list
++struct nn_list
+ {
+-    struct list *next;
+-    struct list *prev;
++    struct nn_list *next;
++    struct nn_list *prev;
+ };
+ 
+ #define PLIST_NEW(t) ((typeof(t)*)PLIST_ALLOC(sizeof (t)))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nntpcache-07-list.c.diff	Sun Nov 25 00:09:15 2007 +0000
@@ -0,0 +1,13 @@
+--- nntpcache-3.0.2/libproff/list.c.orig	2007-11-24 22:06:34.501865973 +0100
++++ nntpcache-3.0.2/libproff/list.c	2007-11-24 21:59:00.334467516 +0100
+@@ -1,8 +1,8 @@
+ #include "libproff.h"
+ 
+-EXPORT struct list *listFind(void *vl, void *ve)
++EXPORT struct nn_list *listFind(void *vl, void *ve)
+ {
+-    struct list *l = vl, 
++    struct nn_list *l = vl, 
+                 *e = ve,
+                 *p;
+     PLIST_FOREACH(l, p)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nntpcache-08-libproff.h.diff	Sun Nov 25 00:09:15 2007 +0000
@@ -0,0 +1,11 @@
+--- nntpcache-3.0.2/libproff/libproff.h.orig	2007-11-24 22:07:57.739095881 +0100
++++ nntpcache-3.0.2/libproff/libproff.h	2007-11-24 21:44:55.581046575 +0100
+@@ -13,7 +13,7 @@
+ #include "str.h"
+ #include "utils.h"
+ 
+-#include "list.h"
++#include "nn_list.h"
+ 
+ /* we use ptime here to avoid conflict with /usr/include/time.h */
+ #include "ptime.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nntpcache-09-list.ext.diff	Sun Nov 25 00:09:15 2007 +0000
@@ -0,0 +1,11 @@
+--- nntpcache-3.0.2/libproff/list.ext.orig	2006-03-05 22:49:07.000000000 +0100
++++ nntpcache-3.0.2/libproff/list.ext	2007-11-24 22:19:02.399340470 +0100
+@@ -21,7 +21,7 @@
+ #else
+ #  define EXP_(x)
+ #endif
+-extern struct list *listFind(void *vl, void *ve);
++extern struct nn_list *listFind(void *vl, void *ve);
+ #ifdef __cplusplus
+ }
+ #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nntpcache-10-Makefile.am_debuginstall.diff	Sun Nov 25 00:09:15 2007 +0000
@@ -0,0 +1,15 @@
+--- nntpcache-3.0.2/src/Makefile.am.orig	2006-03-05 22:42:38.000000000 +0100
++++ nntpcache-3.0.2/src/Makefile.am	2007-11-24 23:55:16.110535058 +0100
+@@ -61,7 +61,11 @@
+ 	../libradius/libradius.a
+ 
+ install-exec-hook:
+-	cp nntpcached $(libexecdir)/nntpcached.debug && chmod a+x $(libexecdir)/nntpcached.debug
++	#cp nntpcached $(DESTDIR)$(libexecdir)/nntpcached.debug && chmod a+x $(DESTIR)$(libexecdir)/nntpcached.debug
++	echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) nntpcached $(DESTDIR)$(sbindir)/nntpcached.debug"; \
++	$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) nntpcached $(DESTDIR)$(sbindir)/nntpcached.debug;
++
++
+ 
+ nnconf.c nnconf.h : ../cf/nnconf.cf
+ 	$(top_srcdir)/confused/confused $<
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/nntpcache-11-Makefile.in_debuginstall.diff	Sun Nov 25 00:09:15 2007 +0000
@@ -0,0 +1,14 @@
+--- nntpcache-3.0.2/src/Makefile.in.orig	2006-03-05 22:49:17.000000000 +0100
++++ nntpcache-3.0.2/src/Makefile.in	2007-11-24 23:54:46.740796928 +0100
+@@ -454,7 +454,10 @@
+ 
+ 
+ install-exec-hook:
+-	cp nntpcached $(libexecdir)/nntpcached.debug && chmod a+x $(libexecdir)/nntpcached.debug
++	#cp nntpcached $(DESTDIR)$(libexecdir)/nntpcached.debug && chmod a+x $(DESTIR)$(libexecdir)/nntpcached.debug
++	echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) nntpcached $(DESTDIR)$(sbindir)/nntpcached.debug"; \
++	  $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) nntpcached $(DESTDIR)$(sbindir)/nntpcached.debug;
++
+ 
+ nnconf.c nnconf.h : ../cf/nnconf.cf
+ 	$(top_srcdir)/confused/confused $<