[solaris] version depend files, auto-generate. Start zebra when needed.

2006-02-19 Paul Jakma <paul.jakma@sun.com>

	* depend.*: renamed to depend.*.in.
	* depend.*.in: Add version dependency.
	* Makefile.am: Generate depend.* from depend.*.in
	  Distribute the depend.*.in files rather than the depend.*
	  files.
	* quagga.init.in: Enable zebra if one of the link-state
	  daemons is started.
	  Restart method is not required - SMF handles that.
	* quagga.xml.in: Remove restart method details.
diff --git a/solaris/ChangeLog b/solaris/ChangeLog
index e3144df..1386214 100644
--- a/solaris/ChangeLog
+++ b/solaris/ChangeLog
@@ -1,3 +1,15 @@
+2006-02-19 Paul Jakma <paul.jakma@sun.com>
+
+	* depend.*: renamed to depend.*.in.
+	* depend.*.in: Add version dependency.
+	* Makefile.am: Generate depend.* from depend.*.in
+	  Distribute the depend.*.in files rather than the depend.*
+	  files.
+	* quagga.init.in: Enable zebra if one of the link-state
+	  daemons is started.
+	  Restart method is not required - SMF handles that.
+	* quagga.xml.in: Remove restart method details.
+
 2005-11-04 Paul Jakma <paul.jakma@sun.com>
 
 	* prototype.dev.in: lib/md5-gnu.h is now lib/md5.h
diff --git a/solaris/Makefile.am b/solaris/Makefile.am
index 82da314..acccbdb 100644
--- a/solaris/Makefile.am
+++ b/solaris/Makefile.am
@@ -1,5 +1,5 @@
 # Solaris packages automake file
-# $Id: Makefile.am,v 1.6 2005/05/13 07:26:07 paul Exp $
+# $Id: Makefile.am,v 1.7 2006/02/19 18:59:26 paul Exp $
 
 .PHONY: packages
 
@@ -83,6 +83,10 @@
 %.xml: $(srcdir)/%.xml.in Makefile
 	rm -f $@
 	$(edit) $< > $@
+# use edit to construct the depend files
+depend.%: $(srcdir)/depend.%.in Makefile
+	rm -f $@
+	$(edit) $< > $@
 
 # method file (bit like init script)
 quagga.init: $(srcdir)/quagga.init.in Makefile
@@ -102,13 +106,13 @@
 #BUILT_SOURCES = pkginfo.daemons pkginfo.dev pkginfo.doc pkginfo.libs \
 #	prototype.daemons prototype.dev prototype.doc prototype.libs
 BUILT_SOURCES = $(pkg_pkginfos) pkginfo.tmpl $(pkg_prototypes) \
-	$(pkg_manifests) quagga.init
+	$(pkg_manifests) $(pkg_depends) quagga.init
 
 CLEANFILES := $(BUILT_SOURCES) $(pkg_packages)
 
-EXTRA_DIST := $(pkg_depends) $(pkg_manifests:%=%.in) $(pkg_prototypes:%=%.in) \
+EXTRA_DIST := $(pkg_manifests:%=%.in) $(pkg_prototypes:%=%.in) \
 	$(pkg_names:%=pkginfo.%.tmpl.in) $(srcdir)/pkginfo.tmpl.in \
-	quagga.init.in README.txt
+	$(pkg_depends:%=%.in) quagga.init.in README.txt
 
 pkg-root-install:
 	(cd $(top_builddir) && \
diff --git a/solaris/depend.daemons b/solaris/depend.daemons.in
similarity index 85%
rename from solaris/depend.daemons
rename to solaris/depend.daemons.in
index 571d2e1..3430e8c 100644
--- a/solaris/depend.daemons
+++ b/solaris/depend.daemons.in
@@ -1,4 +1,5 @@
 P QUAGGAlibs Quagga common runtime libraries
+	@PACKAGE_VERSION@,REV=@CONFDATE@
 P SUNWcsu Core Solaris, (Usr)
 P SUNWcsr Core Solaris Libraries (Root)
 P SUNWcnetr Core Solaris Network Infrastructure (Root)
diff --git a/solaris/depend.dev b/solaris/depend.dev
deleted file mode 100644
index 7d88070..0000000
--- a/solaris/depend.dev
+++ /dev/null
@@ -1 +0,0 @@
-P QUAGGAlibs Quagga common runtime libraries
diff --git a/solaris/depend.dev.in b/solaris/depend.dev.in
new file mode 100644
index 0000000..8f23482
--- /dev/null
+++ b/solaris/depend.dev.in
@@ -0,0 +1,2 @@
+P QUAGGAlibs Quagga common runtime libraries
+	@PACKAGE_VERSION@,REV=@CONFDATE@
diff --git a/solaris/depend.doc b/solaris/depend.doc.in
similarity index 100%
rename from solaris/depend.doc
rename to solaris/depend.doc.in
diff --git a/solaris/depend.libs b/solaris/depend.libs.in
similarity index 100%
rename from solaris/depend.libs
rename to solaris/depend.libs.in
diff --git a/solaris/depend.smf b/solaris/depend.smf.in
similarity index 79%
rename from solaris/depend.smf
rename to solaris/depend.smf.in
index d648708..d078ea8 100644
--- a/solaris/depend.smf
+++ b/solaris/depend.smf.in
@@ -1,4 +1,5 @@
 P QUAGGAdaemons Quagga daemons
+	@PACKAGE_VERSION@,REV=@CONFDATE@
 P SUNWcsu Core Solaris, (Usr)
 P SUNWcsr Core Solaris Libraries (Root)
 I SUNWzebrar
diff --git a/solaris/quagga.init.in b/solaris/quagga.init.in
index ba3b484..1fa9876 100755
--- a/solaris/quagga.init.in
+++ b/solaris/quagga.init.in
@@ -3,7 +3,7 @@
 # Copyright 2001,2003 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# $Id: quagga.init.in,v 1.4 2005/06/15 11:00:11 paul Exp $
+# $Id: quagga.init.in,v 1.5 2006/02/19 18:59:26 paul Exp $
 #
 # Starts/stops the appropriate daemon
 
@@ -35,7 +35,10 @@
 svcs ${FMRI} > /dev/null 2>&1 || exit $SMF_EXIT_ERR_CONFIG
 
 case ${INSTANCE} in
-	zebra | ospfd | ospf6d | ripd | ripngd | bgpd )
+	zebra | bgpd )
+	;;
+	ospfd | ospf6d | ripd | ripngd )
+	/usr/sbin/svcadm enable zebra
 	;;
 	*)
 	usage
@@ -77,9 +80,6 @@
 	ARGS="${ARGS} --pid_file ${PIDFILE}"
 fi
 
-# config file must exist
-#[ ! -f "$CONFFILE" ] &&  exit $SMF_EXIT_ERR_CONFIG
-
 # we need @quagga_statedir@ to exist, it might be on tmpfs.
 if [ ! -d @quagga_statedir@ ] ; then
 	mkdir -p @quagga_statedir@
@@ -97,12 +97,6 @@
 	fi
 }
 
-restart() {
-	stop ${INSTANCE}
-	sleep 1
-	start ${INSTANCE}
-}
-
 case $1 in 
 'start')
 	start ${2}
@@ -111,9 +105,6 @@
 	stop ${2}
 	;;
 
-'restart')
-	restart ${2}
-	;;
 *)
 	usage
 	exit 1
diff --git a/solaris/quagga.xml.in b/solaris/quagga.xml.in
index dfa2eb6..5ce4ace 100644
--- a/solaris/quagga.xml.in
+++ b/solaris/quagga.xml.in
@@ -48,11 +48,6 @@
 		exec='/lib/svc/method/quagga stop %f %i'
 		timeout_seconds='60' />
 
-	<exec_method
-		type='method'
-		name='restart'
-		exec='/lib/svc/method/quagga restart %f %i'
-		timeout_seconds='60' />
 	<!-- 
 		if we define these properties at the service level, each instance
 		inherits them, and it can override with desired values.