steffen: server obmtool, 1.7, 1.7.2.1 obmtool.conf, 1.174.2.20, 1.174.2.21
cvs at intevation.de
cvs at intevation.de
Mon Dec 19 21:20:29 CET 2005
Author: steffen
Update of /kolabrepository/server
In directory doto:/tmp/cvs-serv6259
Modified Files:
Tag: kolab_2_0_branch
obmtool obmtool.conf
Log Message:
updated kolab 2.0 to current state of things...
Index: obmtool
===================================================================
RCS file: /kolabrepository/server/obmtool,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -d -r1.7 -r1.7.2.1
--- obmtool 9 Mar 2005 13:59:16 -0000 1.7
+++ obmtool 19 Dec 2005 20:20:27 -0000 1.7.2.1
@@ -3,7 +3,7 @@
## obmtool -- OpenPKG poor man's Boot, Build & Management Tool
## based on Ralf S. Engelschall's "devtool -- Development Tool"
## Copyright (c) 2003 Thomas Lotterer <thomas at lotterer.net>
-## Id: obmtool,v 1.42 2005/03/08 09:31:12 thl cvs.ZfOS.org
+## Id: obmtool,v 1.47 2005/11/30 21:19:58 thl cvs.ZfOS.org
## $Id$
##
@@ -11,7 +11,7 @@
prg="$0"
silent=0; verbose=0; debug=0; help=0
query=0; force=0
-conf=""; logs=""; tmpdir=""
+conf=""; logs=""; tmpdir=""; mirror=""; dltools=""; username=""; password=""
tmpfile=""; cmd=""; cmdargs=""
# iterate over argument line
@@ -26,7 +26,7 @@
case $opt in
-s|--silent ) silent=${num} ;;
-v|--verbose ) verbose=${num} ;;
- -d|--debug ) debug=${num} ;;
+ -D|--debug ) debug=${num} ;;
-h|--help ) help="USAGE" ;;
-q|--query ) query=${num} ;;
-f|--force ) force=${num} ;;
@@ -54,6 +54,38 @@
else
tmpdir="${arg}"
fi ;;
+ -m|--mirror ) if [ ".${arg}" = . ]; then
+ if [ ".$2" != . ]; then
+ shift 2>/dev/null
+ mirror="$1"
+ fi
+ else
+ mirror="${arg}"
+ fi ;;
+ -d|--dltools ) if [ ".${arg}" = . ]; then
+ if [ ".$2" != . ]; then
+ shift 2>/dev/null
+ dltools="$1"
+ fi
+ else
+ dltools="${arg}"
+ fi ;;
+ -u|--user ) if [ ".${arg}" = . ]; then
+ if [ ".$2" != . ]; then
+ shift 2>/dev/null
+ username="$1"
+ fi
+ else
+ username="${arg}"
+ fi ;;
+ -p|--pass ) if [ ".${arg}" = . ]; then
+ if [ ".$2" != . ]; then
+ shift 2>/dev/null
+ password="$1"
+ fi
+ else
+ password="${arg}"
+ fi ;;
-* ) help="ERROR" ;;
* ) break;
esac
@@ -69,9 +101,10 @@
# display error or usage message
if [ ".$help" != .0 ]; then
- echo "obmtool:$help: obmtool [-s|--silent] [-v|--verbose] [-d|--debug] [-h|--help]" 1>&2
+ echo "obmtool:$help: obmtool [-s|--silent] [-v|--verbose] [-D|--debug] [-h|--help]" 1>&2
echo " [-q|--query] [-f|--force]" 1>&2
echo " [-c|--conf <file>] [-l|--logs <dir>] [-t|--tmpdir <dir>]" 1>&2
+ echo " [-m|--mirror <url>] [-d|dltools <tool>[:<tool>...]] [-u|--user <user>] [-p|--pass <pass>]" 1>&2
echo " <cmd> [<arg> ...]" 1>&2
if [ ".$help" = "USAGE" ]; then
exit 0
@@ -92,7 +125,7 @@
echo "DEBUG: main: prg=\"$prg\"";
echo "DEBUG: main: silent=\"$silent\" verbose=\"$verbose\" debug=\"$debug\" help=\"$help\"";
echo "DEBUG: main: query=\"$query\" force=\"$force\"";
- echo "DEBUG: main: conf=\"$conf\" logs=\"$logs\" tmpdir=\"$tmpdir\"";
+ echo "DEBUG: main: conf=\"$conf\" logs=\"$logs\" tmpdir=\"$tmpdir\" mirror=\"$mirror\" dltools=\"$dltools\" username=\"$username\" password=\"$password\"";
echo "DEBUG: main: cmd=\"$cmd\" cmdargs=\"$cmdargs\"";
fi
@@ -130,9 +163,10 @@
export query force
export conf logs tmpdir
export tmpfile cmd cmdargs
+export mirror dltools username password
sh $tmpfile
rc=$?
-rm -f $tmpfile
+[ $rc -eq 0 ] && rm -f $tmpfile
exit $rc
## obmtool.func { # is now embedded. This line used as cutting point. Do not remove.
@@ -209,6 +243,8 @@
shift
@archostag "$@"
+ download="${mirror:-${MIRROR:-ftp://ftp.openpkg.org}}"
+
# packages in CWD
echo "${PKG}" | ${EGREP} >/dev/null '^\.\/'
if [ $? -eq 0 ]; then
@@ -242,28 +278,28 @@
# CURRENT
echo ${PKG} | ${EGREP} >/dev/null -- '-[2-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$'
if [ $? -eq 0 ]; then
- LOC="ftp://ftp.openpkg.org/current/SRC"
+ LOC="$download/current/SRC"
return
fi
# STABLE
echo ${PKG} | ${EGREP} >/dev/null -- '-[0-9][0-9]*\.[2-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$'
if [ $? -eq 0 ]; then
- LOC="ftp://ftp.openpkg.org/stable/SRC"
+ LOC="$download/stable/SRC"
return
fi
# RELEASE (including PLUS)
echo ${PKG} | ${EGREP} >/dev/null -- '-[1-9][0-9]*\.[0-9][0-9]*\.0$'
if [ $? -eq 0 ]; then
- LOC="`echo ${PKG} | sed -e 's;^.*-\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9][0-9]*$;ftp://ftp.openpkg.org/release/\1.\2/SRC;'`$ADD"
+ LOC="`echo ${PKG} | sed -e 's;^.*-\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9][0-9]*$;'$download'/release/\1.\2/SRC;'`$ADD"
return
fi
# UPDATE (for CORE and BASE)
echo ${PKG} | ${EGREP} >/dev/null -- '-[1-9][0-9]*\.[0-9][0-9]*\.[1-9][0-9]*$'
if [ $? -eq 0 ]; then
- LOC="`echo ${PKG} | sed -e 's;^.*-\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9][0-9]*$;ftp://ftp.openpkg.org/release/\1.\2/UPD;'`"
+ LOC="`echo ${PKG} | sed -e 's;^.*-\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9][0-9]*$;'$download'/release/\1.\2/UPD;'`"
return
fi
@@ -398,16 +434,48 @@
#fetch a RPM (or .sh)
@fetch ()
{
+ [ ".${debug}" = .1 ] && echo "DEBUG: fetch: requested that $1 is downloaded to $2"
echo "$1 $2" | egrep '\*' >/dev/null && return 1 # short circuit for unsupported wildcards
url=`echo "$1" | sed -e 's;^\./;file://././;'` # revamp file:// URI to look like an URL
dst=`echo "$2" | sed -e 's;/$;;'`
+ # determine whether URL rewriting is active
+ if [ ".${MPX}" != . ]; then
+ rewrite=1
+ echo "$url" | ${EGREP} >/dev/null '^file://' && rewrite=0
+ ${MPX} register --printstatus >/dev/null 2>&1 || rewrite=0
+ if [ $rewrite -eq 1 ]; then
+ url=`${MPX} register --rewriteurls "$url"`
+ fi
+ fi
+
prot=`echo $url | sed -e 's;^\([^:]*\)://\([^/]*\)/\(.*\)/\([^/]*\)$;\1;'`
- host=`echo $url | sed -e 's;^\([^:]*\)://\([^/]*\)/\(.*\)/\([^/]*\)$;\2;'`
+ upah=`echo $url | sed -e 's;^\([^:]*\)://\([^/]*\)/\(.*\)/\([^/]*\)$;\2;'`
dire=`echo $url | sed -e 's;^\([^:]*\)://\([^/]*\)/\(.*\)/\([^/]*\)$;\3;'`
file=`echo $url | sed -e 's;^\([^:]*\)://\([^/]*\)/\(.*\)/\([^/]*\)$;\4;'`
- [ ".${debug}" = .1 ] && echo "DEBUG: fetch: url=$url prot=$prot host=$host dire=$dire file=$file"
+
+ typ=1
+ echo "$upah" | ${EGREP} >/dev/null '@' && typ=2
+ echo "$upah" | ${EGREP} >/dev/null ':.*@' && typ=3
+ case $typ in
+ 3) user=`echo $upah | sed -e 's;^\([^:]*\):\([^@]*\)@\(.*\)$;\1;'`
+ pass=`echo $upah | sed -e 's;^\([^:]*\):\([^@]*\)@\(.*\)$;\2;'`
+ host=`echo $upah | sed -e 's;^\([^:]*\):\([^@]*\)@\(.*\)$;\3;'`
+ ;;
+ 2) user=`echo $upah | sed -e 's;^\([^@*]\)@\(.*\)$;\1;'`
+ pass="${username:-${USERNAME}}_obmtool"
+ host=`echo $upah | sed -e 's;^\([^@*]\)@\(.*\)$;\2;'`
+ ;;
+ 1) user="anonymous"
+ pass="${username:-${USERNAME}}_obmtool"
+ host="$upah"
+ ;;
+ esac
+ [ ".$user" = . ] && user="$username"; unoa=`echo $user | sed -e 's;@;%40;g'`
+ [ ".$pass" = . ] && pass="$password"; pnoa=`echo $pass | sed -e 's;@;%40;g'`
+ url="$prot://$unoa:$pnoa@$host/$dire/$file"
+ [ ".${debug}" = .1 ] && echo "DEBUG: fetch: url=$url prot=$prot user=$user unoa=$unoa pass=$pass pnoa=$pnoa host=$host dire=$dire file=$file"
[ ".${debug}" = .1 ] && echo "DEBUG: fetch: checking whether \"$dst/$file\" already present"
[ -f "$dst/$file" ] && return 0
@@ -421,101 +489,54 @@
[ $? -eq 0 -a -f "$dst/$file" ] && return 0
return 1
else
- TOOL="$PREFIX/lib/openpkg/curl"
- if [ -x "$TOOL" ]; then
- [ ".${debug}" = .1 ] && echo "DEBUG: fetch: trying \"$TOOL\""
- (
- cd $dst || exit 1
- $TOOL -o $file $url
- )
- [ -f "$dst/$file" ] && return 0
- fi
-
- @findtool curl
- if [ -x "$TOOL" ]; then
- [ ".${debug}" = .1 ] && echo "DEBUG: fetch: trying \"$TOOL\""
- (
- cd $dst || exit 1
- $TOOL -o $file $url
- )
- [ -f "$dst/$file" ] && return 0
- fi
-
- @findtool wget
- if [ -x "$TOOL" ]; then
- [ ".${debug}" = .1 ] && echo "DEBUG: fetch: trying \"$TOOL\""
- (
- cd $dst || exit 1
- $TOOL $url
- )
- [ -f "$dst/$file" ] && return 0
- fi
-
- @findtool lftp
- if [ -x "$TOOL" ]; then
- [ ".${debug}" = .1 ] && echo "DEBUG: fetch: trying \"$TOOL\""
- (
- cd $dst || exit 1
- ( echo "cd $dire"; echo "get $file" ) | $TOOL $host
- )
- [ -f "$dst/$file" ] && return 0
- fi
-
- @findtool ftp
- if [ -x "$TOOL" ]; then
- [ ".${debug}" = .1 ] && echo "DEBUG: fetch: trying \"$TOOL\""
- (
- cd $dst || exit 1
- $TOOL -? </dev/null 2>&1 | grep ftp:// >/dev/null
- if [ $? -eq 0 ]; then
- $TOOL -n $url
- else
- ( echo "user anonymous ftp"; echo "cd $dire"; echo "bin"; echo "get $file" ) | ftp -n $host
- fi
- )
- [ -f "$dst/$file" ] && return 0
- fi
-
- @findtool lynx
- if [ -x "$TOOL" ]; then
- [ ".${debug}" = .1 ] && echo "DEBUG: fetch: trying \"$TOOL\""
- (
- cd $dst || exit 1
- $TOOL --source $url >$file
- )
- [ -f "$dst/$file" ] && return 0
- fi
-
- @findtool w3m
- if [ -x "$TOOL" ]; then
- [ ".${debug}" = .1 ] && echo "DEBUG: fetch: trying \"$TOOL\""
- (
- cd $dst || exit 1
- $TOOL -no-proxy -dump_source $url >$file
- )
- [ -f "$dst/$file" ] && return 0
- fi
-
- @findtool ncftpget
- if [ -x "$TOOL" ]; then
- [ ".${debug}" = .1 ] && echo "DEBUG: fetch: trying \"$TOOL\""
- (
- cd $dst || exit 1
- $TOOL $url
- )
- [ -f "$dst/$file" ] && return 0
- fi
-
- @findtool ncftp
- if [ -x "$TOOL" ]; then
- [ ".${debug}" = .1 ] && echo "DEBUG: fetch: trying \"$TOOL\""
- (
- cd $dst || exit 1
- ( echo "cd $dire"; echo "bin"; echo "get $file" ) | $TOOL $host
- )
- [ -f "$dst/$file" ] && return 0
- fi
+ remainder=`echo ${dltools:-${DLTOOLS:-openpkg:curl:wget:lftp:ftp:lynx:w3m:ncftpget:ncftp}} | sed -e 's;:; ;g'`
+ for tool in $remainder; do
+ if [ ".$tool" = .openpkg ]; then
+ TOOL="$PREFIX/lib/openpkg/curl"
+ else
+ @findtool $tool
+ fi
+ if [ -x "$TOOL" ]; then
+ [ ".${debug}" = .1 ] && echo "DEBUG: fetch: trying $tool -> \"$TOOL\""
+ case $tool in
+ openpkg) ( cd $dst || exit 1
+ $TOOL -o $file $url
+ ) ;;
+ curl) ( cd $dst || exit 1
+ $TOOL -o $file $url
+ ) ;;
+ wget) ( cd $dst || exit 1
+ $TOOL $url
+ ) ;;
+ lftp) ( cd $dst || exit 1
+ ( echo "cd $dire"; echo "get $file" ) | $TOOL -u $user,$pass $host
+ ) ;;
+ ftp) ( cd $dst || exit 1
+ $TOOL -? </dev/null 2>&1 | grep ftp:// >/dev/null
+ if [ $? -eq 0 ]; then
+ $TOOL -n $url
+ else
+ ( echo "user $user $pass"; echo "cd $dire"; echo "bin"; echo "get $file" ) | ftp -n $host
+ fi
+ ) ;;
+ lynx) ( cd $dst || exit 1
+ $TOOL --source $url >$file
+ ) ;;
+ w3m) ( cd $dst || exit 1
+ $TOOL -no-proxy -dump_source -pauth "$unoa:$pnoa" "$prot://$host/$dire/$file" >$file
+ ) ;;
+ ncftpget) ( cd $dst || exit 1
+ $TOOL $url
+ ) ;;
+ ncftp) ( cd $dst || exit 1
+ ( echo "cd $dire"; echo "bin"; echo "get $file" ) | $TOOL -u $user -p $pass $host
+ ) ;;
+ esac
+ fi
+ [ -s "$dst/$file" ] && return 0
+ done
fi
+ rm "$dst/$file"
return 1
}
@@ -788,9 +809,12 @@
missing=""
for feature in "$@"; do
case $feature in
- TAGFMT) ;;
- USE) ;;
- DEFINE) ;;
+ TAGFMT) ;;
+ USE) ;;
+ DEFINE) ;;
+ MIRROR) ;;
+ DLTOOLS) ;;
+ REGISTRY) ;;
*) missing="$missing $feature";;
esac
done
Index: obmtool.conf
===================================================================
RCS file: /kolabrepository/server/obmtool.conf,v
retrieving revision 1.174.2.20
retrieving revision 1.174.2.21
diff -u -d -r1.174.2.20 -r1.174.2.21
--- obmtool.conf 7 Nov 2005 17:34:57 -0000 1.174.2.20
+++ obmtool.conf 19 Dec 2005 20:20:27 -0000 1.174.2.21
@@ -9,13 +9,25 @@
##
%common
- @hasfeature TAGFMT || exit # require obmtool to support TAGFMT
+ @hasfeature TAGFMT USE DEFINE MIRROR DLTOOLS REGISTRY || exit 1
TMPDIR=/var/tmp # large tmp with 300MB space
URL="ftp://ftp.klaralvdalens-datakonsult.se/pub/kolab/server/current/2.0" # used for non-ftp://ftp.openpkg.org/ packages
-
+ USERNAME=""
+ for opt in $cmdargs ; do
+ arg=`echo "${opt}" | sed -e 's;^[^=]*=*;;'`
+ opt=`echo "${opt}" | sed -e 's;=.*$;;'`
+ case $opt in
+ -u|--user) USERNAME="$arg";;
+ --url) URL="$arg";;
+ esac
+ done
+ if test -z "$USERNAME" ; then
+ echo "OpenPKG requires a username for registration. Please supply one with the --user=<username> option at the end of the commandline."
+ exit 1
+ fi
%kolab
echo "---- boot/build ${NODE} %${CMD} ----"
- kolab_version="pre-2.0.1-snapshot-20051003";
+ kolab_version="pre-2.0.2-snapshot-20051219";
PREFIX=/${CMD};
loc='' # '' (empty) for ftp.openpkg.org, '=' for URL, './' for CWD or absolute path
plusloc='+'
@@ -32,18 +44,23 @@
fi
# start from scratch or upgrade within 2.0.x
- @install ${loc}openpkg-2.4.2-2.4.2 \
+ @install ${loc}openpkg-2.5.0-2.5.0 \
--tag="kolab" \
--prefix="${PREFIX}" \
--user="${CMD}" --group="${CMD}" \
--muid="19414" --ruid="19415" --nuid="19416" \
--mgid="19414" --rgid="19415" --ngid="19416"
+
+ @install openpkg-registry-0.2.5-20051129
+ $PREFIX/bin/openpkg register --mode=post --user=$USERNAME
+ $PREFIX/bin/openpkg register --printstatus && echo "Please associate the instance now. Then RETURN to continue." && read DUMMY
+
@install ${loc}make-3.80-2.4.0
@install ${loc}binutils-2.16.1-2.4.0
@install ${loc}gcc-3.4.4-2.4.0
@install ${loc}fsl-1.6.0-2.4.1
@install ${loc}mm-1.3.1-2.4.0
- @install ${loc}perl-5.8.7-2.4.0
+ @install ${loc}perl-5.8.7-2.4.1
@install ${loc}perl-openpkg-5.8.7-2.4.0
@install ${loc}perl-conv-5.8.7-2.4.0
@install ${loc}lzo-2.00-2.4.0 # PENDING(steffen) Check if we need lzop-1.0
@@ -100,7 +117,7 @@
@install ${loc}sed-4.1.4-2.4.0
@install ${loc}libxml-2.6.19-2.4.0
@install ${loc}libxslt-1.1.14-2.4.0 # WARNING: Remove libgcrypt before building!
- @install ${altloc}apache-1.3.33-2.4.1_kolab \
+ @install ${altloc}apache-1.3.33-2.4.4_kolab \
--with=mod_auth_ldap \
--with=mod_dav \
--with=mod_php \
@@ -113,7 +130,7 @@
--with=mod_php_dom \
--with=mod_ssl \
--with=mod_php_mbstring
- @install ${altloc}php-4.3.11-2.4.0_kolab \
+ @install ${altloc}php-4.3.11-2.4.2_kolab \
--with=zlib \
--with=gdbm \
--with=gettext \
@@ -129,13 +146,13 @@
@install ${loc}spamassassin-3.0.3-2.4.1
@install ${plusloc}amavisd-2.3.1-2.4.0
@install ${loc}curl-7.14.0-2.4.0
- @install ${altloc}clamav-0.87.1-20051104
+ @install ${altloc}clamav-0.87.1-20051123
@install ${loc}vim-6.3.78-2.4.0
@install ${plusloc}dcron-2.9-2.4.0
- @install ${altloc}perl-kolab-5.8.7-2.0_20050918
- @install ${altloc}kolabd-1.9.4-20051003 --define kolab_version=$kolab_version
- @install ${altloc}kolab-webadmin-0.4.0-20051003 --define kolab_version=$kolab_version
- @install ${altloc}kolab-resource-handlers-0.3.9-20051003 --define kolab_version=$kolab_version
+ @install ${altloc}perl-kolab-5.8.7-2.0_20051219
+ @install ${altloc}kolabd-1.9.4-20051219 --define kolab_version=$kolab_version
+ @install ${altloc}kolab-webadmin-0.4.0-20051219 --define kolab_version=$kolab_version
+ @install ${altloc}kolab-resource-handlers-0.3.9-20051219 --define kolab_version=$kolab_version
@check
if test ! -e "/usr/bin/kolab" ; then
@@ -152,6 +169,8 @@
echo "PRG = \"$PRG\""
echo "CMD = \"$CMD\""
echo "URL = \"$URL\""
+ echo "MIRROR = \"$MIRROR\""
+ echo "USERNAME = \"$USERNAME\""
echo "TRACK = \"$TRACK\""
echo "EGREP = \"$EGREP\""
echo "CHECKONLY = \"$CHECKONLY\""
More information about the commits
mailing list