Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -1,8 +1,12 @@ client/teapot-client.kit client/teapot-client.kit/* +server/work/tclpkgs-*.tar.* +server/work/tclpkgs-*.tar.*/* server/work/tls/build +server/work/tls/build.log +server/work/tls/build.log/* server/work/tls/build/* server/work/tls/out server/work/tls/out/* server/work/tls/src server/work/tls/src/* ADDED server/work/Makefile Index: server/work/Makefile ================================================================== --- /dev/null +++ server/work/Makefile @@ -0,0 +1,21 @@ +all: tclpkgs-src-current.tar.gz + +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 + rm -rf tclpkgs-src-current + mkdir tclpkgs-src-current + cp -rp platform build_all.sh 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 + +clean: + rm -f tclpkgs-*.tar.* + rm -rf tclpkgs-src-current + +.PHONY: all clean ADDED server/work/build_all.sh Index: server/work/build_all.sh ================================================================== --- /dev/null +++ server/work/build_all.sh @@ -0,0 +1,62 @@ +#! /bin/bash + +if [ ! -x "./platform" ]; then + echo 'ERROR: Platform script not found: ./platform' >&2 + + exit 1 +fi + +CLEANONLY=0 +DISTCLEAN=0 +if [ "$1" = "clean" ]; then + CLEANONLY=1 +fi +if [ "$1" = "distclean" ]; then + CLEANONLY=1 + DISTCLEAN=1 +fi +export CLEANONLY DISTCLEAN + +# Build all appropriate directories +faileddirs="" +for dir in */; do + export dir + + if [ ! -f "${dir}/build.sh" ]; then + continue + fi + + failed=0 + ( + cd "${dir}" || exit 1 + + rm -f "build.log" + rm -rf "build" "out" + if [ "${DISTCLEAN}" = "1" ]; then + rm -rf "src" + fi + if [ "${CLEANONLY}" = "1" ]; then + exit 0 + fi + + ./build.sh 2>&1 | tee "build.log" || exit 1 + ) || failed=1 + + if [ "${failed}" = "1" ]; then + rm -rf "${dir}/out" + faileddirs="${faileddirs} ${dir}" + fi +done + +# Let the user know what failed to build +if [ -n "${faileddirs}" ]; then + echo "The following failed to build:${failddirs}" +fi + +# Create tarfile of built packages +PLATFORM="$(./platform)" +DATECODE="$(date +%Y%m%d%H%M)" +OUTFILEBASE="tclpkgs-${PLATFORM}-${DATECODE}" +tar -cf - */out */build.log | bzip2 -9c > "${OUTFILEBASE}.tar.bz2" + +exit 0