Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -1,12 +1,14 @@ 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/* +server/buildpkgs/tclpkgs-*.tar.* +server/buildpkgs/tclpkgs-*.tar.*/* +server/buildpkgs/tls/build +server/buildpkgs/tls/build.log +server/buildpkgs/tls/build.log/* +server/buildpkgs/tls/build/* +server/buildpkgs/tls/out +server/buildpkgs/tls/out/* +server/buildpkgs/tls/src +server/buildpkgs/tls/src/* +server/pkgs +server/pkgs/* ADDED server/buildpkgs/Makefile Index: server/buildpkgs/Makefile ================================================================== --- /dev/null +++ server/buildpkgs/Makefile @@ -0,0 +1,22 @@ +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 create_teapot */build.sh + rm -rf tclpkgs-src-current + mkdir 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 + +clean: + rm -f tclpkgs-*.tar.* + rm -rf tclpkgs-src-current + ./build_all.sh clean + +.PHONY: all clean ADDED server/buildpkgs/build_all.sh Index: server/buildpkgs/build_all.sh ================================================================== --- /dev/null +++ server/buildpkgs/build_all.sh @@ -0,0 +1,90 @@ +#! /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 + +# Determine path to "tclConfig.sh" +TCLCONFIGDIR=$( + ( + echo "${LD_LIBRARY_PATH}" | tr ':' "\n" + cat /etc/ld.so.conf 2>/dev/null + crle 2>/dev/null | grep '^ *Default Library Path' | sed 's@^ *Default Library Path[^:]*:[^:]*/@/@' | tr ':' "\n" + ) | grep '^/' | while read chklibdir; do + if [ -f "${chklibdir}/tclConfig.sh" ]; then + echo "${chklibdir}" + break + fi + done +) +if [ -z "${TCLCONFIGDIR}" ]; then + TCLCONFIGDIR="/usr/lib" +fi +export TCLCONFIGDIR + +# Determine platform +PLATFORM="$(./platform)" +export PLATFORM + +# 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 -rf "build" "out" + if [ "${DISTCLEAN}" = "1" ]; then + rm -rf "src" + fi + if [ "${CLEANONLY}" = "1" ]; then + exit 0 + fi + + mkdir -p "out/${PLATFORM}" >/dev/null 2>/dev/null + + ./build.sh 2>&1 | tee "out/${PLATFORM}/build.log" || exit 1 + ) || failed=1 + + if [ "${failed}" = "1" ]; then + rm -rf "${dir}/out" + faileddirs="${faileddirs} ${dir}" + fi +done + +# Cleanup is done at this point +if [ "${CLEANONLY}" = "1" ]; then + exit 0 +fi + +# 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 | bzip2 -9c > "${OUTFILEBASE}.tar.bz2" + +exit 0 ADDED server/buildpkgs/create_teapot Index: server/buildpkgs/create_teapot ================================================================== --- /dev/null +++ server/buildpkgs/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}" ADDED server/buildpkgs/platform Index: server/buildpkgs/platform ================================================================== --- /dev/null +++ server/buildpkgs/platform @@ -0,0 +1,41 @@ +#! /bin/bash + +case "`uname -s`" in + Linux) + GLIBCVERS=$(strings /lib/libc.so.6 | grep '^GLIBC_[0-9][0-9]*\.[0-9]*' | cut -f 2- -d _ | cut -f 1-2 -d . | sed 's@\.@ @g' | sort -n +0 +1 | tail -1 | sed 's@ @\.@g') + + case "`uname -m`" in + i?86) + CPUPLAT="ix86" + ;; + sun4?) + CPUPLAT="sparc" + ;; + *) + CPUPLAT="`uname -m`" + ;; + esac + + echo "linux-glibc${GLIBCVERS}-${CPUPLAT}" + ;; + SunOS) + SUNMAJVER=$(uname -r | cut -f 1 -d .) + SUNMINVER=$(uname -r | cut -f 2 -d .) + SOLVER="$[${SUNMAJVER} - 3].${SUNMINVER}" + + + case "`uname -m`" in + sun4?) + CPUPLAT="sparc" + ;; + *) + CPUPLAT="ix86" + ;; + esac + + echo "solaris${SOLVER}-${CPUPLAT}" + ;; + *) + echo "`uname -s | dd conv=lcase 2>/dev/null`-`uname -m | dd conv=lcase 2>/dev/null`" + ;; +esac ADDED server/buildpkgs/tls/build.sh Index: server/buildpkgs/tls/build.sh ================================================================== --- /dev/null +++ server/buildpkgs/tls/build.sh @@ -0,0 +1,56 @@ +#! /bin/bash + +if [ ! -x "../platform" ]; then + echo "No platform script found, aborting." >&2 + + exit 1 +fi + +VERS=1.6 +SRC="src/tls${VERS}-src.tar.gz" +SRCURL="http://sourceforge.net/projects/tls/files/tls/${VERS}/tls${VERS}-src.tar.gz/download" +BUILDDIR="tls${VERS}" +WORKDIR="${TMPDIR:-/tmp}/tls-$$${RANDOM}${RANDOM}${RANDOM}" +PLATFORM="$(../platform)" +PLATDIR="out/${PLATFORM}" + +export VERS SRC SRCURL BUILDDIR WORKDIR PLATFORM PLATDIR + +if [ ! -f "${SRC}" ]; then + mkdir src >/dev/null 2>/dev/null + + wget -O "${SRC}" "${SRCURL}" || exit 1 +fi + +( + rm -rf build + mkdir build + cd build/ || exit 1 + + gzip -dc "../${SRC}" | tar -xf - + cd "${BUILDDIR}" || exit 1 + + for chkssldir in $(pkg-config openssl --cflags | sed 's@ *-I *@|@g' | tr '|' "\n" | grep '^/'); do + if [ -f "${chkssldir}/openssl/opensslv.h" -o -f "${chkssldir}/opensslv.h" ]; then + SSLDIR=$(echo "${chkssldir}" | sed 's@/[^/]*/*$@@') + fi + done + if [ -z "${SSLDIR}" ]; then + SSLDIR="/usr" + fi + + ./configure --enable-shared --with-tcl="${TCLCONFIGDIR}" --with-ssl-dir="${SSLDIR}" + gmake || exit 1 +) || exit 1 + +( + 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 ADDED server/teapot_index Index: server/teapot_index ================================================================== --- /dev/null +++ server/teapot_index @@ -0,0 +1,233 @@ +#! /usr/bin/env tclsh + +if {[llength $argv] != "2"} { + puts stderr "Usage: teapot_index " + exit 1 +} + +set srcdir [file normalize [lindex $argv 0]] +set dstdir [file normalize [lindex $argv 1]] + +# Index all packages +proc teapot_index {srcdir} { + array set pkginfo [list] + + foreach pkgdir [glob -directory $srcdir -type d */out/*] { + unset -nocomplain currpkginfo + set currpkginfo(pkgdir) $pkgdir + + set teapot [file join $pkgdir teapot.txt] + + set multifile 1 + if {![file exists $teapot]} { + set files [glob -directory $pkgdir *] + if {[llength $files] == 1} { + set teapot [lindex $files 0] + set multifile 0 + } else { + continue + } + } + + set currpkginfo(multifile) $multifile + if {$multifile} { + set currpkginfo(extfile) file.zip + } else { + set currpkginfo(extfile) file.tm + } + + set fd [open $teapot r] + set data [read $fd] + close $fd + + set processline $multifile + foreach line [split $data \n] { + set line [string trim $line] + if {!$multifile} { + if {$line == "# @@ Meta Begin"} { + set processline 1 + continue + } + + if {$line == "# @@ Meta End"} { + break + } + + set line [regsub {^ *# *} $line {}] + } + + if {!$processline} { + continue + } + + set cmd "INVALID" + catch { + set cmd [string toupper [lindex $line 0]] + } + + switch -- $cmd { + "PACKAGE" { + set name [lindex $line 1] + set vers [lindex $line 2] + + set currpkginfo(name) $name + set currpkginfo(vers) $vers + } + "META" { + set var [string tolower [lindex $line 1]] + set val [lrange $line 2 end] + + set currpkginfo($var) $val + } + } + } + + set pkginfo([list $currpkginfo(name) $currpkginfo(vers) $currpkginfo(platform)]) [array get currpkginfo] + } + + return [array get pkginfo] +} + +proc generate_tpm {entlist} { + set ret {} + + return $ret +} + +proc generate_table {fields numitems} { + set ret "" + + foreach field $fields { + append ret " \n" + + foreach part [lrange $field 0 [expr $numitems - 1]] { + append ret " $part\n" + } + + append ret " \n" + } + + return [string range $ret 0 end-1] +} + +# Create "index.html" +proc create_output_index {dstdir pkginfo_arrlist} { + array set pkginfo $pkginfo_arrlist + + set indexfile [file join $dstdir index.html] + + set pkglist [list] + foreach ent [array names pkginfo] { + set pkg [lindex $ent 0] + if {[lsearch -exact $pkglist $pkg] != -1} { + continue + } + + lappend pkglist $pkg + } + + set fd [open $indexfile w] + puts $fd "" + puts $fd " " + puts $fd " List of all entities" + puts $fd " " + puts $fd " " + puts $fd [generate_tpm $pkglist] + puts $fd "

List of all entities

" + puts $fd " " + puts $fd [generate_table $pkglist 1] + puts $fd "
" + puts $fd " " + puts $fd "" + close $fd +} + +# Create "package/list" +proc create_output_pkglist {dstdir pkginfo_arrlist} { + array set pkginfo $pkginfo_arrlist + + set pkgdir [file join $dstdir package] + catch { + file mkdir $pkgdir + } + set indexfile [file join $pkgdir list.html] + set altindexfile [file join $pkgdir list] + + set pkglist [list] + foreach ent [array names pkginfo] { + set pkg [lindex $ent 0] + set ver [lindex $ent 1] + set arch [lindex $ent 2] + + lappend pkglist [list package $pkg $ver $arch 0] + } + + set fd [open $indexfile w] + puts $fd "" + puts $fd " " + puts $fd " List of all packages" + puts $fd " " + puts $fd " " + puts $fd [generate_tpm $pkglist] + puts $fd "

List of all packages

" + puts $fd " " + puts $fd " " + puts $fd " " + puts $fd " " + puts $fd " " + puts $fd " " + puts $fd " " + puts $fd [generate_table $pkglist 4] + puts $fd "
WhatNameVersionPlatform
" + puts $fd " " + puts $fd "" + close $fd + + file delete $altindexfile + file link -hard $altindexfile $indexfile +} + +# Create "package/name//ver//arch//file" +proc create_output_files {dstdir pkginfo_arrlist} { + array set pkginfo $pkginfo_arrlist + + foreach ent [array names pkginfo] { + set pkg [lindex $ent 0] + set ver [lindex $ent 1] + set arch [lindex $ent 2] + + array set currpkginfo $pkginfo($ent) + set pkgdir $currpkginfo(pkgdir) + set multifile $currpkginfo(multifile) + set extfiletail $currpkginfo(extfile) + + set workdir [file join $dstdir package name $pkg ver $ver arch $arch] + set regfile [file join $workdir file] + set extfile [file join $workdir $extfiletail] + catch { + file mkdir $workdir + } + + if {$multifile} { + catch { + cd $pkgdir + + exec zip -r $extfile . + } + } else { + set origfile [lindex [glob $pkgdir *] 0] + + file copy -force -- $origfile $extfile + } + + file delete $regfile + file link -hard $regfile $extfile + } +} + +set pkginfo [teapot_index $srcdir] +create_output_index $dstdir $pkginfo +create_output_pkglist $dstdir $pkginfo +create_output_files $dstdir $pkginfo DELETED server/work/Makefile Index: server/work/Makefile ================================================================== --- server/work/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -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 create_teapot */build.sh - rm -rf tclpkgs-src-current - mkdir 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 - -clean: - rm -f tclpkgs-*.tar.* - rm -rf tclpkgs-src-current - ./build_all.sh clean - -.PHONY: all clean DELETED server/work/build_all.sh Index: server/work/build_all.sh ================================================================== --- server/work/build_all.sh +++ /dev/null @@ -1,90 +0,0 @@ -#! /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 - -# Determine path to "tclConfig.sh" -TCLCONFIGDIR=$( - ( - echo "${LD_LIBRARY_PATH}" | tr ':' "\n" - cat /etc/ld.so.conf 2>/dev/null - crle 2>/dev/null | grep '^ *Default Library Path' | sed 's@^ *Default Library Path[^:]*:[^:]*/@/@' | tr ':' "\n" - ) | grep '^/' | while read chklibdir; do - if [ -f "${chklibdir}/tclConfig.sh" ]; then - echo "${chklibdir}" - break - fi - done -) -if [ -z "${TCLCONFIGDIR}" ]; then - TCLCONFIGDIR="/usr/lib" -fi -export TCLCONFIGDIR - -# Determine platform -PLATFORM="$(./platform)" -export PLATFORM - -# 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 -rf "build" "out" - if [ "${DISTCLEAN}" = "1" ]; then - rm -rf "src" - fi - if [ "${CLEANONLY}" = "1" ]; then - exit 0 - fi - - mkdir -p "out/${PLATFORM}" >/dev/null 2>/dev/null - - ./build.sh 2>&1 | tee "out/${PLATFORM}/build.log" || exit 1 - ) || failed=1 - - if [ "${failed}" = "1" ]; then - rm -rf "${dir}/out" - faileddirs="${faileddirs} ${dir}" - fi -done - -# Cleanup is done at this point -if [ "${CLEANONLY}" = "1" ]; then - exit 0 -fi - -# 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 | bzip2 -9c > "${OUTFILEBASE}.tar.bz2" - -exit 0 DELETED server/work/create_teapot Index: server/work/create_teapot ================================================================== --- server/work/create_teapot +++ /dev/null @@ -1,84 +0,0 @@ -#! /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}" DELETED server/work/platform Index: server/work/platform ================================================================== --- server/work/platform +++ /dev/null @@ -1,41 +0,0 @@ -#! /bin/bash - -case "`uname -s`" in - Linux) - GLIBCVERS=$(strings /lib/libc.so.6 | grep '^GLIBC_[0-9][0-9]*\.[0-9]*' | cut -f 2- -d _ | cut -f 1-2 -d . | sed 's@\.@ @g' | sort -n +0 +1 | tail -1 | sed 's@ @\.@g') - - case "`uname -m`" in - i?86) - CPUPLAT="ix86" - ;; - sun4?) - CPUPLAT="sparc" - ;; - *) - CPUPLAT="`uname -m`" - ;; - esac - - echo "linux-glibc${GLIBCVERS}-${CPUPLAT}" - ;; - SunOS) - SUNMAJVER=$(uname -r | cut -f 1 -d .) - SUNMINVER=$(uname -r | cut -f 2 -d .) - SOLVER="$[${SUNMAJVER} - 3].${SUNMINVER}" - - - case "`uname -m`" in - sun4?) - CPUPLAT="sparc" - ;; - *) - CPUPLAT="ix86" - ;; - esac - - echo "solaris${SOLVER}-${CPUPLAT}" - ;; - *) - echo "`uname -s | dd conv=lcase 2>/dev/null`-`uname -m | dd conv=lcase 2>/dev/null`" - ;; -esac DELETED server/work/tls/build.sh Index: server/work/tls/build.sh ================================================================== --- server/work/tls/build.sh +++ /dev/null @@ -1,56 +0,0 @@ -#! /bin/bash - -if [ ! -x "../platform" ]; then - echo "No platform script found, aborting." >&2 - - exit 1 -fi - -VERS=1.6 -SRC="src/tls${VERS}-src.tar.gz" -SRCURL="http://sourceforge.net/projects/tls/files/tls/${VERS}/tls${VERS}-src.tar.gz/download" -BUILDDIR="tls${VERS}" -WORKDIR="${TMPDIR:-/tmp}/tls-$$${RANDOM}${RANDOM}${RANDOM}" -PLATFORM="$(../platform)" -PLATDIR="out/${PLATFORM}" - -export VERS SRC SRCURL BUILDDIR WORKDIR PLATFORM PLATDIR - -if [ ! -f "${SRC}" ]; then - mkdir src >/dev/null 2>/dev/null - - wget -O "${SRC}" "${SRCURL}" || exit 1 -fi - -( - rm -rf build - mkdir build - cd build/ || exit 1 - - gzip -dc "../${SRC}" | tar -xf - - cd "${BUILDDIR}" || exit 1 - - for chkssldir in $(pkg-config openssl --cflags | sed 's@ *-I *@|@g' | tr '|' "\n" | grep '^/'); do - if [ -f "${chkssldir}/openssl/opensslv.h" -o -f "${chkssldir}/opensslv.h" ]; then - SSLDIR=$(echo "${chkssldir}" | sed 's@/[^/]*/*$@@') - fi - done - if [ -z "${SSLDIR}" ]; then - SSLDIR="/usr" - fi - - ./configure --enable-shared --with-tcl="${TCLCONFIGDIR}" --with-ssl-dir="${SSLDIR}" - gmake || exit 1 -) || exit 1 - -( - 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