Index: server/work/Makefile ================================================================== --- server/work/Makefile +++ server/work/Makefile @@ -2,14 +2,14 @@ tclpkgs-src-current.tar.gz: tclpkgs-src-current tar -zcf tclpkgs-src-current.tar.gz tclpkgs-src-current rm -rf tclpkgs-src-current -tclpkgs-src-current: platform build_all.sh */build.sh +tclpkgs-src-current: platform build_all.sh create_teapot */build.sh rm -rf tclpkgs-src-current mkdir tclpkgs-src-current - cp -rp platform build_all.sh tclpkgs-src-current/ + cp -rp platform build_all.sh create_teapot tclpkgs-src-current/ for dir in */; do \ if test ! -f "$$dir/build.sh"; then continue; fi; \ mkdir "tclpkgs-src-current/$$dir"; \ cp "$$dir/build.sh" "tclpkgs-src-current/$$dir"; \ done ADDED server/work/create_teapot Index: server/work/create_teapot ================================================================== --- /dev/null +++ server/work/create_teapot @@ -0,0 +1,84 @@ +#! /bin/bash + +OUTFILE="$1" +PKG="$2" +PKGVER="$3" +SRCURL="$4" +PLATFORM="$5" +REQS="$6" +DESC="$7" +TMPFILE="${TMPDIR:-/tmp}/reqfile-$$${RANDOM}${RANDOM}${RANDOM}" +export OUTFILE PKG PKGVER SRCURL PLATFORM REQS DESC TMPFILE + +VALIDSYNTAX=1 +if [ -z "${OUTFILE}" ]; then + echo 'ERROR: Output not specified' >&2 + VALIDSYNTAX=0 +fi +if [ -z "${PKG}" ]; then + echo 'ERROR: Package not specified' >&2 + VALIDSYNTAX=0 +fi +if [ -z "${PKGVER}" ]; then + echo 'ERROR: Package version not specified' >&2 + VALIDSYNTAX=0 +fi +if [ -z "${PLATFORM}" ]; then + echo 'ERROR: Platform not specified' >&2 + VALIDSYNTAX=0 +fi +if [ -z "${DESC}" ]; then + echo 'ERROR: Description not specified' >&2 + VALIDSYNTAX=0 +fi +if [ "${VALIDSYNTAX}" = "0" ]; then + echo 'Usage: create_teapot ' >&2 + exit 1 +fi + +OUTSHORT=$(echo "${OUTFILE}" | sed 's@^.*/@@') +TEXTFILE=0 +if [ "${OUTSHORT}" = "teapot.txt" ]; then + TEXTFILE=1 +fi +if [ ! -e "${OUTFILE}" ]; then + TEXTFILE=1 +fi + +rm -f "${TMPFILE}" +cat << __EOF__ > "${TMPFILE}" +Package ${PKG} ${PKGVER} +Meta platform ${PLATFORM} +Meta rsk::build::date $(date +%Y-%m-%d) +Meta description ${DESC} +__EOF__ +echo "${REQS}" | tr ',' "\n" | while read req; do + req="$(echo "${req}" | sed 's@^ *@@;s@ *$@@')" + if [ -z "${req}" ]; then + continue + fi + + if echo "${req}" | grep ' ' >/dev/null; then + req="{${req}}" + fi + + echo "Meta require ${req}" >> "${TMPFILE}" +done + +if [ "${TEXTFILE}" = "1" ]; then + cat "${TMPFILE}" > "${OUTFILE}" +else + ( + head -1 "${OUTFILE}" + echo '' + echo '# @@ Meta Begin' + sed 's@^@# @' "${TMPFILE}" + echo '# @@ Meta End' + echo '' + tail +2 "${OUTFILE}" + ) > "${OUTFILE}.new" + cat "${OUTFILE}.new" > "${OUTFILE}" + rm -f "${OUTFILE}.new" +fi + +rm -f "${TMPFILE}" Index: server/work/tls/build.sh ================================================================== --- server/work/tls/build.sh +++ server/work/tls/build.sh @@ -47,8 +47,10 @@ mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null cp "build/${BUILDDIR}/libtls1.6.so" "${PLATDIR}/" cp "build/${BUILDDIR}/pkgIndex.tcl" "${PLATDIR}/" cp "build/${BUILDDIR}/tls.tcl" "${PLATDIR}/" + + ../create_teapot "${PLATDIR}/teapot.txt" "tls" "${VERS}" "${SRCURL}" "${PLATFORM}" "Tcl 8.4" "SSL TLS Secure Sockets" ) || exit 1 exit 0