aboutsummaryrefslogtreecommitdiff
path: root/buildtools/build-freebsd-rp-port.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-01-09 16:59:08 +0000
committerRob Austein <sra@hactrn.net>2013-01-09 16:59:08 +0000
commit9d92820a291293378e4899397ea5e234b8603224 (patch)
tree67b78a81687cfca8901012f69c19359a9c32c766 /buildtools/build-freebsd-rp-port.py
parent5d67c32912c62015cf99201eafec67c5c00719ad (diff)
More fun with pkg-install.
svn path=/branches/tk377/; revision=4962
Diffstat (limited to 'buildtools/build-freebsd-rp-port.py')
-rw-r--r--buildtools/build-freebsd-rp-port.py41
1 files changed, 32 insertions, 9 deletions
diff --git a/buildtools/build-freebsd-rp-port.py b/buildtools/build-freebsd-rp-port.py
index e63ff52a..b70dd17f 100644
--- a/buildtools/build-freebsd-rp-port.py
+++ b/buildtools/build-freebsd-rp-port.py
@@ -53,11 +53,11 @@ name = stripext(name, ".tar", ".tgz", ".tbz", ".txz")
# tarballs.
try:
- base, trunk, vers = name.split("-")
+ base, branch, vers = name.split("-")
except:
- base, trunk, vers = None
+ base, branch, vers = None
-if trunk != "trunk" or not vers.isdigit():
+if branch not in ("trunk", "tk377") or not vers.isdigit():
sys.exit("Unexpected tarball URL name format")
base += "-rp"
@@ -94,7 +94,7 @@ RUN_DEPENDS+= rrdtool>0:${PORTSDIR}/databases/rrdtool
# Just want relying party tools, and have to whack rcynic jail
# location to something acceptable to FreeBSD package system.
-CONIGURE_ARGS= --disable-ca-tools --with-rcynic-jail=/usr/local/var/rcynic
+CONFIGURE_ARGS= --disable-ca-tools --with-rcynic-jail=/usr/local/var/rcynic
# This is not necessary at the moment because "make install" does
# all the same things. This is here as a reminder in case that changes.
@@ -218,12 +218,35 @@ else
exit 1
fi
-echo "Running /usr/local/etc/rc.d/rcynic to set up directories"
+echo "Setting up jail directories"
+
+/usr/sbin/mtree -deU -p "$jaildir" <<EOF
+
+ /set type=dir uname=root gname=wheel mode=0555
+ .
+ bin
+ ..
+ dev
+ ..
+ etc
+ trust-anchors
+ ..
+ ..
+ var
+ run
+ ..
+ ..
+ data uname=$jailuser gname=$jailgroup mode=0755
+ ..
+ ..
+EOF
-if ! rcynic_jaildir="$jaildir" rcynic_user="$jailuser" rcynic_group="$jailgroup" /bin/sh /usr/local/etc/rc.d/rcynic start; then
- echo "Directory setup failed"
- exit 1
-fi
+for i in /etc/localtime /etc/resolv.conf; do
+ j="${jaildir}${i}"
+ if /bin/test -r "$i" && ! /usr/bin/cmp -s "$i" "$j"; then
+ /usr/bin/install -m 444 -o root -g wheel -p "$i" "$j"
+ fi
+done
if /usr/bin/install -m 444 -o root -g wheel -p ../sample-rcynic.conf "${jaildir}/etc/rcynic.conf.sample"; then
echo "Installed minimal ${jaildir}/etc/rcynic.conf.sample, adding SAMPLE trust anchors"