SPECS: inn.spec - use %service, unify docdir in %desc, fixed geten...

glen glen at pld-linux.org
Tue Feb 28 20:50:42 CET 2006


Author: glen                         Date: Tue Feb 28 19:50:42 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use %service, unify docdir in %desc, fixed getent http, tabs, planted FIXME-TODO-KILLME-s allover %post, add blocker due that

---- Files affected:
SPECS:
   inn.spec (1.164 -> 1.165) 

---- Diffs:

================================================================
Index: SPECS/inn.spec
diff -u SPECS/inn.spec:1.164 SPECS/inn.spec:1.165
--- SPECS/inn.spec:1.164	Mon Dec 12 17:24:19 2005
+++ SPECS/inn.spec	Tue Feb 28 20:50:36 2006
@@ -1,4 +1,6 @@
 # $Revision$, $Date$
+# TODO
+# - post script is nightmare
 #
 # Conditional build:
 %bcond_with	largefiles	# enable largefiles (disables tagged hash)
@@ -13,7 +15,7 @@
 Summary(tr):	INN, InterNet Haber Sistemi (haber sunucu)
 Name:		inn
 Version:	2.4.2
-Release:	1
+Release:	0.1
 License:	distributable
 Group:		Networking/Daemons
 Source0:	ftp://ftp.isc.org/isc/inn/%{name}-%{version}.tar.gz
@@ -37,6 +39,7 @@
 Patch7:		%{name}-lib_install_modes.patch
 Patch8:		%{name}-config.patch
 URL:		http://www.isc.org/sw/inn/
+BuildRequires:	fix-%post-script-first
 BuildRequires:	autoconf
 BuildRequires:	automake
 BuildRequires:	bison
@@ -45,6 +48,7 @@
 BuildRequires:	libtool >= 1:1.4.2-9
 BuildRequires:	openssl-devel >= 0.9.7d
 BuildRequires:	perl-devel >= 1:5.8.0
+BuildRequires:	rpmbuild(macros) >= 1.268
 Requires(post):	/bin/kill
 Requires(post):	/usr/bin/getent
 Requires(post):	/usr/sbin/usermod
@@ -78,20 +82,20 @@
 %description
 INN is a news server, which can be set up to handle USENET news, as
 well as private "newsfeeds". There is a *LOT* of information about
-setting up INN in /usr/share/doc -- read it.
+setting up INN in %{_docdir}/%{name}-%{version} -- read it.
 
 If you want innreport to generate graphs you need perl-GD package.
 
 %description -l es
 INN es un servidor de news, que puede ser configurado para manipular
 USENET news bien como newsfeeds privadas. Existe un *Montón* de
-información sobre la configuración del INN en /usr/doc -- léela.
+información sobre la configuración del INN en %{_docdir}/%{name}-%{version} -- léela.
 
 %description -l pl
 INN jest serwerem news, który można skonfigurować do obsługi USENET-u,
 jak również do obsługi ,,prywatnych'' grup w sieciach intranetowych.
 Całe mnóstwo pożytecznych informacji o konfigurowaniu INN-a znajdziesz
-w katalogu /usr/share/doc/inn-*.
+w katalogu %{_docdir}/%{name}-%{version}.
 
 Jeśli chcesz żeby innreport generował wykresy musisz zainstalować
 pakiet perl-GD.
@@ -99,7 +103,7 @@
 %description -l pt_BR
 INN é um servidor de news, que pode ser configurado para manipular
 USENET news bem como newsfeeds privadas. Existe um *MONTE* de
-informaçőes sobre a configuraçăo do INN em /usr/doc -- leia.
+informaçőes sobre a configuraçăo do INN em %{_docdir}/%{name}-%{version} -- leia.
 
 %package libs
 Summary:	INN libraries
@@ -341,7 +345,7 @@
 	-a $RPM_BUILD_ROOT/var/lib/news/active \
 	-i -r -f $RPM_BUILD_ROOT/var/lib/news/history || :
 
-#Fix perms in sample directory to avoid bogus dependencies
+# Fix perms in sample directory to avoid bogus dependencies
 find samples -name "*.in" -exec chmod a-x {} \;
 
 # remove files in conflict with cleanfeed
@@ -355,7 +359,9 @@
 rm -rf $RPM_BUILD_ROOT
 
 %post
-if [ "`getent passwd http | cut -d: -f6`" = "/var/spool/news" ]; then
+# FIXME: unify this! and change setup package! and /home/services/news
+# doesn't exist so why bother changing it?
+if [ "`getent passwd news | cut -d: -f6`" = "/var/spool/news" ]; then
 	/usr/sbin/usermod -d /home/services/news news
 fi
 umask 022
@@ -369,6 +375,7 @@
 	chmod 644 history.*
 else
 	cd /var/lib/news
+	# FIXME: this will fail immediately as it needs *configured* inn.conf!
 	%{_bindir}/makehistory
 	%{_bindir}/makedbz -s `wc -l <history` -f history
 	for i in dir hash index pag; do
@@ -377,72 +384,72 @@
 	chown news:news history history.*
 	chmod 644 history history.*
 fi
-[ -f /var/lib/news/active.times ] || {
+
+if [ ! -f /var/lib/news/active.times ]; then
 	touch /var/lib/news/active.times
 	chown news:news /var/lib/news/active.times
-}
+fi
+
+if [ ! -f /var/lib/news/.news.daily ]; then
+	touch /var/lib/news/.news.daily
+	chown news:news /var/lib/news/.news.daily
+	chmod 664 /var/lib/news/.news.daily
+fi
 
-[ -f /var/log/news/news.notice ] || {
+# FIXME: /var/log is syslog daemon business, not ours!
+if [ ! -f /var/log/news/news.notice ]; then
 	touch /var/log/news/news.notice
 	chown news:news /var/log/news/news.notice
 	chmod 664 /var/log/news/news.notice
-}
+fi
 
-[ -f /var/log/news/news.crit ] || {
+if [ ! -f /var/log/news/news.crit ]; then
 	touch /var/log/news/news.crit
 	chown news:news /var/log/news/news.crit
 	chmod 660 /var/log/news/news.crit
-}
+fi
 
-[ -f /var/log/news/news.err ] || {
+if [ ! -f /var/log/news/news.err ]; then
 	touch /var/log/news/news.err
 	chown news:news /var/log/news/news.err
 	chmod 660 /var/log/news/news.err
-}
+fi
 
-[ -f /var/lib/news/.news.daily ] || {
-	touch /var/lib/news/.news.daily
-	chown news:news /var/lib/news/.news.daily
-	chmod 664 /var/lib/news/.news.daily
-}
 
 umask 027
+# DUDE !!! LEAVE MY SYSLOG ALONE!
 if [ -f /etc/syslog.conf ]; then
-  if ! grep -q INN /etc/syslog.conf; then
-    sed -i 's/mail.none;/mail.none;news.none;/' /etc/syslog.conf
-    echo ''										>> /etc/syslog.conf
-    echo '#'										>> /etc/syslog.conf
-    echo '# INN'									>> /etc/syslog.conf
-    echo '#' 										>> /etc/syslog.conf
-    echo 'news.=crit                                        /var/log/news/news.crit'	>> /etc/syslog.conf
-    echo 'news.=err                                         /var/log/news/news.err'	>> /etc/syslog.conf
-    echo 'news.notice                                       /var/log/news/news.notice'	>> /etc/syslog.conf
+	if ! grep -q INN /etc/syslog.conf; then
+		sed -i 's/mail.none;/mail.none;news.none;/' /etc/syslog.conf
+	# FIXME: use cat <<-EOF here
+		echo ''										>> /etc/syslog.conf
+		echo '#'										>> /etc/syslog.conf
+		echo '# INN'									>> /etc/syslog.conf
+		echo '#' 										>> /etc/syslog.conf
+		echo 'news.=crit                                        /var/log/news/news.crit'	>> /etc/syslog.conf
+		echo 'news.=err                                         /var/log/news/news.err'	>> /etc/syslog.conf
+		echo 'news.notice                                       /var/log/news/news.notice'	>> /etc/syslog.conf
     fi
-  if [ -f /var/run/syslog.pid ]; then
-    kill -HUP `cat /var/run/syslog.pid` 2> /dev/null ||:
-  fi
+	if [ -f /var/run/syslog.pid ]; then
+		kill -HUP `cat /var/run/syslog.pid` 2> /dev/null ||:
+	fi
 else
-    # syslog.conf does not exist
-    echo "mail.none /var/log/messages" 							> /etc/syslog.conf.inn
-    echo "" 										>> /etc/syslog.conf.inn
-    echo "# INN" 									>> /etc/syslog.conf.inn
-    echo "news.=crit                                      /var/log/news/news.crit"	>> /etc/syslog.conf.inn
-    echo "news.=err                                       /var/log/news/news.err"	>> /etc/syslog.conf.inn
-    echo "news.notice                                     /var/log/news/news.notice"	>> /etc/syslog.conf.inn
+# FIXME, i use syslog-ing what then?
+	# syslog.conf does not exist
+	echo "mail.none /var/log/messages" 							> /etc/syslog.conf.inn
+	echo "" 										>> /etc/syslog.conf.inn
+	echo "# INN" 									>> /etc/syslog.conf.inn
+	echo "news.=crit                                      /var/log/news/news.crit"	>> /etc/syslog.conf.inn
+	echo "news.=err                                       /var/log/news/news.err"	>> /etc/syslog.conf.inn
+	echo "news.notice                                     /var/log/news/news.notice"	>> /etc/syslog.conf.inn
 fi
 
 /sbin/chkconfig --add inn
-if [ -f /var/lock/subsys/inn ]; then
-	/etc/rc.d/init.d/inn restart >&2
-else
-	echo "Run \"/etc/rc.d/init.d/inn start\" to start inn news server." >&2
-fi
+%service inn restart "inn news server"
 
 %preun
 if [ "$1" = "0" ]; then
-	if [ -f /var/lock/subsys/news ]; then
-		/etc/rc.d/init.d/inn stop
-	fi
+	%service inn stop
 	/sbin/chkconfig --del inn
 fi
 
@@ -683,6 +690,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.165  2006/02/28 19:50:36  glen
+- use %service, unify docdir in %desc, fixed getent http, tabs, planted FIXME-TODO-KILLME-s allover %post, add blocker due that
+
 Revision 1.164  2005/12/12 16:24:19  glen
 - adapterized (sorted %verify attrs)
 
@@ -714,7 +724,7 @@
 - %post requires sed 4.0 now
 
 Revision 1.156  2004/08/01 00:45:26  andree
-- fixed %%post (don't create history, makehistory does it); cleanups
+- fixed %post (don't create history, makehistory does it); cleanups
 
 Revision 1.155  2004/06/29 09:40:22  qboosh
 - updated URL
@@ -858,9 +868,9 @@
 - perl -pi -e "s/^libtoolize --copy --force/\%\{__libtoolize\}/"
 
 Revision 1.116  2002/05/21 23:13:37  kloczek
-perl -pi -e "s/^automake -a -c -f --foreing/\%\{__automake\}/; \
+- perl -pi -e "s/^automake -a -c -f --foreing/\%\{__automake\}/; \
              s/^automake -a -c -f/\%\{__automake\}/; \
-	     s/^autoconf/\%\{__autoconf\}/"
+     s/^autoconf/\%\{__autoconf\}/"
 
 Revision 1.115.2.1  2002/05/09 22:23:26  qboosh
 - 2.3.3, updated ipv6 and db3 patches, added ac253 patch for new autoconf
@@ -868,7 +878,7 @@
 - wait up to 0.5s for innwatch start to avoid false "FAIL" message
 
 Revision 1.115  2002/04/25 16:36:42  arturs
-fixed a small typo
+- fixed a small typo
 
 Revision 1.114  2002/04/11 14:22:54  qboosh
 - Obsoletes: leafnode, leafnode+; release 10
@@ -890,7 +900,7 @@
   Group field using gettext).
 
 Revision 1.109  2002/01/18 02:13:20  kloczek
-perl -pi -e "s/pld-list\@pld.org.pl/feedback\@pld.org.pl/"
+- perl -pi -e "s/pld-list\@pld.org.pl/feedback\@pld.org.pl/"
 
 Revision 1.108  2001/11/10 23:23:36  ankry
 - added pl man pages
@@ -923,12 +933,14 @@
 - updated v6 patch (not tested)
 
 Revision 1.99  2001/05/22 09:06:23  wiget
-switch to new conditional builds macros (bcond_on_ -> _with_/bcond_off_ -> _without_); no release changes only simple s/// perfored
+- switch to new conditional builds macros (bcond_on_ ->
+  _with_/bcond_off_ -> _without_); no release changes only simple s///
+  perfored
 
 Revision 1.98  2001/05/20 12:58:35  kloczek
 - start upgrade to 2.3.2,
 - removed gcc obsoleted patch,
-NOTE: ipv6 patch must be updated.
+  NOTE: ipv6 patch must be updated.
 
 Revision 1.97  2001/05/12 00:45:37  kloczek
 - release 16,
@@ -947,7 +959,7 @@
 - rebuild with perl 5.6.1
 
 Revision 1.93  2001/04/14 18:00:03  baggins
-- removed explicit requirements for perl = %%{version} and %%{perl_sitearch}
+- removed explicit requirements for perl = %{version} and %{perl_sitearch}
   they will be added by rpm if needed
 
 Revision 1.92  2001/04/09 00:05:49  qboosh
@@ -966,7 +978,7 @@
 - fixed logrotate
 
 Revision 1.89  2001/03/09 17:08:02  qboosh
-- missing dir in inn-devel: %%{_includedir}/inn
+- missing dir in inn-devel: %{_includedir}/inn
 
 Revision 1.88  2001/02/28 02:38:59  baggins
 - release 10
@@ -1021,11 +1033,11 @@
 
 Revision 1.75  2001/01/22 19:37:36  baggins
 - release 2
-- fixed %%post scripts
+- fixed %post scripts
 - fixed init script
 
 Revision 1.74  2001/01/22 19:24:42  baggins
-- fixed stupid typo in %%post
+- fixed stupid typo in %post
 
 Revision 1.73  2001/01/22 13:43:57  baggins
 - upgrade to 2.3.1
@@ -1082,7 +1094,7 @@
 
 Revision 1.59  2000/08/04 20:19:20  kloczek
 - fiew cosmetics.
-Note: patch for ipv6 must be rewrited.
+- Note: patch for ipv6 must be rewrited.
 
 Revision 1.58  2000/08/04 18:25:59  baggins
 - release 2
@@ -1093,7 +1105,7 @@
 - inews is no longer installed with setgid
 
 Revision 1.56  2000/06/09 07:23:01  kloczek
-- added using %%{__make} macro.
+- added using %{__make} macro.
 
 Revision 1.55  2000/05/21 01:39:50  kloczek
 - spec adapterized.
@@ -1165,13 +1177,13 @@
 - small fixes
 
 Revision 1.36  1999/12/01 10:00:31  waszi
-- news.daily moved to %%{_bindir}
+- news.daily moved to %{_bindir}
 
 Revision 1.35  1999/12/01 09:56:34  waszi
 - news.daily moved to /etc/cron.daily
 
 Revision 1.34  1999/12/01 08:54:07  kloczek
-- added using %%{_sysconfdir} macro i more places,
+- added using %{_sysconfdir} macro i more places,
 - permission on suid binaries changed to 4754,
 - added /vat/log/archiv/news directory for archiving old inn logs (still
   is missing logrotate file for inn - must be added).
@@ -1222,7 +1234,7 @@
 
 * Fri May 14 1999 Tomasz Kłoczko <kloczek at rudy.mif.pg.gda.pl>
 - man pages moved to %{_datadir}/ma (FHS 2.0 compiliat),
-- removed not neccessary uid/gid=(news),
+- removed not neccessary uid/gid=(news),
 - changed install prefix to /usr.
 
 * Mon Apr 19 1999 Piotr Czerwiński <pius at pld.org.pl>
@@ -1239,14 +1251,14 @@
 - changed Buildroot to /tmp/%{name}-%{version}-root,
 - removed man group from man pages,
 - added full %defattr description in %files,
-- added Requires: %%{name} = %%{version} to devel subpackage,
+- added Requires: %{name} = %{version} to devel subpackage,
 - added some %requires_pkg macros,
 - cosmetic changes for common l&f.
 
 * Fri Jan 29 1999 Maciej Paliwoda <maciejp at uci.agh.edu.p>
   [2.2-1d]
 - special thanks for Wojtek Ślusarczyk <wojtek at shadow.eu.org>
-	& Tomasz Kłoczko <kloczek at rudy.mif.pg.gda.pl>
+  & Tomasz Kłoczko <kloczek at rudy.mif.pg.gda.pl>
 - new version 2.2 (stable)
 - build for Linux PLD
 - default storage CNFS
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/inn.spec?r1=1.164&r2=1.165&f=u



More information about the pld-cvs-commit mailing list