Check-in [c0fd75de7e]
Overview
Comment:Added the ability to specify a PLATFORM (defaults to auto-detect) Disabled building of binary packages when PLATFORM is "tcl" Added building Tcllib if PLATFORM is "tcl"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c0fd75de7eec861f7fc9a5eba5c47ab4fae1ba0d
User & Date: rkeene on 2010-02-11 13:49:41
Other Links: manifest | tags
Context
2010-02-11
15:48
teaparty 0.9.5.x Updated to remove ActivevState repository cache before packaging check-in: 10b77fbc91 user: rkeene tags: trunk
13:49
Added the ability to specify a PLATFORM (defaults to auto-detect) Disabled building of binary packages when PLATFORM is "tcl" Added building Tcllib if PLATFORM is "tcl" check-in: c0fd75de7e user: rkeene tags: trunk
2010-02-10
03:36
Updated to create all possible combination of parameters (still requires strict order) check-in: 37af467773 user: rkeene tags: trunk
Changes

Modified .fossil-settings/ignore-glob from [9051d2d91e] to [e3e4fac2e6].

    18     18   server/buildpkgs/sqlite3/build/*
    19     19   server/buildpkgs/sqlite3/out
    20     20   server/buildpkgs/sqlite3/out/*
    21     21   server/buildpkgs/sqlite3/src
    22     22   server/buildpkgs/sqlite3/src/*
    23     23   server/buildpkgs/tcl
    24     24   server/buildpkgs/tcl/*
           25  +server/buildpkgs/tcllib/build
           26  +server/buildpkgs/tcllib/build/*
           27  +server/buildpkgs/tcllib/out
           28  +server/buildpkgs/tcllib/out/*
           29  +server/buildpkgs/tcllib/src
           30  +server/buildpkgs/tcllib/src/*
    25     31   server/buildpkgs/tclpkgs-*.tar.*
    26     32   server/buildpkgs/tclpkgs-*.tar.*/*
    27     33   server/buildpkgs/tls/build
    28     34   server/buildpkgs/tls/build/*
    29     35   server/buildpkgs/tls/out
    30     36   server/buildpkgs/tls/out/*
    31     37   server/buildpkgs/tls/src
    32     38   server/buildpkgs/tls/src/*
    33     39   server/pkgs
    34     40   server/pkgs/*

Modified server/buildpkgs/Tclx/build.sh from [e6281d406a] to [d5a82463ec].

     1      1   #! /bin/bash
     2      2   
     3      3   if [ ! -x "../platform" ]; then
     4      4   	echo "No platform script found, aborting." >&2
     5      5   
     6      6   	exit 1
     7      7   fi
            8  +
            9  +if [ "${PLATFORM}" = "tcl" ]; then
           10  +	rm -rf out
           11  +
           12  +	exit 0
           13  +fi
     8     14   
     9     15   VERS=8.4
    10     16   SRC="src/tclx${VERS}.tar.bz2"
    11     17   SRCURL="http://sourceforge.net/projects/tclx/files/TclX/${VERS}.0/tclx${VERS}.tar.bz2/download"
    12     18   BUILDDIR="tclx${VERS}"
    13     19   WORKDIR="${TMPDIR:-/tmp}/tclx-$$${RANDOM}${RANDOM}${RANDOM}"
    14     20   PLATDIR="$(pwd)/out/${PLATFORM}"

Modified server/buildpkgs/build_all.sh from [3c49d360c7] to [62bff14932].

   110    110   	unset TCLVERS
   111    111   	unset ADDFLAGS
   112    112   	unset TCLBUILDDIR
   113    113   	export TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS
   114    114   fi
   115    115   
   116    116   # Determine platform
   117         -PLATFORM="$(./platform)"
   118         -export PLATFORM
          117  +if [ -z "${FORCE_PLATFORM}" ]; then
          118  +	PLATFORM="$(./platform)"
          119  +	export PLATFORM
          120  +else
          121  +	PLATFORM="${FORCE_PLATFORM}"
          122  +fi
   119    123   
   120    124   # Build all appropriate directories
   121    125   faileddirs=""
   122    126   for dir in */; do
   123    127   	export dir
   124    128   
   125    129   	if [ ! -f "${dir}/build.sh" ]; then
................................................................................
   164    168   
   165    169   # Let the user know what failed to build
   166    170   if [ -n "${faileddirs}" ]; then
   167    171   	echo "The following failed to build:${faileddirs}"
   168    172   fi
   169    173   
   170    174   # Create tarfile of built packages
   171         -PLATFORM="$(./platform)"
   172    175   DATECODE="$(date +%Y%m%d%H%M)"
   173    176   OUTFILEBASE="tclpkgs-${PLATFORM}-${DATECODE}"
   174    177   tar -cf - */out | bzip2 -9c > "${OUTFILEBASE}.tar.bz2"
   175    178   
   176    179   exit 0

Modified server/buildpkgs/dict/build.sh from [a8c213b541] to [06accdf118].

     1      1   #! /bin/bash
     2      2   
     3      3   if [ ! -x "../platform" ]; then
     4      4   	echo "No platform script found, aborting." >&2
     5      5   
     6      6   	exit 1
     7      7   fi
            8  +
            9  +if [ "${PLATFORM}" = "tcl" ]; then
           10  +	rm -rf out
           11  +
           12  +	exit 0
           13  +fi
     8     14   
     9     15   VERS=8.5.2
    10     16   SRC="src/tclDict-${VERS}.tar.gz"
    11     17   SRCURL="http://pascal.scheffers.net/software/tclDict-${VERS}.tar.gz"
    12     18   BUILDDIR="tclDict-${VERS}"
    13     19   WORKDIR="${TMPDIR:-/tmp}/dict-$$${RANDOM}${RANDOM}${RANDOM}"
    14     20   PLATDIR="$(pwd)/out/${PLATFORM}"

Modified server/buildpkgs/sqlite3/build.sh from [c9cd8f667d] to [ca2074f1e1].

     1      1   #! /bin/bash
     2      2   
     3      3   if [ ! -x "../platform" ]; then
     4      4   	echo "No platform script found, aborting." >&2
     5      5   
     6      6   	exit 1
     7      7   fi
            8  +
            9  +if [ "${PLATFORM}" = "tcl" ]; then
           10  +	rm -rf out
           11  +
           12  +	exit 0
           13  +fi
     8     14   
     9     15   VERS=3.6.22
    10     16   VERSUNDER="$(echo "${VERS}" | sed 's@\.@_@g')"
    11     17   SRC="src/sqlite-${VERSUNDER}.tar.gz"
    12     18   SRCURL="http://www.sqlite.org/sqlite-${VERSUNDER}-tea.tar.gz"
    13     19   BUILDDIR="sqlite-${VERSUNDER}-tea"
    14     20   WORKDIR="${TMPDIR:-/tmp}/sqlite-$$${RANDOM}${RANDOM}${RANDOM}"

Added server/buildpkgs/tcllib/build.sh version [55397ed974].

            1  +#! /bin/bash
            2  +
            3  +if [ ! -x "../platform" ]; then
            4  +	echo "No platform script found, aborting." >&2
            5  +
            6  +	exit 1
            7  +fi
            8  +
            9  +if [ "${PLATFORM}" != "tcl" ]; then
           10  +	rm -rf out
           11  +
           12  +	exit 0
           13  +fi
           14  +
           15  +VERS=1.12
           16  +SRC="src/tcllib-${VERS}.tar.gz"
           17  +SRCURL="http://sourceforge.net/projects/tcllib/files/tcllib/${VERS}/tcllib-${VERS}.tar.gz/download"
           18  +BUILDDIR="tcllib-${VERS}"
           19  +WORKDIR="${TMPDIR:-/tmp}/tcllib-$$${RANDOM}${RANDOM}${RANDOM}"
           20  +PLATDIR="$(pwd)/out/${PLATFORM}"
           21  +
           22  +export VERS SRC SRCURL BUILDDIR WORKDIR PLATFORM PLATDIR
           23  +
           24  +if [ ! -f "${SRC}" ]; then
           25  +	mkdir src >/dev/null 2>/dev/null
           26  +
           27  +	wget -O "${SRC}" "${SRCURL}" || exit 1
           28  +fi
           29  +
           30  +rm -rf "${WORKDIR}" >/dev/null 2>/dev/null
           31  +mkdir -p "${WORKDIR}" || exit 1
           32  +
           33  +retval=0
           34  +(
           35  +	rm -rf build
           36  +	mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null
           37  +	mkdir build
           38  +
           39  +	cd build/ || exit 1
           40  +
           41  +	gzip -dc "../${SRC}" | tar -xf -
           42  +	cd "${BUILDDIR}" || exit 1
           43  +
           44  +	find modules -type f -name '*.test' -o -name 'ChangeLog' -o -name '*.man' -o -name '*.txt' | xargs rm -f
           45  +
           46  +	workfile="${WORKDIR}/file"
           47  +	worksubfile="${WORKDIR}/subfile"
           48  +	pkgfiles=""
           49  +	for file in modules/*/*.tcl; do
           50  +		cat "${file}" | tr ';[]{}' "\n\n\n\n\n" | sed 's@^[	 ]*#.*$@@' "${file}" > "${workfile}"
           51  +
           52  +		if grep '^ *package  *provide  *' "${workfile}" >/dev/null; then
           53  +			pkgfiles="${pkgfiles}
           54  +${file}"
           55  +		fi
           56  +	done
           57  +
           58  +	for file in modules/*/*.tcl; do
           59  +		filetail="$(basename "${file}")"
           60  +		if [ "${filetail}" = "pkgIndex.tcl" ]; then
           61  +			continue
           62  +		fi
           63  +
           64  +		pkgdir="$(dirname "${file}")"
           65  +
           66  +		cat "${file}" | tr ';[]{}	' "\n\n\n\n\n " | sed 's@^ *#.*$@@' > "${workfile}"
           67  +
           68  +		# Some packages try to require a package, if that doesn't work they implement it and say they provide it (lies)
           69  +		# We remove any "package provide blah" in a file also containing "package require blah"
           70  +		# TODO: We should add "blah" to the recommended packages if we ended up removing anything
           71  +		grep '^ *package  *require  *' "${workfile}" | while read blah blah reqpkg remain; do
           72  +			grep -v "^ *package  *provide  *${reqpkg}  *" "${workfile}" > "${workfile}.new"
           73  +			mv "${workfile}.new" "${workfile}"
           74  +		done
           75  +
           76  +		if ! grep '^ *package  *provide  *[^ ][^ ]*  *[^ ][^ ]*' "${workfile}" >/dev/null; then
           77  +			continue
           78  +		fi
           79  +
           80  +		# Determine package name and version
           81  +		pkg="$(grep '^ *package  *provide  *[^ ][^ ]*  *[^ ][^ ]*' "${workfile}" | head -1 | sed 's@^ *package  *provide  *\([^ ][^ ]*\) .*$@\1@' | sed 's@^  *@@;s@  *$@@')"
           82  +		pkgver="$(grep '^ *package  *provide  *[^ ][^ ]*  *[^ ][^ ]*' "${workfile}" | head -1 | sed 's@^ *package  *provide  *[^ ][^ ]*  *\([^ ][^ ]*\)*$@\1@;s@^[^0-9\.].*@@g')"
           83  +
           84  +		if echo "${pkg}" | grep '^ *\[' >/dev/null || [ -z "${pkg}" ]; then
           85  +			pkg="$(grep "package  *ifneeded  *" "${pkgdir}/pkgIndex.tcl" | sed 's@^.*package  *ifneeded  *\([^ ][^ ]*\) .*$@\1@' | sed 's@^  *@@;s@  *$@@')"
           86  +			if [ "$(echo "${pkg}" | wc -l | awk '{ print $1 }')" != "1" ]; then
           87  +				pkg="$(basename "${file}" .tcl)"
           88  +
           89  +				echo "Unable to determine name of package: $file, assuming it is $pkg"
           90  +			fi
           91  +		fi
           92  +		if [ -z "${pkgver}" ]; then
           93  +			pkgver="$(grep "package  *ifneeded  *.*source  *.* ${filetail}" "${pkgdir}/pkgIndex.tcl" 2>/dev/null | sed 's@^.*package  *ifneeded  *[^ ][^ ]*  *\([^ ][^ ]*\) .*$@\1@' | head -1)"
           94  +		fi
           95  +		if [ -z "${pkgver}" ]; then
           96  +			pkgver="$(grep "package  *ifneeded  *${pkg}  *" "${pkgdir}/pkgIndex.tcl" 2>/dev/null | sed 's@^.*package  *ifneeded  *[^ ][^ ]*  *\([^ ][^ ]*\) .*$@\1@' | head -1)"
           97  +		fi
           98  +		if [ -z "${pkgver}" ]; then
           99  +			echo "Unable to determine version of ${pkg}: $(grep '^ *package  *provide  *' "${workfile}" | head -1), skipping."
          100  +
          101  +			continue
          102  +		fi
          103  +
          104  +		# Skip marker package names
          105  +		if [ "${pkg}" = "@@" ]; then
          106  +			continue
          107  +		fi
          108  +
          109  +		# Create output directory
          110  +		outdir="${PLATDIR}/${pkg}-${pkgver}"
          111  +		if [ -d "${outdir}" ]; then
          112  +			echo "ERROR: $outdir already exists, skipping ${file} which provides ${pkg} v${pkgver}"
          113  +
          114  +			continue
          115  +		fi
          116  +		mkdir -p "${outdir}" || continue
          117  +
          118  +		# Put relevant files into the directory
          119  +		if grep '^ *source  *' "${workfile}" >/dev/null; then
          120  +			# Include all the files in the directory that do not contain packages
          121  +			cp "${file}" "${outdir}"
          122  +			for subfile in "${pkgdir}"/*; do
          123  +				if ! echo "${pkgfiles}" | grep "^${subfile}$" >/dev/null; then
          124  +					cp "${subfile}" "${outdir}" >/dev/null 2>/dev/null
          125  +				fi
          126  +			done
          127  +			grep -v "package  *ifneeded  *" "${pkgdir}/pkgIndex.tcl" > "${outdir}/pkgIndex.tcl"
          128  +			grep "package  *ifneeded  *${pkg}  *" "${pkgdir}/pkgIndex.tcl" >> "${outdir}/pkgIndex.tcl"
          129  +
          130  +			# Create Teapot info
          131  +			pkgdesc="Part of the Tclib $(basename $(dirname ${file})) module"
          132  +			pkgteapotfile="${outdir}/teapot.txt"
          133  +		else
          134  +			# Make a tclModule
          135  +			cp "${file}" "${outdir}/"
          136  +			outfile="${outdir}/${filetail}"
          137  +
          138  +			# Create Teapot info
          139  +			pkgdesc="Part of the Tclib $(basename $(dirname ${file})) module"
          140  +			pkgteapotfile="${outfile}"
          141  +		fi
          142  +
          143  +		pkgdeps=$( ( for subfile in "${outdir}"/*.tcl; do
          144  +			cat "${subfile}" | grep -v 'catch ' | tr ';[]{}	' "\n\n\n\n\n " | sed 's@^ *#.*$@@' > "${worksubfile}"
          145  +			grep '^ *package  *require  *' "${worksubfile}" | while read blah blah reqpkg reqpkgver extra; do
          146  +				reqpkgver="$(echo "${reqpkgver}" | sed 's@ *\$.*$@@')"
          147  +				if [ -n "${reqpkgver}" ]; then
          148  +					reqpkgver=$(echo "${reqpkgver}" | sed 's@[+=-]*$@@g')
          149  +					echo "${reqpkg} ${reqpkgver}"
          150  +				else
          151  +					echo "${reqpkg}"
          152  +				fi
          153  +			done | sort -u | grep -v '__undefined__' | grep -v '__does_not_exist__'
          154  +		done | tr "\n" ','; echo ) | sed 's@,,*$@@')
          155  +
          156  +		../../../create_teapot "${pkgteapotfile}" "$pkg" "$pkgver" "http://tcllib.sourceforge.net/" "tcl" "${pkgdeps}" "${pkgdesc}"
          157  +	done
          158  +) || retval=1
          159  +
          160  +rm -rf "${WORKDIR}"
          161  +
          162  +exit $retval

Modified server/buildpkgs/tls/build.sh from [3a852f9bb4] to [780cdf7280].

     1      1   #! /bin/bash
     2      2   
     3      3   if [ ! -x "../platform" ]; then
     4      4   	echo "No platform script found, aborting." >&2
     5      5   
     6      6   	exit 1
     7      7   fi
            8  +
            9  +if [ "${PLATFORM}" = "tcl" ]; then
           10  +	rm -rf out
           11  +
           12  +	exit 0
           13  +fi
     8     14   
     9     15   VERS=1.6
    10     16   SRC="src/tls${VERS}-src.tar.gz"
    11     17   SRCURL="http://sourceforge.net/projects/tls/files/tls/${VERS}/tls${VERS}-src.tar.gz/download"
    12     18   BUILDDIR="tls${VERS}"
    13     19   WORKDIR="${TMPDIR:-/tmp}/tls-$$${RANDOM}${RANDOM}${RANDOM}"
    14     20   PLATDIR="$(pwd)/out/${PLATFORM}"