[csw-devel] SF.net SVN: gar:[8524] csw/mgar/pkg

skayser at users.sourceforge.net skayser at users.sourceforge.net
Fri Feb 12 16:07:27 CET 2010


Revision: 8524
          http://gar.svn.sourceforge.net/gar/?rev=8524&view=rev
Author:   skayser
Date:     2010-02-12 15:07:26 +0000 (Fri, 12 Feb 2010)

Log Message:
-----------
scfdot: initial commit

Added Paths:
-----------
    csw/mgar/pkg/scfdot/
    csw/mgar/pkg/scfdot/branches/
    csw/mgar/pkg/scfdot/tags/
    csw/mgar/pkg/scfdot/trunk/
    csw/mgar/pkg/scfdot/trunk/Makefile
    csw/mgar/pkg/scfdot/trunk/checksums
    csw/mgar/pkg/scfdot/trunk/files/
    csw/mgar/pkg/scfdot/trunk/files/README.CSW
    csw/mgar/pkg/scfdot/trunk/files/smfdepgraph


Property changes on: csw/mgar/pkg/scfdot/trunk
___________________________________________________________________
Added: svn:ignore
   + cookies
download
work


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


Added: csw/mgar/pkg/scfdot/trunk/Makefile
===================================================================
--- csw/mgar/pkg/scfdot/trunk/Makefile	                        (rev 0)
+++ csw/mgar/pkg/scfdot/trunk/Makefile	2010-02-12 15:07:26 UTC (rev 8524)
@@ -0,0 +1,61 @@
+# TODO
+# ! dot seems to put an extraneous header line in each output file
+#   -36 3393.7 translate newpath user_shape_0
+#   Why is this? Bug?
+GARNAME = scfdot
+GARVERSION = 1.0
+CATEGORIES = apps
+
+DESCRIPTION = SMF Dependency Graph Generator
+define BLURB
+  Solaris 10 features the Service Management Facility (SMF), which starts
+  services in dependency order.  Run "man smf" for more information.  scfdot
+  reads the service names and dependencies from the Service Configuration
+  Facility (SCF) repository and writes a file which the dot program from the
+  graphviz package can render into a graph.
+endef
+
+VENDOR_URL   = http://hub.opensolaris.org/bin/view/Community+Group+smf/scfdot
+MASTER_SITES = http://hub.opensolaris.org/bin/download/Community+Group+smf/scfdot/
+DISTFILES    = $(GARNAME)-$(GARVERSION).tar.gz
+
+# Only makes sense on Solaris 10
+PACKAGING_PLATFORMS = solaris10-sparc solaris10-i386
+
+LICENSE = CDDL.LICENSE
+
+RUNTIME_DEP_PKGS = CSWgraphviz
+
+CONFIGURE_SCRIPTS =
+BUILD_SCRIPTS     = custom
+TEST_SCRIPTS      =
+INSTALL_SCRIPTS   = custom
+
+BUILD_TARGETS = scfdot legend.ps
+
+include gar/category.mk
+
+build-custom:
+	$(BUILD_ENV) gmake -C $(WORKSRC) scfdot
+	$(BUILD_ENV) gmake -C $(WORKSRC) legend.ps
+	@$(MAKECOOKIE)
+
+install-custom: DOCS=AUTHORS
+install-custom: DOCDEST=$(DESTDIR)$(docdir)/$(GARNAME)
+install-custom:
+	ginstall -d	$(DOCDEST)/examples
+	cp $(WORKSRC)/snv_24_x86.* $(DOCDEST)/examples
+	cp $(addprefix $(WORKSRC)/,$(DOCS)) $(DOCDEST)
+	cp $(FILEDIR)/README.CSW $(DOCDEST)
+
+	@# We place the scfdot binary in libexec and instead put a
+	@# readily usable wrapper in bindir
+	ginstall -d $(DESTDIR)$(bindir)
+	ginstall -d $(DESTDIR)$(libexecdir)
+	ginstall -m755 $(FILEDIR)/smfdepgraph $(DESTDIR)$(bindir)
+	ginstall -m755  $(WORKSRC)/scfdot $(DESTDIR)$(libexecdir)
+
+	@# smfdepgraph includes a legend which we also ship
+	ginstall -Dm644 $(WORKSRC)/legend.ps \
+		$(DESTDIR)$(datadir)/$(GARNAME)/legend.ps
+	@$(MAKECOOKIE)

Added: csw/mgar/pkg/scfdot/trunk/checksums
===================================================================
--- csw/mgar/pkg/scfdot/trunk/checksums	                        (rev 0)
+++ csw/mgar/pkg/scfdot/trunk/checksums	2010-02-12 15:07:26 UTC (rev 8524)
@@ -0,0 +1 @@
+13cdf51e78d0589c3721a684613aa734  scfdot-1.0.tar.gz

Added: csw/mgar/pkg/scfdot/trunk/files/README.CSW
===================================================================
--- csw/mgar/pkg/scfdot/trunk/files/README.CSW	                        (rev 0)
+++ csw/mgar/pkg/scfdot/trunk/files/README.CSW	2010-02-12 15:07:26 UTC (rev 8524)
@@ -0,0 +1,39 @@
+This package contains a wrapper around scfdot which should be sufficient
+for most use cases: smfdepgraph. Invoke it with 
+
+    smfdepgraph <outfile.ext>
+
+and it will generate a SMF dependency graph in whichever file format you
+specify (determined via the file extension). Default is postscript. The
+extension will be passed to dot via -T<ext> so dot needs to support it.
+Unsupported file extensions will give you a list of supported ones.
+
+In case you need to invoke scfdot directly, these are the usage instructions.
+We operate in two modes: with and without -L. Without -L, we print nodes
+for each instance and edges for each dependency. Fortunately dot allows
+forward references, so we can do this in one pass. Options are
+
+  -s width,height  Size, in inches, that the graph should be limited to.
+
+  -l legend.ps     PostScript file which should be used as the legend.
+
+  -x opts          Simplify the graph. opts should be a comma-separated
+                   list of
+
+     omit_net_deps
+             Omit most of the dependencies on
+             network/loopback and network/physical.
+
+     consolidate_inetd_svcs
+             Consolidate services which only depend on
+             network/inetd into a single node.
+
+     consolidate_rpcbind_svcs 
+             Consolidate services which only depend on
+             network/inetd and rpc/bind into a single node.
+
+Other hard-coded graph settings (rankdir, nodesep, margin) were intended
+for a 42" plotter. -L causes the program to print a dot file for use as
+a legend. It currently consists of eight nodes which demonstrate the
+color scheme and the dependency types.  The nodes are enclosed in a box
+which is labeled "legend".

Added: csw/mgar/pkg/scfdot/trunk/files/smfdepgraph
===================================================================
--- csw/mgar/pkg/scfdot/trunk/files/smfdepgraph	                        (rev 0)
+++ csw/mgar/pkg/scfdot/trunk/files/smfdepgraph	2010-02-12 15:07:26 UTC (rev 8524)
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# smfdepgraph:
+# Wrapper around the scfdot binary. Replaces the upstream shipped Makefile
+# which is geared towards build dir usage.
+
+set -u
+
+SCFDOT=/opt/csw/libexec/scfdot
+LEGEND=/opt/csw/share/scfdot/legend.ps
+SCFDOT_OPTS="-s 300,42 -l ${LEGEND} -x consolidate_inetd_svcs"
+
+[ $# -eq 1 ] || {
+  echo "Usage: ${0##*/} <outputfile>"
+  echo "File extensions sets file type, default is postscript."
+  exit 1
+}
+
+OUTFILE=${1}
+OUTTYPE=${OUTFILE##*.}; OUTTYPE=${OUTTYPE:-ps}
+
+echo "Generating ${OUTFILE} (with file type ${OUTTYPE})"
+# Directly pipe scfdot output into the dot binary
+$SCFDOT $SCFDOT_OPTS | dot -T${OUTTYPE} /dev/fd/0 > $OUTFILE


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