Vanilla Development Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS update: Vanilla/rpm



Date:	Friday July 16, 1999 @ 3:20
Author:	tanner

Update of /home/netrek/cvsroot/Vanilla/rpm
In directory cvs.castle.real-time.com:/var/tmp/cvs-serv12574/rpm

Modified Files:
	Vanilla.spec cvs2rpm netrek.crontab netrek.init 
	netrek.logrotate 
Log Message:
** NOTICE **

I committed these changes without testing a build. So, thing could be broken.
I'll do a build at work tomorrow.



	* rpm/cvs2rpm (export): Changed to grab the latest snapshot of the
	source from CVS instead of using a tagged release.

	* rpm/netrek.logrotate: Changed start.LOG to newstartd.LOG, added 
        updated.LOG.

	* rpm/Vanilla.spec (crontab): Changed the .spec file to use James'
	elegant fix to the cron problem.

	* rpm/netrek.crontab: Radical change and very elegant fix from
	James to get cron to run the updatekeys as user games AND make it
	easy to add/remove cron entries.

	* rpm/netrek.init: First attempt at getting the server to run as
	user games.

	* rpm/Vanilla.spec (logfiles):  Added updated.LOG to keep binaries
	to logfiles synchronized.

	* tools/updatekeys (updated): Redirect updated output to a logfile.

	* rpm/netrek.init (start): Need to grab keys from the metaserver
	before starting the server. Added a call to updatekeys before
	starting newstartd.

	* rpm/Vanilla.spec (logfiles): Changed start.LOG to newstartd.LOG
	to keep the relationship very clear.

	* rpm/netrek.init (start): Add the ability to stop and start the
	netrek server using the rc scripts.

	* rpm/Vanilla.spec (%clean): Actived the cleaning up routines.

	* rpm/Vanilla.spec (RSA): Added check for Euro RSA code.



****************************************

Index: Vanilla/rpm/Vanilla.spec
diff -u Vanilla/rpm/Vanilla.spec:1.12 Vanilla/rpm/Vanilla.spec:1.13
--- Vanilla/rpm/Vanilla.spec:1.12	Thu Jul 15 18:52:01 1999
+++ Vanilla/rpm/Vanilla.spec	Fri Jul 16 03:20:12 1999
@@ -10,8 +10,8 @@
 Source1: netrek.init
 Source2: netrek.logrotate
 Source3: netrek.crontab
-Prereq: sed, vixie-cron
-Requires: gtk > 1.2, glib > 1.2, vixie-cron, sed
+Prereq: sed, vixie-cron, sh-utils
+Requires: gtk > 1.2, glib > 1.2, vixie-cron, sed, sh-utils
 BuildRoot: /var/tmp/netrek-buildroot
 
 %description
@@ -59,16 +59,24 @@
 
 %build
 
-# Look for the RSA stuff. It seems that configure only looks for the
-# US RSA code. Anyone?
-
+# Look for the US RSA stuff.
 if [ -f $RPM_SOURCE_DIR/res-rsa-2.9.1.tar.gz ]; then
   RSA_FILE=$RPM_SOURCE_DIR/res-rsa-2.9.1.tar.gz
+
+# Look for the Euro RSA stuff.
+elif [ -f $RPM_SOURCE_DIR/res-rsa-2.9.tar.gz ]; then
+  RSA_FILE=$RPM_SOURCE_DIR/res-rsa-2.9.tar.gz
+
+# Could not find either, does the user have the file encrypted?
 elif [ -f $RPM_SOURCE_DIR/res-rsa-2.9.1.tar.gz.crypt ]; then
   echo "Found RSA files, but they are encrypted, send email to rsakeys@us.netrek.org"
   echo "for the password to decrypt the file. If you want to build the server without"
   echo "RSA, remove $RPM_SOURCE_DIR/res-rsa-2.9.1.tar.gz.crypt and run rpm again."
   exit 1
+
+# No RSA code, so just tell the user we are going to compile with RSA
+else
+  echo "No RSA source code found. I am going to compile the server without RSA."
 fi
 
 
@@ -92,17 +100,17 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/usr/games/netrek/gum
 install -d $RPM_BUILD_ROOT/etc/logrotate.d
 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
+install -d $RPM_BUILD_ROOT/etc/cron.hourly
 install -d $RPM_BUILD_ROOT/var/log/netrek
 
 make LIBDIR=$RPM_BUILD_ROOT/usr/games/netrek install
 install -m 0644 $RPM_SOURCE_DIR/netrek.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/netrek
 install -m 0555 $RPM_SOURCE_DIR/netrek.init $RPM_BUILD_ROOT/etc/rc.d/init.d/netrek
-install -m 0555 $RPM_SOURCE_DIR/netrek.crontab $RPM_BUILD_ROOT/usr/games/netrek/tools/netrek.crontab
+install -m 0555 $RPM_SOURCE_DIR/netrek.crontab $RPM_BUILD_ROOT/etc/cron.hourly/netrek
 
-for f in god.LOG log logfile mesg.LOG start.LOG; do
+for f in god.LOG log logfile mesg.LOG newstartd.LOG updated.LOG; do
   touch $RPM_BUILD_ROOT/var/log/netrek/$f
 done
 
@@ -110,36 +118,14 @@
 #install -c gum $RPM_BUILD_DIR/usr/games/netrek/gum
 
 %clean
-# rm -f $RPM_BUILD_ROOT
+rm -f $RPM_BUILD_ROOT
 
 %post
 chkconfig --add netrek
 
-# Major hack to get cron jobs into games' crontab. Have to be
-# careful, games may already have a crontab tab, so suck the current
-# crontab out and save it to a temp location. Append netrek's cron
-# entries to the crontab. Put the crontab back into cron. Finally clean
-# up after ourselves.
-
-crontab -u games -l > /var/tmp/netrek.crontab.$$
-cat /usr/games/netrek/tools/netrek.crontab >> /var/tmp/netrek.crontab.$$
-crontab -u games /var/tmp/netrek.crontab.$$
-rm -f /var/tmp/netrek.crontab.$$
-
 %postun
 chkconfig --del netrek
 
-# Major hack again. Need to get netrek cron entries out of games'
-# crontabs without deleting other potential crontab entries.
-# ** NOTICE ** this method required that netrek be part of the crontab
-# entries that need to be removed. This might come back and bite us in
-# the butt.
-
-crontab -u games -l > /var/tmp/netrek.crontab.$$
-cat /var/tmp/netrek.crontab.$$ | sed '/netrek/d' > /var/tmp/netrek.crontab2.$$
-crontab -u games /var/tmp/netrek.crontab2.$$
-rm -f  /var/tmp/netrek.crontab.$$  /var/tmp/netrek.crontab2.$$
-
 %files
 %defattr(-, root, root)
 %doc PROJECTS README INSTALL INSTALL.INL docs tools/README xsg/README 
@@ -153,7 +139,8 @@
 %ghost /var/log/netrek/log
 %ghost /var/log/netrek/logfile
 %ghost /var/log/netrek/mesg.LOG
-%ghost /var/log/netrek/start.LOG
+%ghost /var/log/netrek/updated.LOG
+%ghost /var/log/netrek/newstartd.LOG
 %config /usr/games/netrek/.planets
 %config /usr/games/netrek/.features
 %config /usr/games/netrek/.motd_clue
@@ -171,6 +158,7 @@
 %config /usr/games/netrek/.banned
 %config /usr/games/netrek/.bypass
 %config /usr/games/netrek/.clue-bypass
+/etc/cron.hourly/netrek
 /usr/games/netrek/ntserv
 /usr/games/netrek/daemonII
 /usr/games/netrek/puck
@@ -196,6 +184,16 @@
 %defattr(-, games, games)
 
 %changelog
+* Fri Jul 16 1999  Bob Tanner  <tanner@real-time.com>
+
+	- rpm/Vanilla.spec (crontab): Changed the .spec file to use James'
+	elegant fix to the cron problem.
+
+	- rpm/Vanilla.spec (logfiles):  Added updated.LOG to keep binaries
+	to logfiles synchronized.
+
+	- rpm/Vanilla.spec (logfiles): Changed start.LOG to newstartd.LOG
+	to keep the relationship very clear.
 
 * Thu Jul 15 1999  Bob Tanner  <tanner@real-time.com>
 
Index: Vanilla/rpm/cvs2rpm
diff -u Vanilla/rpm/cvs2rpm:1.4 Vanilla/rpm/cvs2rpm:1.5
--- Vanilla/rpm/cvs2rpm:1.4	Thu Jul 15 15:25:03 1999
+++ Vanilla/rpm/cvs2rpm	Fri Jul 16 03:20:13 1999
@@ -5,7 +5,7 @@
 #
 # Make sure you check and set your VS and VL variable to get this to work.
 #
-# $Id: cvs2rpm,v 1.4 1999/07/15 20:25:03 tanner Exp $
+# $Id: cvs2rpm,v 1.5 1999/07/16 08:20:13 tanner Exp $
 #
 
 # Change these if necessary!
@@ -68,10 +68,10 @@
 #  exit 1
 #fi
 
-# Create a distribtions, tar and gzip2 it
+# Create a distribtions, tar and bzip2 it
 
 echo "Creating distribution. This could take a couple of minutes."
-$cvs -z9 export -d Vanilla-$VS -r $VL Vanilla > /dev/null
+$cvs -z9 export -d Vanilla-$VS -D today Vanilla > /dev/null
 if [ $? -ne 0 ]; then
   echo "Error. CVS export failed. Aborting."
   exit 1
Index: Vanilla/rpm/netrek.crontab
diff -u Vanilla/rpm/netrek.crontab:1.2 Vanilla/rpm/netrek.crontab:1.3
--- Vanilla/rpm/netrek.crontab:1.2	Thu Jul 15 18:52:01 1999
+++ Vanilla/rpm/netrek.crontab	Fri Jul 16 03:20:13 1999
@@ -1,12 +1,3 @@
-# The time and date fields are:
-#
-#  field          allowed values
-#  -----          --------------
-#  minute         0-59
-#  hour           0-23
-#  day of month   0-31
-#  month          0-12
-#  day of week    0-7 (0 or 7 is Sun, or use names)
+#!/bin/bash
 
-# netrek: Grab the keys every hour at the top of the hour
-00 * * * /usr/games/netrek/tools/updatekeys
+su -c "/usr/games/netrek/tools/updatekeys" games
Index: Vanilla/rpm/netrek.init
diff -u Vanilla/rpm/netrek.init:1.1 Vanilla/rpm/netrek.init:1.2
--- Vanilla/rpm/netrek.init:1.1	Sat Jul 10 22:49:11 1999
+++ Vanilla/rpm/netrek.init	Fri Jul 16 03:20:13 1999
@@ -29,13 +29,15 @@
 	# Start the server.
 
 	echo -n "Starting netrek server: "
+	su -c "/usr/games/netrek/updatekeys" games
+	daemon 'su -c "/usr/games/netrek/newstartd >> /var/log/netrek/newstartd.LOG 2>&1" games'
 	echo
 	touch /var/lock/subsys/netrek
 	;;
   stop)
 	# Stop the server.
 	echo -n "Shutting down netrek server: "
-	killproc 
+	killproc newstartd
 	echo
 	rm -f /var/lock/subsys/netrek
 	;;
Index: Vanilla/rpm/netrek.logrotate
diff -u Vanilla/rpm/netrek.logrotate:1.1 Vanilla/rpm/netrek.logrotate:1.2
--- Vanilla/rpm/netrek.logrotate:1.1	Sat Jul 10 22:49:11 1999
+++ Vanilla/rpm/netrek.logrotate	Fri Jul 16 03:20:13 1999
@@ -13,7 +13,12 @@
   create 0644 games games
 }
 
-/var/log/netrek/start.LOG {
+/var/log/netrek/newstartd.LOG {
+  monthly
+  create 0644 games games
+}
+
+/var/log/netrek/updated.LOG {
   monthly
   create 0644 games games
 }