Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -26,10 +26,16 @@ server/buildpkgs/tcllib/build/* server/buildpkgs/tcllib/out server/buildpkgs/tcllib/out/* server/buildpkgs/tcllib/src server/buildpkgs/tcllib/src/* +server/buildpkgs/tclpkcs11/build +server/buildpkgs/tclpkcs11/build/* +server/buildpkgs/tclpkcs11/out +server/buildpkgs/tclpkcs11/out/* +server/buildpkgs/tclpkcs11/src +server/buildpkgs/tclpkcs11/src/* server/buildpkgs/tclpkgs-*.tar.* server/buildpkgs/tclpkgs-*.tar.*/* server/buildpkgs/tls/build server/buildpkgs/tls/build/* server/buildpkgs/tls/out Index: server/buildpkgs/build_all.sh ================================================================== --- server/buildpkgs/build_all.sh +++ server/buildpkgs/build_all.sh @@ -21,21 +21,22 @@ CONFIGUREEXTRA="$@" export CONFIGUREEXTRA # Determine path to "tclConfig.sh" -rm -rf tcl/build +rm -rf tcl/build tcl/inst rm -f platform.magic.* if [ "${DISTCLEAN}" = "1" ]; then rm -rf tcl fi if [ "${CLEANONLY}" = "0" ]; then TCLVERS="8.4.19" TCLPRIVATE="$(pwd)/tcl/build/tcl${TCLVERS}" PROJROOTDIR="$(pwd)" - export TCLVERS TCLPRIVATE PROJROOTDIR + TCLINSTDIR="$(pwd)/tcl/inst" + export TCLVERS TCLPRIVATE PROJROOTDIR TCLINSTDIR mkdir tcl tcl/build >/dev/null 2>/dev/null if [ ! -f "tcl/src/tcl${TCLVERS}.tar.gz" ]; then mkdir tcl/src >/dev/null 2>/dev/null @@ -50,13 +51,14 @@ for dir in unix win macosx; do cd "${TCLPRIVATE}/${dir}" || exit 1 echo " Executing: ./configure ${CONFIGUREEXTRA}" - ./configure --disable-threads ${CONFIGUREEXTRA} + ./configure --disable-threads ${CONFIGUREEXTRA} --prefix="${TCLINSTDIR}" ${MAKE:-make} || continue + ${MAKE:-make} install || break LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" LD_RUN_PATH=".:${LD_RUN_PATH}" export LD_LIBRARY_PATH LD_RUN_PATH @@ -77,11 +79,13 @@ ) TCLBUILDDIR="$(cat "${PROJROOTDIR}/platform.magic.dir")" export TCLBUILDDIR - if [ -d "${TCLBUILDDIR}" -a -f "${TCLBUILDDIR}/tclConfig.sh" ]; then + if [ -d "${TCLINSTDIR}" -a -f "${TCLINSTDIR}/lib/tclConfig.sh" ]; then + TCLCONFIGDIR="${TCLINSTDIR}/lib" + elif [ -d "${TCLBUILDDIR}" -a -f "${TCLBUILDDIR}/tclConfig.sh" ]; then TCLCONFIGDIR="${TCLBUILDDIR}" else unset TCLPRIVATE TCLCONFIGDIR=$( @@ -101,18 +105,23 @@ fi TCLPRIVATE="$(dirname "${TCLCONFIGDIR}")/include/tcl-private" fi - ADDFLAGS="-I${TCLPRIVATE} -I${TCLPRIVATE}/generic -I${TCLBUILDDIR}" + ADDFLAGS="" + if [ -n "${TCLPRIVATE}" ]; then + ADDFLAGS="${ADDFLAGS} -I${TCLPRIVATE} -I${TCLPRIVATE}/generic" + fi + if [ -n "${TCLBUILDDIR}" ]; then + ADDFLAGS="${ADDFLAGS} -I${TCLBUILDDIR}" + fi CFLAGS="${ADDFLAGS} ${CFLAGS}" CPPFLAGS="${ADDFLAGS} ${CPPFLAGS}" unset TCLVERS unset ADDFLAGS - unset TCLBUILDDIR - export TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS + export TCLBUILDDIR TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS fi # Determine platform if [ -z "${FORCE_PLATFORM}" ]; then PLATFORM="$(./platform)" ADDED server/buildpkgs/tclpkcs11/build.sh Index: server/buildpkgs/tclpkcs11/build.sh ================================================================== --- /dev/null +++ server/buildpkgs/tclpkcs11/build.sh @@ -0,0 +1,50 @@ +#! /bin/bash + +if [ ! -x "../platform" ]; then + echo "No platform script found, aborting." >&2 + + exit 1 +fi + +if [ "${PLATFORM}" = "tcl" ]; then + rm -rf out + + exit 0 +fi + +VERS=0.9.6 +SRC="src/sqlite-${VERS}.tar.gz" +SRCURL="http://www.rkeene.org/devel/tclpkcs11-${VERS}.tar.gz" +BUILDDIR="tclpkcs11-${VERS}" +WORKDIR="${TMPDIR:-/tmp}/tclpkcs11-$$${RANDOM}${RANDOM}${RANDOM}" +PLATDIR="$(pwd)/out/${PLATFORM}" + +export VERS SRC SRCURL BUILDDIR WORKDIR PLATDIR + +if [ ! -f "${SRC}" ]; then + mkdir src >/dev/null 2>/dev/null + + wget -O "${SRC}" "${SRCURL}" || exit 1 +fi + +( + rm -rf build + mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null + mkdir build + + cd build/ || exit 1 + + gzip -dc "../${SRC}" | tar -xf - + cd "${BUILDDIR}" || exit 1 + + ./configure --enable-shared --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA} + + ${MAKE:-make} || exit 1 + + cp tclpkcs11.so tclpkcs11.sl tclpkcs11.dylib tclpkcs11.dll "${PLATDIR}" >/dev/null 2>/dev/null + cp pkgIndex.tcl "${PLATDIR}" +) || exit 1 + +../create_teapot "${PLATDIR}/teapot.txt" "tclpkcs11" "${VERS}" "${SRCURL}" "${PLATFORM}" "Tcl 8.4, pki" "TclPKCS11 is a package to provide PKCS#11 cryptography support to Tcl. This will let you offload cryptographic operations onto a dedicated hardware or software module." + +exit 0