From 89b7b67a13ebb7965cc7f13ad0595e2194a2d34c Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 15:48:04 +0200 Subject: add sqmail-4.2.29a --- package/compile | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100755 package/compile (limited to 'package/compile') diff --git a/package/compile b/package/compile new file mode 100755 index 0000000..b8aa789 --- /dev/null +++ b/package/compile @@ -0,0 +1,96 @@ +#!/bin/sh + +shout() { echo "$0: $@" >&2; } +barf() { shout "fatal: $@"; exit 111; } +safe() { "$@" || barf "cannot $@"; } + +safe umask 022 +[ -d package ] || barf "no package directory" +[ -d src ] || barf "no src directory" + +here=`env - PATH=$PATH pwd` + +[ -d compile ] || safe mkdir -p compile +[ -d commmand ] || safe mkdir -p command +[ -r compile/home ] || echo $here > compile/home +[ -h compile/src ] || safe ln -s $here/src compile/src + +for i in `ls src` +do + [ ! -d src/$i ] && [ -h compile/$i ] || safe ln -sf src/$i compile/$i +done + +for i in `sed -e '/^it-/!d' -e 's/^it-//' < compile/it=d` +do + all="$all $i" +done + +other="`grep -v '^it-' compile/it=d`" +usage() { shout "usage: package/compile [ [-]$all ]"; exit 100; } + +targets="" +if [ $# -eq 0 ] +then + targets="$all" +else + if [ "$1" = "-" ] + then + shift + suppress=":" + for i in ${1+"$@"} + do + case "$all " in + *\ $i\ *) + ;; + *) + usage + ;; + esac + suppress="$suppress$i:" + done + for i in $all + do + case "$suppress" in + *:$i:*) + ;; + *) + targets="$targets $i" + ;; + esac + done + else + for i in ${1+"$@"} + do + case "$all " in + *\ $i\ *) + ;; + *) + usage + ;; + esac + targets="$targets $i" + done + fi +fi + +[ "X$all" != "X" ] && [ "X$targets" = "X" ] && usage + +commands="" +for i in $targets +do + commands="$commands `cat package/commands-$i`" +done + +safe cd compile +safe make $other `echo "$targets" | sed -e 's/ / it-/g'` +safe cd $here + +for i in $commands +do + i=${i%:} + safe rm -f command/$i'{new}' + safe cp -p compile/$i command/$i'{new}' + safe mv -f command/$i'{new}' command/$i +done + +exit 0 -- cgit v1.2.3