Started work on stage5
[hvlinux.git] / stage3 / cis-bind
index 23161c7..a29c4c5 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/sh
+set -o errexit
+
 # First argument of this script is the package name
 
 # Reading system configuration informations, functions and package versions.
@@ -6,53 +8,51 @@ source ../sysinfos
 source ../functions
 source ../packages-list
 
-CUR_DIR=$(pwd)
-
 # Applying patches (if any)
-apply_patches ${1} &&
+apply_patches ${1}
 
-hv_groupadd named &&
-hv_useradd -c BindOwner -g named -m -s /bin/false named &&
+hv_groupadd named
+hv_useradd -c BindOwner -g named -m -s /bin/false named
 
-cd ${LFS_TMP}/${1} &&
+cd ${LFS_TMP}/${1}
 ./configure \
     --prefix=/usr \
     --sysconfdir=/etc \
     --localstatedir=/var \
     --mandir=/usr/share/man \
     --enable-threads \
-    --with-libtool &&
+    --with-libtool
 # Use updated address for L.ROOT-SERVERS.NET.
-sed -i "s@198.32.64.12@199.7.83.42@" lib/dns/rootns.c &&
-make &&
-make install &&
+sed -i "s@198.32.64.12@199.7.83.42@" lib/dns/rootns.c
+make
+make install
 
 # Enable the execute bit to prevent a warning when using ldd to check library dependencies.
-chmod 755 /usr/lib/lib{bind9,isc{,cc,cfg},lwres,dns}.so.*.?.? &&
+chmod 755 /usr/lib/lib{bind9,isc{,cc,cfg},lwres,dns}.so.*.?.?
 
-cd doc &&
-install -d -m755 /usr/share/doc/${1}/{arm,draft,misc,rfc} &&
-install -m644 arm/*.html /usr/share/doc/${1}/arm &&
-install -m644 draft/*.txt /usr/share/doc/${1}/draft &&
-install -m644 rfc/* /usr/share/doc/${1}/rfc &&
+cd doc
+install -d -m755 /usr/share/doc/${1}/{arm,draft,misc,rfc}
+install -m644 arm/*.html /usr/share/doc/${1}/arm
+install -m644 draft/*.txt /usr/share/doc/${1}/draft
+install -m644 rfc/* /usr/share/doc/${1}/rfc
 install -m644 misc/{dnssec,ipv6,migrat*,options,rfc-compliance,roadmap,sdb} \
-    /usr/share/doc/${1}/misc &&
+    /usr/share/doc/${1}/misc
 
 # Generation of a key for use in the named.conf and rdnc.conf files using the rndc-confgen command.
-BINDKEY=$(rndc-confgen -b 512 | grep -m 1 "secret" | cut -d '"' -f 2) &&
+BINDKEY=$(rndc-confgen -b 512 | grep -m 1 "secret" | cut -d '"' -f 2)
 
-cd /home/named &&
-mkdir -p dev etc/namedb/{pz,slave} var/run &&
-rm -f /home/named/dev/null &&
-mknod /home/named/dev/null c 1 3 &&
-rm -f /home/named/dev/random &&
-mknod /home/named/dev/random c 1 8 &&
-chmod 666 /home/named/dev/{null,random} &&
-cp /etc/localtime /home/named/etc &&
+cd /home/named
+mkdir -p dev etc/namedb/{pz,slave} var/run
+rm -f /home/named/dev/null
+mknod /home/named/dev/null c 1 3
+rm -f /home/named/dev/random
+mknod /home/named/dev/random c 1 8
+chmod 666 /home/named/dev/{null,random}
+cp /etc/localtime /home/named/etc
 
 # Creating the named.conf file from which named will read the location of zone files,
 # root name servers and secure DNS keys.
-cat > /home/named/etc/named.conf << "EOF" &&
+cat > /home/named/etc/named.conf << "EOF"
  options {
      directory "/etc/namedb";
     pid-file "/var/run/named.pid";
@@ -112,9 +112,9 @@ logging {
   };
 };
 EOF
-sed -i -e "s!_BIND_KEY_!${BINDKEY}!g" /home/named/etc/named.conf &&
+sed -i -e "s!_BIND_KEY_!${BINDKEY}!g" /home/named/etc/named.conf
 
-cat > /etc/rndc.conf << "EOF" &&
+cat > /etc/rndc.conf << "EOF"
 key rndc_key {
 algorithm "hmac-md5";
     secret
@@ -125,9 +125,9 @@ options {
     default-key    rndc_key;
 };
 EOF
-sed -i -e "s!_BIND_KEY_!${BINDKEY}!g" /etc/rndc.conf &&
+sed -i -e "s!_BIND_KEY_!${BINDKEY}!g" /etc/rndc.conf
 
-cat > /home/named/etc/namedb/pz/127.0.0 << "EOF" &&
+cat > /home/named/etc/namedb/pz/127.0.0 << "EOF"
 $TTL 3D
 @      IN      SOA     ns.local.domain. hostmaster.local.domain. (
                         1       ; Serial
@@ -139,7 +139,7 @@ $TTL 3D
 1               PTR     localhost.
 EOF
 
-cat > /home/named/etc/namedb/root.hints << "EOF" &&
+cat > /home/named/etc/namedb/root.hints << "EOF"
 .                       6D  IN      NS      A.ROOT-SERVERS.NET.
 .                       6D  IN      NS      B.ROOT-SERVERS.NET.
 .                       6D  IN      NS      C.ROOT-SERVERS.NET.
@@ -168,13 +168,12 @@ L.ROOT-SERVERS.NET.     6D  IN      A       198.32.64.12
 M.ROOT-SERVERS.NET.     6D  IN      A       202.12.27.33
 EOF
 
-chown -R named.named /home/named &&
+chown -R named.named /home/named
 
 # Bootscript
-install -v -m740 ${CUR_DIR}/bootscripts/named /etc/rc.d/init.d &&
+install -v -m740 ${SCRDIR}/bootscripts/named /etc/rc.d/init.d
 
 # script-name start stop
 bootscript_add_rc3 named 25 65
 
-# Return last error
 exit $?