[csw-devel] SF.net SVN: gar:[15021] csw/mgar/pkg/daemontools/trunk

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Sat Jul 9 13:45:05 CEST 2011


Revision: 15021
          http://gar.svn.sourceforge.net/gar/?rev=15021&view=rev
Author:   dmichelsen
Date:     2011-07-09 11:45:05 +0000 (Sat, 09 Jul 2011)

Log Message:
-----------
daemontools: General rework, include pre/post scripts from existing package

Modified Paths:
--------------
    csw/mgar/pkg/daemontools/trunk/Makefile
    csw/mgar/pkg/daemontools/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/daemontools/trunk/files/COPYING
    csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.postinstall
    csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.preremove

Removed Paths:
-------------
    csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.gspec

Property Changed:
----------------
    csw/mgar/pkg/daemontools/trunk/


Property changes on: csw/mgar/pkg/daemontools/trunk
___________________________________________________________________
Modified: svn:externals
   - gar https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/gar/v1

   + gar https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/gar/v2


Modified: csw/mgar/pkg/daemontools/trunk/Makefile
===================================================================
--- csw/mgar/pkg/daemontools/trunk/Makefile	2011-07-09 11:12:38 UTC (rev 15020)
+++ csw/mgar/pkg/daemontools/trunk/Makefile	2011-07-09 11:45:05 UTC (rev 15021)
@@ -1,6 +1,5 @@
 NAME = daemontools
 VERSION = 0.76
-GARTYPE = v1
 CATEGORIES = utils
 
 DESCRIPTION = A collection of tools for managing UNIX services
@@ -8,19 +7,31 @@
   A collection of tools for managing UNIX services
 endef
 
-MASTER_SITES = http://cr.yp.to/daemontools/ http://www.fefe.de/daemontools/
-DISTFILES  = $(NAME)-$(VERSION).tar.gz
-DISTFILES += $(call admfiles,CSWdaemontools,)
-WORKSRC = $(WORKDIR)/admin/$(NAME)-$(VERSION)
+MASTER_SITES += http://cr.yp.to/daemontools/
+MASTER_SITES += http://smarden.org/pape/djb/manpages/
+DISTFILES += $(DISTNAME).tar.gz
+DISTFILES += $(DISTNAME)-man.tar.gz
+DISTFILES += CSWdaemontools.postinstall CSWdaemontools.preremove
+DISTFILES += COPYING
 
-#PATCHFILES = daemontools-0.70-man.diff.bz2
+VENDOR_URL = http://cr.yp.to/daemontools.html
 
-# We define upstream file regex so we can be notifed of new upstream software release
-UFILES_REGEX = $(NAME)-(\d+(?:\.\d+)*).tar.gz
+PACKAGES += CSWdaemontools
+SPKG_DESC_CSWdaemontools = Configures the daemontools services on the local machine
+PKGFILES_CSWdaemontools = NOFILES
+ARCHALL_CSWdaemontools = 1
+RUNTIME_DEP_PKGS_CSWdaemontools += CSWdaemontools-core
+CHECKPKG_OVERRIDES_CSWdaemontools += surplus-dependency|CSWdaemontools-core
 
+PACKAGES += CSWdaemontools-core
+SPKG_DESC_CSWdaemontools-core = A collection of tools for managing UNIX services
+# PKGFILES is catchallke remerge && 
 
+WORKSRC = $(WORKDIR)/admin/$(NAME)-$(VERSION)
+
 CONFIGURE_SCRIPTS = custom
 BUILD_SCRIPTS = custom
+TEST_SCRIPTS =
 INSTALL_SCRIPTS = custom
 
 include gar/category.mk
@@ -33,14 +44,18 @@
 
 build-custom:
 	@echo "==> Building daemontools in $(WORKSRC)"
-	@( cd $(WORKSRC); ./package/compile )
-	@chmod 755 $(WORKSRC)/command/*
+	cd $(WORKSRC) && ./package/compile
 	@$(MAKECOOKIE)
 
 install-custom:
 	@echo "==> Installing daemontools in $(DESTDIR)"
-	@( cd $(WORKSRC) ; \
-		install -d $(DESTDIR)$(bindir); cp -p command/* $(DESTDIR)$(bindir); \
-	)
-
-	
+	mkdir -p $(DESTDIR)$(bindir)
+	ginstall -m 755 $(WORKSRC)/command/* $(DESTDIR)$(bindir)
+	mkdir -p $(DESTDIR)$(mandir)/man8
+	ginstall -m 644 $(WORKDIR)/$(NAME)-man/*.8 $(DESTDIR)$(mandir)/man8
+	perl -pi \
+		-e 's,/command,$(bindir),g;' \
+		-e 's,/usr/local,$(prefix),g;' \
+		$(DESTDIR)$(bindir)/svscanboot \
+		$(DESTDIR)$(mandir)/man8/svscanboot.8
+	@$(MAKECOOKIE)

Modified: csw/mgar/pkg/daemontools/trunk/checksums
===================================================================
--- csw/mgar/pkg/daemontools/trunk/checksums	2011-07-09 11:12:38 UTC (rev 15020)
+++ csw/mgar/pkg/daemontools/trunk/checksums	2011-07-09 11:45:05 UTC (rev 15021)
@@ -1,2 +1,2 @@
-1871af2453d6e464034968a0fbcb2bfc  download/daemontools-0.76.tar.gz
-2190f5e620e41af6a4b7a7f2f12a47bc  download/CSWdaemontools.gspec
+2d3858a48f293c87202f76cd883438ee  daemontools-0.76-man.tar.gz
+1871af2453d6e464034968a0fbcb2bfc  daemontools-0.76.tar.gz

Added: csw/mgar/pkg/daemontools/trunk/files/COPYING
===================================================================
--- csw/mgar/pkg/daemontools/trunk/files/COPYING	                        (rev 0)
+++ csw/mgar/pkg/daemontools/trunk/files/COPYING	2011-07-09 11:45:05 UTC (rev 15021)
@@ -0,0 +1,3 @@
+Copyright 2001
+D. J. Bernstein
+http://cr.yp.to/daemontools.html

Deleted: csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.gspec
===================================================================
--- csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.gspec	2011-07-09 11:12:38 UTC (rev 15020)
+++ csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.gspec	2011-07-09 11:45:05 UTC (rev 15021)
@@ -1,5 +0,0 @@
-%var            bitname daemontools
-%var            pkgname CSWdaemontools
-%include        url file://%{PKGLIB}/csw_dyndepend.gspec
-%copyright
-Public Domain

Added: csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.postinstall
===================================================================
--- csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.postinstall	                        (rev 0)
+++ csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.postinstall	2011-07-09 11:45:05 UTC (rev 15021)
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+# Paranoia, I know.
+: ${BASEDIR=/opt/csw}
+
+INIT="/usr/sbin/init"
+INITTAB="$PKG_INSTALL_ROOT/etc/inittab"
+
+# The </dev/null is required on Solaris, otherwise init goes bonkers.
+SVLINE="SV:123456:respawn:$BASEDIR/bin/svscanboot </dev/null"
+
+xit=0
+echo
+
+if test -f "$INITTAB"; then
+
+    if grep svscanboot "$INITTAB" >/dev/null 2>&1; then
+	echo "It appears that daemontools is already present in $INITTAB"
+	echo "so there's nothing for this postinstall script to do."
+
+    else
+	echo "Adding daemontools to the $INITTAB file."
+	if echo "$SVLINE" >> "$INITTAB" 2>/dev/null; then
+
+	    # We could test for either a zero length package install root,
+	    # or for SI_INSTALL_APP set to something like jumpstart.  THe
+	    # idea is the same; do not poke the init process if pkgadd is
+	    # run with -R, since that typically means the system doing the
+	    # installation is NOT the system that will run the software.
+
+	    if test -z "$PKG_INSTALL_ROOT"; then
+		echo "Starting daemontools from init."
+
+		# If this fails, don't bomb out of the install, since
+		# we're 99% of the way done.  Just tell the admin that
+		# things have gone bad, and let them fix it.
+		"$INIT" q || {
+		    x="$?"
+		    echo "Tried to tell init to check $INITTAB, but failed."
+		    echo "The command was $INIT q"
+		    echo "and it returned $x"
+		    echo "After fixing the problem, be sure to run $INIT q"
+		    echo "to start the daemontools service."
+		}
+	    fi
+
+	else
+	    x="$?"
+	    echo "Unable to add a line to the $INITTAB file."
+	    echo "Using echo, appending to that file, returned $x"
+	    xit=2
+	fi
+    fi
+
+else
+    echo "Unable to locate the $INITTAB file; therefore, the"
+    echo "daemontools svscanboot script could not be added to"
+    echo "the configuration file for init.  Add the following"
+    echo "line to your inittab file:"
+    echo
+    echo "$SVLINE"
+    echo
+    echo "Then, run the following as root: $INIT q"
+    xit=2
+fi
+
+echo
+exit $xit

Added: csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.preremove
===================================================================
--- csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.preremove	                        (rev 0)
+++ csw/mgar/pkg/daemontools/trunk/files/CSWdaemontools.preremove	2011-07-09 11:45:05 UTC (rev 15021)
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+INITTAB="$PKG_INSTALL_ROOT/etc/inittab"
+
+if test -z "$SKIP_INITTAB" -a ! -f "$INITTAB"; then
+    echo "Unable to locate the /etc/inittab file; therefore,"
+    echo "daemontools cannot be removed from this system safely."
+    echo "Please correct this problem and try again."
+    echo
+    echo "Alternatively, remove the svscanboot utility from your"
+    echo "inittab file (wherever it may be), and refresh your init"
+    echo "daemon.  Once you are certain that daemontools is not"
+    echo "running via the init process, you can re-run your pkgrm"
+    echo "with SKIP_INITTAB set in the environment to bypass this"
+    echo "step and continue with the package removal."
+    echo
+    exit 1
+fi
+
+if grep svscanboot "$INITTAB" >/dev/null 2>&1; then
+    echo "Removing svscanboot from $INITTAB"
+    ed - "$INITTAB" <<!
+g,^SV:.*/opt/csw/bin/svscanboot,d
+w
+q
+!
+
+    # We could test for either a zero length package install root,
+    # or for SI_INSTALL_APP set to something like jumpstart.  THe
+    # idea is the same; do not tweak the process table if pkgrm is
+    # run with -R, since that typically means the system doing the
+    # removal is NOT the system running the software.
+
+    if test -z "$PKG_INSTALL_ROOT"; then
+	echo "Killing daemontools processes."
+	/usr/sbin/init q
+	sleep 1
+	ps -e -o pid,ppid,comm \
+	|sed -e 's/^ *//' \
+	|egrep '(readproctitle|svscan)' \
+	|cut '-d ' -f1 \
+	|xargs kill
+    fi
+
+else
+    echo "It appears that daemontools is not present in $INITTAB"
+    echo "so there's nothing for this preremove script to do."
+fi
+
+exit 0


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list