SF.net SVN: gar:[22585] csw/mgar/pkg/dictd/trunk

pfelecan at users.sourceforge.net pfelecan at users.sourceforge.net
Wed Nov 27 13:32:18 CET 2013


Revision: 22585
          http://gar.svn.sourceforge.net/gar/?rev=22585&view=rev
Author:   pfelecan
Date:     2013-11-27 12:32:16 +0000 (Wed, 27 Nov 2013)
Log Message:
-----------
dictd/trunk:
- SMF integration
- specific user and group to run the server
- sample configuration management
- automatic dictionaries list generation
- removed the need of some overrides

Modified Paths:
--------------
    csw/mgar/pkg/dictd/trunk/Makefile
    csw/mgar/pkg/dictd/trunk/files/dictdconfig.alias

Added Paths:
-----------
    csw/mgar/pkg/dictd/trunk/files/0009-root-pid-file-in-OCSW-hierarchy.patch
    csw/mgar/pkg/dictd/trunk/files/CSWdictd.postinstall
    csw/mgar/pkg/dictd/trunk/files/cswdictd
    csw/mgar/pkg/dictd/trunk/files/cswusergroup

Modified: csw/mgar/pkg/dictd/trunk/Makefile
===================================================================
--- csw/mgar/pkg/dictd/trunk/Makefile	2013-11-27 08:25:44 UTC (rev 22584)
+++ csw/mgar/pkg/dictd/trunk/Makefile	2013-11-27 12:32:16 UTC (rev 22585)
@@ -32,6 +32,8 @@
 # configurator:
 DISTFILES		+=	dictdconfig
 DISTFILES		+=	dictdconfig.8
+DISTFILES		+=	CSWdictd.postinstall
+
 # patches:
 PATCHFILES		+=	0001-fix-and-enhance-documentation.patch
 PATCHFILES		+=	0002-test-drivers-use-bash.patch
@@ -41,7 +43,16 @@
 PATCHFILES		+=	0006-fix-inexistent-groff-macro.patch
 PATCHFILES		+=	0007-close-all-files-except-standard-streams.patch
 PATCHFILES		+=	0008-fix-spelling-typos.patch
+PATCHFILES		+=	0009-root-pid-file-in-OCSW-hierarchy.patch
 
+INITSMF		=	$(sysconfdir)/init.d/cswdictd
+SAMPLECONF	+=	$(sysconfdir)/$(NAME)/colorit[.]conf
+SAMPLECONF	+=	$(sysconfdir)/$(NAME)/dict[.]conf
+SAMPLECONF	+=	$(sysconfdir)/$(NAME)/dictd[.]conf
+SAMPLECONF	+=	$(sysconfdir)/$(NAME)/dictd[.]order
+SAMPLECONF	+=	$(sysconfdir)/$(NAME)/dictdconfig[.]alias
+USERGROUP	=	$(sysconfdir)/pkg/CSW$(NAME)/cswusergroup
+
 BUILD_DEP_PKGS	+=	CSWlibmaa-dev
 BUILD_DEP_PKGS	+=	CSWlibz-dev
 BUILD_DEP_PKGS	+=	CSWlibdbi-dev
@@ -67,8 +78,8 @@
 PKGFILES_CSWdict			+=	$(bindir)/dict
 PKGFILES_CSWdict			+=	$(bindir)/dict_lookup
 PKGFILES_CSWdict			+=	$(bindir)/dictl
-PKGFILES_CSWdict			+=	$(sysconfdir)/$(NAME)/colorit.conf
-PKGFILES_CSWdict			+=	$(sysconfdir)/$(NAME)/dict.conf
+PKGFILES_CSWdict			+=	$(sysconfdir)/$(NAME)/colorit[.]conf.*
+PKGFILES_CSWdict			+=	$(sysconfdir)/$(NAME)/dict[.]conf.*
 PKGFILES_CSWdict			+=	$(docdir)/$(CATALOGNAME_CSWdict)/ANNOUNCE
 PKGFILES_CSWdict			+=	$(docdir)/$(CATALOGNAME_CSWdict)/ChangeLog
 PKGFILES_CSWdict			+=	$(docdir)/$(CATALOGNAME_CSWdict)/NEWS
@@ -106,10 +117,13 @@
 SPKG_DESC_CSWdictd			=	$(DESCRIPTION), server
 CATALOGNAME_CSWdictd		=	dictd
 PKGFILES_CSWdictd			+=	$(sbindir)/.*
-PKGFILES_CSWdictd			+=	$(sysconfdir)/$(NAME)/dictd.conf
-PKGFILES_CSWdictd			+=	$(sysconfdir)/$(NAME)/dictd.order
-PKGFILES_CSWdictd			+=	$(sysconfdir)/$(NAME)/dictdconfig.alias
+PKGFILES_CSWdictd			+=	$(INITSMF)
+PKGFILES_CSWdictd			+=	$(sysconfdir)/$(NAME)/dictd[.]conf.*
+PKGFILES_CSWdictd			+=	$(sysconfdir)/$(NAME)/dictd[.]order.*
+PKGFILES_CSWdictd			+=	$(sysconfdir)/$(NAME)/dictdconfig[.]alias.*
+PKGFILES_CSWdictd			+=	$(USERGROUP)
 PKGFILES_CSWdictd			+=	$(mandir)/man8/.*
+PKGFILES_CSWdictd			+=	$(localstatedir)/run/$(NAME)
 
 PKGFILES_CSWdictd			+=	$(docdir)/$(NAME)/ANNOUNCE
 PKGFILES_CSWdictd			+=	$(docdir)/$(NAME)/ChangeLog
@@ -129,6 +143,7 @@
 PKGFILES_CSWdictd			+=	$(docdir)/$(NAME)/README.Virtual_dictionaries
 PKGFILES_CSWdictd			+=	$(libexecdir)/$(NAME)/.*
 PKGFILES_CSWdictd			+=	$(localstatedir)/lib/$(NAME)
+RUNTIME_DEP_PKGS			+=	CSWcswclassutils
 RUNTIME_DEP_PKGS_CSWdictd	+=	CSWlibgcc-s1
 RUNTIME_DEP_PKGS_CSWdictd	+=	CSWlibmaa3
 RUNTIME_DEP_PKGS_CSWdictd	+=	CSWlibz1
@@ -140,7 +155,6 @@
 CHECKPKG_OVERRIDES_CSWdictd	+=	no-direct-binding|/opt/csw/libexec/dictd/dictdplugin_popen.so.0.0.0|is|not|directly|bound|to|soname|libgcc_s.so.1
 CHECKPKG_OVERRIDES_CSWdictd	+=	no-direct-binding|/opt/csw/libexec/dictd/dictdplugin_popen.so.0.0.0|is|not|directly|bound|to|soname|libmaa.so.3
 CHECKPKG_OVERRIDES_CSWdictd	+=	file-with-bad-content|/usr/share|root/opt/csw/sbin/dictdconfig
-CHECKPKG_OVERRIDES_CSWdictd	+=	file-with-bad-content|/usr/share|root/etc/opt/csw/dictd/dictdconfig.alias
 
 PACKAGES						+=	CSWdictd-dev
 CATALOGNAME_CSWdictd-dev		=	dictd_dev
@@ -170,41 +184,49 @@
 post-install: pkgsexdir		=	$(docdir)/$(NAME)/examples
 post-install: pkgcexdir		=	$(docdir)/$(CATALOGNAME_CSWdict)/examples
 post-install: pkgconfdir	=	$(sysconfdir)/$(NAME)
+post-install: pkgugdir		=	$(dir $(USERGROUP))
+post-install: pkgpiddir		=	$(localstatedir)/run/$(NAME)
+post-install: pkginitdir	=	$(dir $(INITSMF))
 post-install:
 	cd $(WORKSRC) && \
 	/usr/bin/env -i $(INSTALL_ENV) && $(MAKE) DESTDIR=$(DESTDIR) -C $(OBJDIR) install.samples
 	ginstall --directory --mode=u=rwx,go=rx $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/ANNOUNCE $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/ChangeLog $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/INITSCRIPT $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/INSTALL $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/NEWS $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/README $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/TODO $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/readme-dictd-locales $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/README.Index2suffix $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/README.Index2word $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/README.Unformat $(DESTDIR)/$(pkgsdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/README.Virtual_dictionaries $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/ANNOUNCE $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/ChangeLog $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/INITSCRIPT $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/INSTALL $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/NEWS $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/README $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/TODO $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/readme-dictd-locales $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/README.Index2suffix $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/README.Index2word $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/README.Unformat $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/README.Virtual_dictionaries $(DESTDIR)/$(pkgsdocdir)
 	cd $(WORKSRC)/doc && \
-	ginstall --preserve-timestamps --mode=u=rwx,go=r dicf.txt dicf.ps rfc.txt rfc.ps security.doc $(DESTDIR)/$(pkgsdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r dicf.txt dicf.ps rfc.txt rfc.ps security.doc $(DESTDIR)/$(pkgsdocdir)
 	ginstall --directory --mode=u=rwx,go=rx $(DESTDIR)/$(pkgcdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/ANNOUNCE $(DESTDIR)/$(pkgcdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/ChangeLog $(DESTDIR)/$(pkgcdocdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/NEWS $(DESTDIR)/$(pkgcdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/ANNOUNCE $(DESTDIR)/$(pkgcdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/ChangeLog $(DESTDIR)/$(pkgcdocdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/NEWS $(DESTDIR)/$(pkgcdocdir)
 	ginstall --directory --mode=u=rwx,go=rx $(DESTDIR)/$(pkgsexdir)
 	cd $(WORKSRC)/examples && \
-	ginstall --preserve-timestamps --mode=u=rwx,go=r dictd* $(DESTDIR)/$(pkgsexdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/dictd_virtual2.conf $(DESTDIR)/$(pkgsexdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r dictd* $(DESTDIR)/$(pkgsexdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/dictd_virtual2.conf $(DESTDIR)/$(pkgsexdir)
 	ginstall --directory --mode=u=rwx,go=rx $(DESTDIR)/$(pkgcexdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKSRC)/examples/dict1.conf $(DESTDIR)/$(pkgcexdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKSRC)/examples/dict1.conf $(DESTDIR)/$(pkgcexdir)
 	ginstall --directory --mode=u=rwx,go=rx $(DESTDIR)/$(pkgconfdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/colorit.conf $(DESTDIR)/$(pkgconfdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/dict.conf $(DESTDIR)/$(pkgconfdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/dictd.conf $(DESTDIR)/$(pkgconfdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/dictd.order $(DESTDIR)/$(pkgconfdir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/dictdconfig.alias $(DESTDIR)/$(pkgconfdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/colorit.conf $(DESTDIR)/$(pkgconfdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/dict.conf $(DESTDIR)/$(pkgconfdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/dictd.conf $(DESTDIR)/$(pkgconfdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/dictd.order $(DESTDIR)/$(pkgconfdir)
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/dictdconfig.alias $(DESTDIR)/$(pkgconfdir)
 	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/dictdconfig $(DESTDIR)/$(sbindir)
-	ginstall --preserve-timestamps --mode=u=rwx,go=r $(WORKDIR)/dictdconfig.8 $(DESTDIR)/$(mandir)/man8
+	ginstall --preserve-timestamps --mode=u=rw,go=r $(WORKDIR)/dictdconfig.8 $(DESTDIR)/$(mandir)/man8
 	ginstall --directory --mode=u=rwx,go=rx $(DESTDIR)/$(localstatedir)/lib/$(NAME)
+	ginstall --directory --mode=u=rwx,go=rx $(DESTDIR)/$(pkgugdir)
+	ginstall --preserve-timestamps --mode=u=r,go=r $(FILEDIR)/cswusergroup $(DESTDIR)/$(pkgugdir)
+	ginstall --directory --mode=u=rwx,go=rx $(DESTDIR)/$(pkgpiddir)
+	ginstall --directory --mode=u=rwx,go=rx $(DESTDIR)/$(pkginitdir)
+	ginstall --preserve-timestamps --mode=u=rwx,go=r $(FILEDIR)/cswdictd $(DESTDIR)/$(pkginitdir)
 	$(MAKECOOKIE)

Added: csw/mgar/pkg/dictd/trunk/files/0009-root-pid-file-in-OCSW-hierarchy.patch
===================================================================
--- csw/mgar/pkg/dictd/trunk/files/0009-root-pid-file-in-OCSW-hierarchy.patch	                        (rev 0)
+++ csw/mgar/pkg/dictd/trunk/files/0009-root-pid-file-in-OCSW-hierarchy.patch	2013-11-27 12:32:16 UTC (rev 22585)
@@ -0,0 +1,48 @@
+From 61640cd17b8089464f4796210358753fcfdf2cb9 Mon Sep 17 00:00:00 2001
+From: Peter Felecan <pfelecan at opencsw.org>
+Date: Tue, 26 Nov 2013 20:23:50 +0100
+Subject: [PATCH] root pid file in OCSW hierarchy
+
+---
+ dictd.8.in | 4 ++--
+ dictd.c    | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/dictd.8.in b/dictd.8.in
+index 497adff..892bba6 100644
+--- a/dictd.8.in
++++ b/dictd.8.in
+@@ -902,7 +902,7 @@ The specified filename will be created to contain
+ the process id of the main
+ .B dictd
+ process. The default is
+-.I /var/run/dictd.pid
++.I /var/opt/csw/run/dictd/pid
+ .TP
+ .BI fast\_start
+ By default, dictd creates (in memory) additional index
+@@ -1451,7 +1451,7 @@ configuration file
+ .B dictd
+ daemon itself
+ .TP
+-.I /var/run/dictd.pid
++.I /var/opt/csw/run/dictd/pid
+ File for storing pid of
+ .B dictd
+ daemon
+diff --git a/dictd.c b/dictd.c
+index 9b83774..c92c642 100644
+--- a/dictd.c
++++ b/dictd.c
+@@ -76,7 +76,7 @@ int                logOptions   = 0;
+ const char         *logFile     = NULL;
+ int logFile_set; /* 1 if set by command line option */
+ 
+-const char *pidFile     = "/var/run/dictd.pid";
++const char *pidFile     = "/var/opt/csw/run/dictd/pid";
+ int pidFile_set; /* 1 if set by command line option */
+ 
+ const char         *daemon_service     = DICT_DEFAULT_SERVICE;
+-- 
+1.8.4.1
+

Added: csw/mgar/pkg/dictd/trunk/files/CSWdictd.postinstall
===================================================================
--- csw/mgar/pkg/dictd/trunk/files/CSWdictd.postinstall	                        (rev 0)
+++ csw/mgar/pkg/dictd/trunk/files/CSWdictd.postinstall	2013-11-27 12:32:16 UTC (rev 22585)
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+Configurator=/opt/csw/sbin/dictdconfig
+
+test -x  ${Configurator} && ${Configurator} --write

Added: csw/mgar/pkg/dictd/trunk/files/cswdictd
===================================================================
--- csw/mgar/pkg/dictd/trunk/files/cswdictd	                        (rev 0)
+++ csw/mgar/pkg/dictd/trunk/files/cswdictd	2013-11-27 12:32:16 UTC (rev 22585)
@@ -0,0 +1,53 @@
+#!/sbin/sh
+
+# $Id$
+#
+# init script for dictd.
+
+# Copyright (C) 2013 Peter Felecan peter at felecan.org
+#
+# This file is part of dictd package offered by OpenCSW
+#
+# This script is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This script is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this script.  If not, see <http://www.gnu.org/licenses/>.
+
+#RC_KNUM 10
+#RC_SNUM 90
+#RC_KLEV 0,1,2,S
+#RC_SLEV 3
+#FMRI network
+
+PIDFile=/var/opt/csw/run/dictd/pid
+
+case "$1" in
+  start)
+    if [ -f /opt/csw/sbin/dictd ]
+	then
+    {
+		echo "Starting dictd."
+		/opt/csw/sbin/dictd
+	}
+    fi
+    ;;
+  stop)
+    echo "Shutting down dictd."
+    kill `cat ${PIDFile}`
+    ;;
+  reload|refresh)
+    echo "Reloading dictd."
+    kill -1 `cat ${PIDFile}`
+    ;;
+  *)
+    echo "Usage: $0 { start | stop | reload | refresh }"
+    ;;
+esac


Property changes on: csw/mgar/pkg/dictd/trunk/files/cswdictd
___________________________________________________________________
Added: svn:keywords
   + Id

Added: csw/mgar/pkg/dictd/trunk/files/cswusergroup
===================================================================
--- csw/mgar/pkg/dictd/trunk/files/cswusergroup	                        (rev 0)
+++ csw/mgar/pkg/dictd/trunk/files/cswusergroup	2013-11-27 12:32:16 UTC (rev 22585)
@@ -0,0 +1 @@
+dictd:dictd:CSW DICT Server:/false:/bin/false:::NP

Modified: csw/mgar/pkg/dictd/trunk/files/dictdconfig.alias
===================================================================
--- csw/mgar/pkg/dictd/trunk/files/dictdconfig.alias	2013-11-27 08:25:44 UTC (rev 22584)
+++ csw/mgar/pkg/dictd/trunk/files/dictdconfig.alias	2013-11-27 12:32:16 UTC (rev 22585)
@@ -1,9 +1,9 @@
 #!/usr/bin/perl -lp
 
 # By default, dictdconfig uses the basename of the file in
-# /usr/share/dictd as the name of the database.  This file is an
+# /opt/csw/share/dictd as the name of the database.  This file is an
 # executable filter that substitutes a preferred name for a dictionary
-# in /var/lib/dictd/db.list.  This name is displayed by the dict -D
+# in /var/opt/csw/lib/dictd/db.list.  This name is displayed by the dict -D
 # command and is used with the -d option of dict to request
 # definitions from a specific dictionary instead of the default of all
 # installed dictionaries.

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