[csw-devel] SF.net SVN: gar:[7508] csw/mgar/pkg/bind/trunk

bonivart at users.sourceforge.net bonivart at users.sourceforge.net
Mon Nov 30 17:13:47 CET 2009


Revision: 7508
          http://gar.svn.sourceforge.net/gar/?rev=7508&view=rev
Author:   bonivart
Date:     2009-11-30 16:13:46 +0000 (Mon, 30 Nov 2009)

Log Message:
-----------
bind: fix bug with config files having double extension, added chroot package

Modified Paths:
--------------
    csw/mgar/pkg/bind/trunk/Makefile
    csw/mgar/pkg/bind/trunk/checksums
    csw/mgar/pkg/bind/trunk/files/CSWbind.cswnamed

Added Paths:
-----------
    csw/mgar/pkg/bind/trunk/files/CSWbindchroot.postinstall
    csw/mgar/pkg/bind/trunk/files/bind.CSW

Property Changed:
----------------
    csw/mgar/pkg/bind/trunk/files/

Modified: csw/mgar/pkg/bind/trunk/Makefile
===================================================================
--- csw/mgar/pkg/bind/trunk/Makefile	2009-11-30 00:52:31 UTC (rev 7507)
+++ csw/mgar/pkg/bind/trunk/Makefile	2009-11-30 16:13:46 UTC (rev 7508)
@@ -19,16 +19,16 @@
 DISTFILES  = $(DISTNAME).tar.gz
 #MASTER_SITES = http://ftp.isc.org/isc/bind9/$(GARVERSION)/
 #DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
+DISTFILES += CSWbindchroot.postinstall
 
-PACKAGES = CSWbind CSWbinddevel CSWlibbind CSWbindutils
-#PACKAGES = CSWbind CSWbinddevel CSWlibbind CSWbindutils CSWbindchroot
+PACKAGES = CSWbind CSWbinddevel CSWlibbind CSWbindutils CSWbindchroot
 
 CATALOGNAME_CSWbinddevel = bind_devel
 CATALOGNAME_CSWbindutils = bind_utils
-#CATALOGNAME_CSWbindchroot = bind_chroot
+CATALOGNAME_CSWbindchroot = bind_chroot
 
 ARCHALL_CSWbinddevel = 1
-#ARCHALL_CSWbindchroot = 1
+ARCHALL_CSWbindchroot = 1
 
 LICENSE = COPYRIGHT
 
@@ -36,13 +36,13 @@
 SPKG_DESC_CSWbinddevel = ISC BIND DNS development package
 SPKG_DESC_CSWlibbind = ISC BIND DNS library package
 SPKG_DESC_CSWbindutils = ISC BIND DNS utilities package
-#SPKG_DESC_CSWbindchroot = ISC BIND DNS chroot package
+SPKG_DESC_CSWbindchroot = ISC BIND DNS chroot package
 
 REQUIRED_PKGS_CSWbind = CSWlibbind CSWbindutils CSWiconv CSWlibxml2 CSWosslrt CSWzlib
 REQUIRED_PKGS_CSWbinddevel = CSWbind
 REQUIRED_PKGS_CSWlibbind = CSWiconv CSWlibxml2 CSWosslrt CSWzlib
 REQUIRED_PKGS_CSWbindutils = CSWlibbind CSWiconv CSWlibxml2 CSWosslrt CSWzlib
-#REQUIRED_PKGS_CSWbindchroot = CSWbind
+REQUIRED_PKGS_CSWbindchroot = CSWbind
 
 # We define upstream file regex so we can be notifed of new upstream software release
 UPSTREAM_MASTER_SITES = http://ftp.isc.org/isc/bind9/
@@ -61,22 +61,23 @@
 PKGFILES_CSWbinddevel = $(PKGFILES_DEVEL)
 PKGFILES_CSWlibbind   = $(libdir)/.*
 PKGFILES_CSWbindutils = $(bindir)/.*
-#PKGFILES_CSWbindchroot = .*chroot.*
+PKGFILES_CSWbindchroot = .*chroot.*
 
 INSTALL_SCRIPTS = custom
 
 PROTOTYPE_FILTER  = awk ' \
-	$$$$3 ~ /\/var\/opt\/csw\/named/ { $$$$5 = "named" ; $$$$2 = "ugfiles" } \
+	$$$$3 ~ /\/var\/opt\/csw\/named/ { $$$$2 = "ugfiles" ; $$$$5 = "named" ; $$$$6 = "named" } \
 	{ print }'
 
-INITSMF = .*/init.d/cswnamed
-SAMPLECONF = .*/named.conf.CSW
-USERGROUP = .*/CSWbind/cswusergroup
+INITSMF = /etc/opt/csw/init.d/cswnamed
+SAMPLECONF = /etc/opt/csw/named.conf /etc/opt/csw/CSWbind/bind
+USERGROUP = /etc/opt/csw/CSWbind/cswusergroup
 
 SPKG_SOURCEURL = http://www.isc.org/software/bind
 
 # Still needed because of ugfiles
 SPKG_CLASSES_CSWbind = none cswusergroup ugfiles cswcpsampleconf cswinitsmf
+SPKG_CLASSES_CSWbindchroot = none ugfiles
 
 include gar/category.mk
 
@@ -85,10 +86,11 @@
 install-custom:
 	@echo " ==> Installing $(GARNAME) (custom)"
 	@ginstall -m 755 -d $(DESTDIR)/etc/opt/csw/init.d
-	@cp $(FILEDIR)/CSWbind.cswnamed $(DESTDIR)/etc/opt/csw/init.d/cswnamed
-	@cp $(FILEDIR)/CSWbind.named.conf.CSW $(DESTDIR)/etc/opt/csw/named.conf.CSW
-	@ginstall -m 755 -d $(DESTDIR)/opt/csw/etc/CSWbind
-	@cp $(FILEDIR)/cswusergroup $(DESTDIR)/opt/csw/etc/CSWbind/
+	@ginstall -m 755 $(FILEDIR)/CSWbind.cswnamed $(DESTDIR)/etc/opt/csw/init.d/cswnamed
+	@ginstall -m 644 $(FILEDIR)/CSWbind.named.conf.CSW $(DESTDIR)/etc/opt/csw/named.conf
+	@ginstall -m 755 -d $(DESTDIR)/etc/opt/csw/CSWbind
+	@ginstall -m 444 $(FILEDIR)/cswusergroup $(DESTDIR)/etc/opt/csw/CSWbind/
+	@ginstall -m 644 $(FILEDIR)/bind.CSW $(DESTDIR)/etc/opt/csw/CSWbind/bind
 	@ginstall -m 755 -d $(DESTDIR)$(docdir)/$(GARNAME)
 	@$(foreach DOC,$(DOCLIST),cp $(FILEDIR)/$(DOC) $(DESTDIR)$(docdir)/$(GARNAME);)
 	( cd $(WORKSRC) ; \
@@ -96,26 +98,6 @@
 	@ginstall -m 755 -d $(DESTDIR)/var/opt/csw/named
 	@touch $(DESTDIR)/var/opt/csw/named/named.pid
 	@ginstall -m 755 -d $(DESTDIR)/var/opt/csw/named/chroot/dev
-	@ginstall -m 755 -d $(DESTDIR)/var/opt/csw/named/chroot/etc
+	@ginstall -m 755 -d $(DESTDIR)/var/opt/csw/named/chroot/etc/opt/csw
 	@ginstall -m 755 -d $(DESTDIR)/var/opt/csw/named/chroot/var/named
 	@$(MAKECOOKIE)
-
-# run bind chroot'ed:
-# (from CentOS 5.3)
-# /var/named/chroot
-# /var/named/chroot/dev
-# /var/named/chroot/dev/null
-# /var/named/chroot/dev/random
-# /var/named/chroot/dev/zero
-# /var/named/chroot/etc
-# /var/named/chroot/etc/named.caching-nameserver.conf
-# /var/named/chroot/etc/named.conf
-# /var/named/chroot/etc/rndc.conf
-# /var/named/chroot/var
-# /var/named/chroot/var/log/named.log
-# /var/named/chroot/var/named
-# /var/named/chroot/var/named/data
-# /var/named/chroot/var/named/slaves
-# /var/named/chroot/var/run
-# /var/named/chroot/var/run/named
-# /var/named/chroot/var/tmp

Modified: csw/mgar/pkg/bind/trunk/checksums
===================================================================
--- csw/mgar/pkg/bind/trunk/checksums	2009-11-30 00:52:31 UTC (rev 7507)
+++ csw/mgar/pkg/bind/trunk/checksums	2009-11-30 16:13:46 UTC (rev 7508)
@@ -1 +1,2 @@
+d6d238e2a0f583709f2d1076114cb0c5  CSWbindchroot.postinstall
 435bc2e26e470d46ddf2acb24abb6ea6  bind-9.6.1-P2.tar.gz


Property changes on: csw/mgar/pkg/bind/trunk/files
___________________________________________________________________
Modified: svn:ignore
   - CSWbindchroot.*

   + 


Modified: csw/mgar/pkg/bind/trunk/files/CSWbind.cswnamed
===================================================================
--- csw/mgar/pkg/bind/trunk/files/CSWbind.cswnamed	2009-11-30 00:52:31 UTC (rev 7507)
+++ csw/mgar/pkg/bind/trunk/files/CSWbind.cswnamed	2009-11-30 16:13:46 UTC (rev 7508)
@@ -4,13 +4,22 @@
 #RC_SLEV 2
 
 # rc-script for CSW Bind
-# Peter Bonivart, 2009-01-24
+# Peter Bonivart, 2009-11-30
 
 USER=named
 #OPTIONS="-d 1" # debug mode
 #OPTIONS="-c /opt/csw/etc/named.conf" # use old location of conf file
 OPTIONS="-u $USER"
 
+if [ -r /etc/opt/csw/pkg/CSWbind/bind && /bin/egrep -q '^ROOTDIR=' /etc/opt/csw/pkg/CSWbind/bind ]; then
+  :;
+else
+  echo ROOTDIR="/var/named/chroot" >> /etc/sysconfig/named;
+fi
+
+# Source config file
+[ -r /etc/opt/csw/pkg/CSWbind/bind ] && . /etc/opt/csw/pkg/CSWbind/bind
+
 ZONE= # used for initialization, do not change
 
 case "$1" in
@@ -18,7 +27,7 @@
     if [ -f /opt/csw/sbin/named -a -f /etc/opt/csw/named.conf ]; then
       echo 'Starting bind.'
       # ulimit -n 1024
-      /opt/csw/sbin/named $OPTIONS &
+      /opt/csw/sbin/named $OPTIONS $ROOTDIR &
     fi
     ;;
   stop)

Added: csw/mgar/pkg/bind/trunk/files/CSWbindchroot.postinstall
===================================================================
--- csw/mgar/pkg/bind/trunk/files/CSWbindchroot.postinstall	                        (rev 0)
+++ csw/mgar/pkg/bind/trunk/files/CSWbindchroot.postinstall	2009-11-30 16:13:46 UTC (rev 7508)
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+ROOTDIR=/var/opt/csw/named/chroot
+
+# Create devices
+DEVICELIST="null poll random zero"
+
+for i in $DEVICELIST
+do
+  DEV=`ls -l /dev/$i | awk '{print $11}'`
+  DEVICE=`ls -l /dev/$DEV`
+  MAJOR=`echo $DEVICE | awk '{print $5}' | awk -F',' '{print $1}'`
+  MINOR=`echo $DEVICE | awk '{print $6}'`
+  echo "Creating device $i ($MAJOR,$MINOR)"
+  mknod $ROOTDIR/dev/$i $MAJOR $MINOR
+done
+
+# Copy config from /etc/opt/csw
+cp /etc/opt/csw/named.conf $ROOTDIR/etc/opt/csw
+
+# Timezone info
+cp -p /etc/TIMEZONE $ROOTDIR/etc
+
+# change owner on all files/dirs under /var/opt/csw/named/chroot
+chown -R named:named $ROOTDIR
+
+# show info about svc
+echo
+echo "System prepared for chrooted BIND."
+echo
+echo "Move your zone files into $ROOTDIR/var/named"
+echo "and your rndc keys and so on into $ROOTDIR/etc/opt/csw."
+echo
+echo "The directory option in named.conf must be set to $ROOTDIR/var/named."

Added: csw/mgar/pkg/bind/trunk/files/bind.CSW
===================================================================
--- csw/mgar/pkg/bind/trunk/files/bind.CSW	                        (rev 0)
+++ csw/mgar/pkg/bind/trunk/files/bind.CSW	2009-11-30 16:13:46 UTC (rev 7508)
@@ -0,0 +1,8 @@
+# This is where you customize some settings of your BIND installation so
+# you don't have to edit the scripts themselves as they will be replaced during
+# upgrades.
+#
+# Peter Bonivart, OpenCSW
+
+# Chroot directory
+#ROOTDIR=/var/opt/csw/named/chroot


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