summaryrefslogtreecommitdiff
path: root/network/netqmail/tests
diff options
context:
space:
mode:
authorDuncan Roe <duncan_roe@optusnet.com.au>2017-06-22 17:26:08 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-06-24 08:32:21 +0700
commit888ec031aca7e4f81a72497f9ebc0259e07621cb (patch)
tree0fcfcba8c18643f6a6111d70b341326312acc27e /network/netqmail/tests
parenta8e78c52c72b342c5436f5ff39148a3f2e68f7ee (diff)
downloadslackbuilds-888ec031aca7e4f81a72497f9ebc0259e07621cb.tar.gz
network/netqmail: Added (the qmail MTA).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/netqmail/tests')
-rw-r--r--network/netqmail/tests/README31
-rw-r--r--network/netqmail/tests/makechroot74
2 files changed, 105 insertions, 0 deletions
diff --git a/network/netqmail/tests/README b/network/netqmail/tests/README
new file mode 100644
index 0000000000..02b5e5286f
--- /dev/null
+++ b/network/netqmail/tests/README
@@ -0,0 +1,31 @@
+makechroot
+
+Make a chroot-able tree in which to run installpkg or explodepkg netqmail (i.e.
+from an interactive instance of chroot).
+Can also test installpkg --root to this tree.
+
+Whatever you do, you can step through the script commands in a root window.
+After explodepkg, you can step through the install scripts.
+
+See ../README.SBo for mkchroot caveats. Approximate disk usage: 1.5MB local
+$CHROOT, 131MB mounted $CHROOT.
+
+Set CHROOT to dir to buid (will be removed & re-created) (default is /tmp/t5).
+Set PKGDIR to directory containing SBo packages (default is /usr/packages).
+Set STRIP_INITTAB_SV=no to leave the SV line added by daemontools (dflt yes).
+Set INSTALL_DAEMONTOOLS=yes to install daemontools (default is no).
+Set STRIP_QMAIL_USERS_GROUPS=no to retain qmail users and groups (dflt yes).
+Set VERBOSE_ADDCHROOT=false to suppress install progress reporting (dflt true).
+Set MKCHROOT_IGNORE_LN_ERRORS=yes to suppress error messages from mounted chroot
+
+If you specified INSTALL_DAEMONTOOLS=yes, you can try running inst_check from an
+interactive chroot instance (qmail installation checker).
+inst_check will tell you to mount /proc - be sure to umount it afterwards.
+*if* the main system is running svscanboot, *and* the main system is not running
+an MTA, on re-running inst_check you should see
+
+ Congratulations, your LWQ installation looks good!
+
+Otherwise you should see a self-explanatory error message. If the main system is
+not runninmg svscanboot, you can start it in the chroot environment.
+Remember to umount /proc before exitting chroot.
diff --git a/network/netqmail/tests/makechroot b/network/netqmail/tests/makechroot
new file mode 100644
index 0000000000..06435ef2d3
--- /dev/null
+++ b/network/netqmail/tests/makechroot
@@ -0,0 +1,74 @@
+#!/bin/sh
+#set -x
+
+# A function to make a file local (not hard-linked to the real file)
+# One should run this on any file that the test might modify
+make_local()
+{
+ while [ $# -gt 0 ]
+ do
+ cp -a $CHROOT/$1 $CHROOT/$1.new
+ mv $CHROOT/$1.new $CHROOT/$1
+ shift
+ done
+}
+
+CHROOT=${CHROOT:-/tmp/t5}
+VERBOSE_ADDCHROOT=${VERBOSE_ADDCHROOT:-true}
+export VERBOSE_ADDCHROOT
+PKGDIR=${PKGDIR:-/usr/packages}
+[ -n "$MKCHROOT_IGNORE_LN_ERRORS" ] && LNE='2>/dev/null' || LNE=
+
+# These are options
+INSTALL_DAEMONTOOLS=${INSTALL_DAEMONTOOLS:-no}
+STRIP_INITTAB_SV=${STRIP_INITTAB_SV:-yes}
+STRIP_QMAIL_USERS_GROUPS=${STRIP_QMAIL_USERS_GROUPS:-yes}
+
+[ ! -d $CHROOT/proc/1 ] || umount $CHROOT/proc
+rm -rf $CHROOT
+mkchroot $CHROOT
+addchroot $CHROOT tar pkgtools
+mkdir -p $CHROOT$PKGDIR
+eval ln $PKGDIR/netqmail* $PKGDIR/daemontools* $CHROOT$PKGDIR $LNE \|\| \
+ cp -a $PKGDIR/netqmail* $PKGDIR/daemontools* $CHROOT$PKGDIR
+addchroot $CHROOT ucspi-tcp mkchroot
+
+# Set up Slackware install DB for mkchroot
+for i in packages scripts
+do
+ mkdir $CHROOT/var/log/$i
+ (cd /var/log/$i; ls -1 | while read j; do [ -d $j ] ||
+ eval ln $j $CHROOT/var/log/$i $LNE \|\| cp -a $j $CHROOT/var/log/$i; done)
+done
+
+addchroot $CHROOT etc
+make_local etc/{group,gshadow,passwd,shadow}
+addchroot $CHROOT sysvinit
+addchroot $CHROOT sysvinit-scripts
+make_local etc/inittab
+[ $STRIP_INITTAB_SV != yes ] ||
+{
+ cat $CHROOT/etc/inittab | grep -E -v '^SV:' >$CHROOT/etc/inittab.new
+ mv $CHROOT/etc/inittab.new $CHROOT/etc/inittab
+}
+addchroot $CHROOT sed util-linux gzip network-scripts shadow ncurses
+mkdir $CHROOT/root $CHROOT/proc
+[ $INSTALL_DAEMONTOOLS = no ] || addchroot $CHROOT daemontools
+
+[ $STRIP_QMAIL_USERS_GROUPS != yes ] ||
+{
+ mount -tproc proc $CHROOT/proc
+
+ for i in alias qmail{d,l,p,q,r,s}
+ do
+ grep -q ^$i: $CHROOT/etc/passwd && chroot $CHROOT userdel $i
+ done
+ for i in nofiles qmail
+ do
+ grep -q ^$i: $CHROOT/etc/group && chroot $CHROOT groupdel $i
+ done
+ umount $CHROOT/proc
+}
+
+# inst_check needs these
+addchroot $CHROOT procps-ng gawk net-tools