#!/bin/sh top_builddir="$1" abs_builddir="$2" srcdir="$3" bindir="$4" MAKE="$5" # The chmod is needed when copying from read-only sources (eg in distcheck) if [ -d testing ]; then chmod -R u+w testing/; fi rm -rf testing mkdir -p testing/${bindir} ln -s ./${bindir} testing/bin mkdir -p testing/usr if [ ! -d testing/usr/bin ]; then ln -s ../bin testing/usr/bin fi (cd ${top_builddir} && \ ${MAKE} DESTDIR=${abs_builddir}/testing install) cp -r ${srcdir}/data/ testing/ for d in dev etc magic tmp var; do if [ ! -d testing/${d} ]; then mkdir testing/${d} fi done for node in urandom stdin stderr stdout null full; do ln -s /dev/${node} testing/dev/${node} done for cf in hosts resolv.conf passwd group mtab ; do [ -f /etc/${cf} ] && cp /etc/${cf} testing/etc/${cf} done touch testing/etc/{shadow,gshadow} for prog in gzip cat cp patch tar sh bash ln chmod rm mkdir uname grep sed find file ionice mktemp nice cut sort diff touch install wc coreutils xargs mknod locale systemd-sysusers; do p=`which ${prog}` if [ "${p}" != "" ]; then ln -s ${p} testing/${bindir}/ fi done for d in /proc /sys /selinux /etc/selinux; do if [ -d ${d} ]; then ln -s ${d} testing/${d} fi done (cd testing/magic && cp /usr/share/misc/magic.mgc . || file -C)