[csw-devel] SF.net SVN: gar:[5100] csw/mgar/pkg/vixiecron/trunk

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri May 29 01:50:06 CEST 2009


Revision: 5100
          http://gar.svn.sourceforge.net/gar/?rev=5100&view=rev
Author:   wahwah
Date:     2009-05-28 23:50:06 +0000 (Thu, 28 May 2009)

Log Message:
-----------
vixiecron: better SMF support

- SMF support via cswclassutils
- Stopping and starting Sun cron upon installation and removal, respectively

Modified Paths:
--------------
    csw/mgar/pkg/vixiecron/trunk/Makefile
    csw/mgar/pkg/vixiecron/trunk/checksums
    csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.postinstall

Added Paths:
-----------
    csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.postremove
    csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.preinstall

Removed Paths:
-------------
    csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.gspec
    csw/mgar/pkg/vixiecron/trunk/files/cswvixiecron.xml
    csw/mgar/pkg/vixiecron/trunk/files/svc-cswvixiecron

Modified: csw/mgar/pkg/vixiecron/trunk/Makefile
===================================================================
--- csw/mgar/pkg/vixiecron/trunk/Makefile	2009-05-28 21:20:52 UTC (rev 5099)
+++ csw/mgar/pkg/vixiecron/trunk/Makefile	2009-05-28 23:50:06 UTC (rev 5100)
@@ -16,20 +16,30 @@
 endef
 
 # TODO:
-#  - Improve man page locations. The original manpage install script looks retarded.
-#  - SMF support for non-global zones.
+#  - Improve man page locations. The original manpage install script
+#    looks retarded.
 
 MASTER_SITES  = http://ftp.de.debian.org/debian/pool/main/c/cron/
 DISTFILES  = cron_$(GARVERSION).orig.tar.gz
 DISTFILES += cron_$(GARVERSION)-105.diff.gz
-DISTFILES += $(call admfiles,CSWvixiecron,postinstall)
-DISTFILES += csw$(GARNAME) csw$(GARNAME).xml svc-csw$(GARNAME)
-DISTFILES += crontab.CSW run-crons-0.3.2
+DISTFILES += CSWvixiecron.preinstall
+DISTFILES += CSWvixiecron.postinstall
+DISTFILES += CSWvixiecron.postremove
+DISTFILES += csw$(GARNAME)
+DISTFILES += crontab.CSW
+DISTFILES += run-crons-0.3.2
 
 WORKSRC = $(WORKDIR)/cron-$(GARVERSION).orig
 
-SPKG_CLASSES = none cswinitsmf
+SPKG_CLASSES = none cswcpsampleconf cswinitsmf
+REQUIRED_PKGS = CSWcswclassutils
 
+PROTOTYPE_FILTER  = awk ' \
+    $$$$3 ~ /\/init.d\/cswvixiecron$$$$/ { $$$$2 = "cswinitsmf" } \
+    $$$$3 ~ /\/crontab\.CSW$$$$/ { $$$$2 = "cswcpsampleconf" } \
+    $$$$3 ~ /\/opt\/csw\/bin\/crontab$$$$/ { $$$$4 = "1755" } \
+    { print }'
+
 PATCHFILES = cron_$(GARVERSION)-105.diff.gz \
              gar-$(GARNAME)_$(GARVERSION).patch
 
@@ -43,6 +53,7 @@
 	ginstall -d $(DESTDIR)/opt/csw/sbin
 	ginstall -d $(DESTDIR)/opt/csw/share/man/cat5
 	ginstall -d $(DESTDIR)/opt/csw/share/man/cat8
+	@$(MAKECOOKIE)
 
 pre-install-isa-sparcv9: pre-install
 pre-install-isa-sparcv8: pre-install
@@ -50,17 +61,24 @@
 pre-install-isa-amd64: pre-install
 
 post-install:
+	ginstall -d $(DESTDIR)/etc/opt/csw/init.d
+	ginstall $(FILEDIR)/csw$(GARNAME) \
+		$(DESTDIR)/etc/opt/csw/init.d/csw$(GARNAME)
 	ginstall -d $(DESTDIR)/etc
-	ginstall -m 750 files/crontab.CSW $(DESTDIR)/etc/crontab.CSW
-	ginstall -m 755 files/run-crons-0.3.2 $(DESTDIR)/opt/csw/sbin/run-crons
+	ginstall -m 750 $(FILEDIR)/crontab.CSW \
+		$(DESTDIR)/etc/crontab.CSW
+	ginstall -m 755 $(FILEDIR)/run-crons-0.3.2 \
+		$(DESTDIR)/opt/csw/sbin/run-crons
 	for base in hourly daily weekly monthly; do \
 		ginstall -d $(DESTDIR)/etc/cron.$$base; \
 	done
+	@$(MAKECOOKIE)
 
+REQUIRED_PKGS = CSWcswclassutils
+
 post-install-isa-sparcv8: post-install
 post-install-isa-sparcv9: post-install
 post-install-isa-i386: post-install
 post-install-isa-amd64: post-install
 
-
 include gar/category.mk

Modified: csw/mgar/pkg/vixiecron/trunk/checksums
===================================================================
--- csw/mgar/pkg/vixiecron/trunk/checksums	2009-05-28 21:20:52 UTC (rev 5099)
+++ csw/mgar/pkg/vixiecron/trunk/checksums	2009-05-28 23:50:06 UTC (rev 5100)
@@ -1,11 +1,9 @@
-4c64aece846f8483daf440f8e3dd210f  download/cron_3.0pl1.orig.tar.gz
+aedcd26b85ba600a67414a489f78c1cf  download/CSWvixiecron.postinstall
+98917c3e13cefc8d910937056ab3b27f  download/CSWvixiecron.postremove
+852d67b49b724c633ff32115dab57b77  download/CSWvixiecron.preinstall
 6235d305843da483b69671cde7d1d8ea  download/cron_3.0pl1-105.diff.gz
-35010a2f583a6e3dc9f0a0e996b426f4  download/CSWvixiecron.gspec
-dd12d38a20e3f780fbcba0a1b1ffbfd0  download/CSWvixiecron.postinstall
-b5cdad15f8d66a84b807cd9cf5a04171  download/cswvixiecron
-4674c86391ccc621a6bab5442a323313  download/cswvixiecron.xml
-b5cdad15f8d66a84b807cd9cf5a04171  download/svc-cswvixiecron
+4c64aece846f8483daf440f8e3dd210f  download/cron_3.0pl1.orig.tar.gz
 d1c17a3cf4f1ff253c36897d94b0b834  download/crontab.CSW
-d0dd7b19670e9a40060977b0b8779cad  download/run-crons-0.3.2
-6235d305843da483b69671cde7d1d8ea  download/cron_3.0pl1-105.diff.gz
+b5cdad15f8d66a84b807cd9cf5a04171  download/cswvixiecron
 cf0aa68ad98415650daad595fbc415cf  download/gar-vixiecron_3.0pl1.patch
+d0dd7b19670e9a40060977b0b8779cad  download/run-crons-0.3.2

Deleted: csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.gspec
===================================================================
--- csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.gspec	2009-05-28 21:20:52 UTC (rev 5099)
+++ csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.gspec	2009-05-28 23:50:06 UTC (rev 5100)
@@ -1,5 +0,0 @@
-%var            bitname vixiecron
-%var            pkgname CSWvixiecron
-%include        url file://%{PKGLIB}/csw_dyndepend.gspec
-%var            SERVICE_CONF_FILES /etc/crontab
-%include        url file://%{PKGLIB}/smf_enabled.gspec

Modified: csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.postinstall
===================================================================
--- csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.postinstall	2009-05-28 21:20:52 UTC (rev 5099)
+++ csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.postinstall	2009-05-28 23:50:06 UTC (rev 5100)
@@ -5,7 +5,7 @@
 # Note: it's going to be executed by /bin/sh no matter what.
 
 # Add group crontab if it doesn't exist
-if groupmod crontab >/dev/null; then
+if groupmod crontab >/dev/null 2>&1; then
   echo  # How to make a negation in /bin/sh?
 else
   groupadd crontab
@@ -15,15 +15,3 @@
 mkdir -p /var/spool/cron/crontabs
 chown root:crontab /var/spool/cron/crontabs
 chmod 1730 /var/spool/cron/crontabs
-
-# Suid bit is not picked up by GAR automatically. An 'artifact' is raised:
-# https://sourceforge.net/tracker2/?func=detail&aid=2679715&group_id=229205&atid=1075770
-chmod g+s /opt/csw/bin/crontab
-chown root:crontab /opt/csw/bin/crontab
-
-# Copy the configuration file if not already present
-if test ! -f /etc/crontab; then
-  cp /etc/crontab.CSW /etc/crontab
-fi
-
-

Added: csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.postremove
===================================================================
--- csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.postremove	                        (rev 0)
+++ csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.postremove	2009-05-28 23:50:06 UTC (rev 5100)
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Starting Sun cron:
+svcadm enable svc:/system/cron:default

Added: csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.preinstall
===================================================================
--- csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.preinstall	                        (rev 0)
+++ csw/mgar/pkg/vixiecron/trunk/files/CSWvixiecron.preinstall	2009-05-28 23:50:06 UTC (rev 5100)
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo "Stopping svc:/system/cron:default"
+svcadm disable svc:/system/cron:default
+

Deleted: csw/mgar/pkg/vixiecron/trunk/files/cswvixiecron.xml
===================================================================
--- csw/mgar/pkg/vixiecron/trunk/files/cswvixiecron.xml	2009-05-28 21:20:52 UTC (rev 5099)
+++ csw/mgar/pkg/vixiecron/trunk/files/cswvixiecron.xml	2009-05-28 23:50:06 UTC (rev 5100)
@@ -1,24 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
-<service_bundle type='manifest' name='export'>
-  <service name='system/cswcron' type='service' version='0'>
-    <single_instance/>
-    <dependency name='fs' grouping='require_all' restart_on='none' type='service'>
-      <service_fmri value='svc:/system/filesystem/local'/>
-    </dependency>
-    <dependency name='net' grouping='require_all' restart_on='none' type='service'>
-      <service_fmri value='svc:/network/loopback'/>
-    </dependency>
-    <exec_method name='start' type='method' exec='/opt/csw/lib/svc/method/svc-cswvixiecron start' timeout_seconds='30'>
-      <method_context/>
-    </exec_method>
-    <exec_method name='stop' type='method' exec='/opt/csw/lib/svc/method/svc-cswvixiecron stop' timeout_seconds='30'>
-      <method_context/>
-    </exec_method>
-    <instance name='default' enabled='true'>
-      <property_group name='general' type='framework'>
-        <propval name='package' type='astring' value='CSWvixiecron'/>
-      </property_group>
-    </instance>
-  </service>
-</service_bundle>

Deleted: csw/mgar/pkg/vixiecron/trunk/files/svc-cswvixiecron
===================================================================
--- csw/mgar/pkg/vixiecron/trunk/files/svc-cswvixiecron	2009-05-28 21:20:52 UTC (rev 5099)
+++ csw/mgar/pkg/vixiecron/trunk/files/svc-cswvixiecron	2009-05-28 23:50:06 UTC (rev 5100)
@@ -1,17 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-
-case "$1" in
-  start)
-    /opt/csw/sbin/cron -l
-    ;;
-
-  stop)
-    /usr/bin/pkill -z `zonename` '^cron$'
-    ;;
-  *)
-    echo "Usage: $0 { start | stop }"
-    exit 1
-    ;;
-esac


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