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
19
20
21
22
23
24






25
26
27
28
29
30
31
32
33
34
server/buildpkgs/sqlite3/build/*
server/buildpkgs/sqlite3/out
server/buildpkgs/sqlite3/out/*
server/buildpkgs/sqlite3/src
server/buildpkgs/sqlite3/src/*
server/buildpkgs/tcl
server/buildpkgs/tcl/*






server/buildpkgs/tclpkgs-*.tar.*
server/buildpkgs/tclpkgs-*.tar.*/*
server/buildpkgs/tls/build
server/buildpkgs/tls/build/*
server/buildpkgs/tls/out
server/buildpkgs/tls/out/*
server/buildpkgs/tls/src
server/buildpkgs/tls/src/*
server/pkgs
server/pkgs/*







>
>
>
>
>
>










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

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

1
2
3
4
5
6
7






8
9
10
11
12
13
14
#! /bin/bash

if [ ! -x "../platform" ]; then
	echo "No platform script found, aborting." >&2

	exit 1
fi







VERS=8.4
SRC="src/tclx${VERS}.tar.bz2"
SRCURL="http://sourceforge.net/projects/tclx/files/TclX/${VERS}.0/tclx${VERS}.tar.bz2/download"
BUILDDIR="tclx${VERS}"
WORKDIR="${TMPDIR:-/tmp}/tclx-$$${RANDOM}${RANDOM}${RANDOM}"
PLATDIR="$(pwd)/out/${PLATFORM}"







>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /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=8.4
SRC="src/tclx${VERS}.tar.bz2"
SRCURL="http://sourceforge.net/projects/tclx/files/TclX/${VERS}.0/tclx${VERS}.tar.bz2/download"
BUILDDIR="tclx${VERS}"
WORKDIR="${TMPDIR:-/tmp}/tclx-$$${RANDOM}${RANDOM}${RANDOM}"
PLATDIR="$(pwd)/out/${PLATFORM}"

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

110
111
112
113
114
115
116

117
118



119
120
121
122
123
124
125
...
164
165
166
167
168
169
170
171
172
173
174
175
176
	unset TCLVERS
	unset ADDFLAGS
	unset TCLBUILDDIR
	export TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS
fi

# Determine platform

PLATFORM="$(./platform)"
export PLATFORM




# Build all appropriate directories
faileddirs=""
for dir in */; do
	export dir

	if [ ! -f "${dir}/build.sh" ]; then
................................................................................

# Let the user know what failed to build
if [ -n "${faileddirs}" ]; then
	echo "The following failed to build:${faileddirs}"
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







>
|
|
>
>
>







 







<





110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
168
169
170
171
172
173
174

175
176
177
178
179
	unset TCLVERS
	unset ADDFLAGS
	unset TCLBUILDDIR
	export TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS
fi

# Determine platform
if [ -z "${FORCE_PLATFORM}" ]; then
	PLATFORM="$(./platform)"
	export PLATFORM
else
	PLATFORM="${FORCE_PLATFORM}"
fi

# Build all appropriate directories
faileddirs=""
for dir in */; do
	export dir

	if [ ! -f "${dir}/build.sh" ]; then
................................................................................

# Let the user know what failed to build
if [ -n "${faileddirs}" ]; then
	echo "The following failed to build:${faileddirs}"
fi

# Create tarfile of built packages

DATECODE="$(date +%Y%m%d%H%M)"
OUTFILEBASE="tclpkgs-${PLATFORM}-${DATECODE}"
tar -cf - */out | bzip2 -9c > "${OUTFILEBASE}.tar.bz2"

exit 0

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

1
2
3
4
5
6
7






8
9
10
11
12
13
14
#! /bin/bash

if [ ! -x "../platform" ]; then
	echo "No platform script found, aborting." >&2

	exit 1
fi







VERS=8.5.2
SRC="src/tclDict-${VERS}.tar.gz"
SRCURL="http://pascal.scheffers.net/software/tclDict-${VERS}.tar.gz"
BUILDDIR="tclDict-${VERS}"
WORKDIR="${TMPDIR:-/tmp}/dict-$$${RANDOM}${RANDOM}${RANDOM}"
PLATDIR="$(pwd)/out/${PLATFORM}"







>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /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=8.5.2
SRC="src/tclDict-${VERS}.tar.gz"
SRCURL="http://pascal.scheffers.net/software/tclDict-${VERS}.tar.gz"
BUILDDIR="tclDict-${VERS}"
WORKDIR="${TMPDIR:-/tmp}/dict-$$${RANDOM}${RANDOM}${RANDOM}"
PLATDIR="$(pwd)/out/${PLATFORM}"

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

1
2
3
4
5
6
7






8
9
10
11
12
13
14
#! /bin/bash

if [ ! -x "../platform" ]; then
	echo "No platform script found, aborting." >&2

	exit 1
fi







VERS=3.6.22
VERSUNDER="$(echo "${VERS}" | sed 's@\.@_@g')"
SRC="src/sqlite-${VERSUNDER}.tar.gz"
SRCURL="http://www.sqlite.org/sqlite-${VERSUNDER}-tea.tar.gz"
BUILDDIR="sqlite-${VERSUNDER}-tea"
WORKDIR="${TMPDIR:-/tmp}/sqlite-$$${RANDOM}${RANDOM}${RANDOM}"







>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /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=3.6.22
VERSUNDER="$(echo "${VERS}" | sed 's@\.@_@g')"
SRC="src/sqlite-${VERSUNDER}.tar.gz"
SRCURL="http://www.sqlite.org/sqlite-${VERSUNDER}-tea.tar.gz"
BUILDDIR="sqlite-${VERSUNDER}-tea"
WORKDIR="${TMPDIR:-/tmp}/sqlite-$$${RANDOM}${RANDOM}${RANDOM}"

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





































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#! /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=1.12
SRC="src/tcllib-${VERS}.tar.gz"
SRCURL="http://sourceforge.net/projects/tcllib/files/tcllib/${VERS}/tcllib-${VERS}.tar.gz/download"
BUILDDIR="tcllib-${VERS}"
WORKDIR="${TMPDIR:-/tmp}/tcllib-$$${RANDOM}${RANDOM}${RANDOM}"
PLATDIR="$(pwd)/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 "${WORKDIR}" >/dev/null 2>/dev/null
mkdir -p "${WORKDIR}" || exit 1

retval=0
(
	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

	find modules -type f -name '*.test' -o -name 'ChangeLog' -o -name '*.man' -o -name '*.txt' | xargs rm -f

	workfile="${WORKDIR}/file"
	worksubfile="${WORKDIR}/subfile"
	pkgfiles=""
	for file in modules/*/*.tcl; do
		cat "${file}" | tr ';[]{}' "\n\n\n\n\n" | sed 's@^[	 ]*#.*$@@' "${file}" > "${workfile}"

		if grep '^ *package  *provide  *' "${workfile}" >/dev/null; then
			pkgfiles="${pkgfiles}
${file}"
		fi
	done

	for file in modules/*/*.tcl; do
		filetail="$(basename "${file}")"
		if [ "${filetail}" = "pkgIndex.tcl" ]; then
			continue
		fi

		pkgdir="$(dirname "${file}")"

		cat "${file}" | tr ';[]{}	' "\n\n\n\n\n " | sed 's@^ *#.*$@@' > "${workfile}"

		# Some packages try to require a package, if that doesn't work they implement it and say they provide it (lies)
		# We remove any "package provide blah" in a file also containing "package require blah"
		# TODO: We should add "blah" to the recommended packages if we ended up removing anything
		grep '^ *package  *require  *' "${workfile}" | while read blah blah reqpkg remain; do
			grep -v "^ *package  *provide  *${reqpkg}  *" "${workfile}" > "${workfile}.new"
			mv "${workfile}.new" "${workfile}"
		done

		if ! grep '^ *package  *provide  *[^ ][^ ]*  *[^ ][^ ]*' "${workfile}" >/dev/null; then
			continue
		fi

		# Determine package name and version
		pkg="$(grep '^ *package  *provide  *[^ ][^ ]*  *[^ ][^ ]*' "${workfile}" | head -1 | sed 's@^ *package  *provide  *\([^ ][^ ]*\) .*$@\1@' | sed 's@^  *@@;s@  *$@@')"
		pkgver="$(grep '^ *package  *provide  *[^ ][^ ]*  *[^ ][^ ]*' "${workfile}" | head -1 | sed 's@^ *package  *provide  *[^ ][^ ]*  *\([^ ][^ ]*\)*$@\1@;s@^[^0-9\.].*@@g')"

		if echo "${pkg}" | grep '^ *\[' >/dev/null || [ -z "${pkg}" ]; then
			pkg="$(grep "package  *ifneeded  *" "${pkgdir}/pkgIndex.tcl" | sed 's@^.*package  *ifneeded  *\([^ ][^ ]*\) .*$@\1@' | sed 's@^  *@@;s@  *$@@')"
			if [ "$(echo "${pkg}" | wc -l | awk '{ print $1 }')" != "1" ]; then
				pkg="$(basename "${file}" .tcl)"

				echo "Unable to determine name of package: $file, assuming it is $pkg"
			fi
		fi
		if [ -z "${pkgver}" ]; then
			pkgver="$(grep "package  *ifneeded  *.*source  *.* ${filetail}" "${pkgdir}/pkgIndex.tcl" 2>/dev/null | sed 's@^.*package  *ifneeded  *[^ ][^ ]*  *\([^ ][^ ]*\) .*$@\1@' | head -1)"
		fi
		if [ -z "${pkgver}" ]; then
			pkgver="$(grep "package  *ifneeded  *${pkg}  *" "${pkgdir}/pkgIndex.tcl" 2>/dev/null | sed 's@^.*package  *ifneeded  *[^ ][^ ]*  *\([^ ][^ ]*\) .*$@\1@' | head -1)"
		fi
		if [ -z "${pkgver}" ]; then
			echo "Unable to determine version of ${pkg}: $(grep '^ *package  *provide  *' "${workfile}" | head -1), skipping."

			continue
		fi

		# Skip marker package names
		if [ "${pkg}" = "@@" ]; then
			continue
		fi

		# Create output directory
		outdir="${PLATDIR}/${pkg}-${pkgver}"
		if [ -d "${outdir}" ]; then
			echo "ERROR: $outdir already exists, skipping ${file} which provides ${pkg} v${pkgver}"

			continue
		fi
		mkdir -p "${outdir}" || continue

		# Put relevant files into the directory
		if grep '^ *source  *' "${workfile}" >/dev/null; then
			# Include all the files in the directory that do not contain packages
			cp "${file}" "${outdir}"
			for subfile in "${pkgdir}"/*; do
				if ! echo "${pkgfiles}" | grep "^${subfile}$" >/dev/null; then
					cp "${subfile}" "${outdir}" >/dev/null 2>/dev/null
				fi
			done
			grep -v "package  *ifneeded  *" "${pkgdir}/pkgIndex.tcl" > "${outdir}/pkgIndex.tcl"
			grep "package  *ifneeded  *${pkg}  *" "${pkgdir}/pkgIndex.tcl" >> "${outdir}/pkgIndex.tcl"

			# Create Teapot info
			pkgdesc="Part of the Tclib $(basename $(dirname ${file})) module"
			pkgteapotfile="${outdir}/teapot.txt"
		else
			# Make a tclModule
			cp "${file}" "${outdir}/"
			outfile="${outdir}/${filetail}"

			# Create Teapot info
			pkgdesc="Part of the Tclib $(basename $(dirname ${file})) module"
			pkgteapotfile="${outfile}"
		fi

		pkgdeps=$( ( for subfile in "${outdir}"/*.tcl; do
			cat "${subfile}" | grep -v 'catch ' | tr ';[]{}	' "\n\n\n\n\n " | sed 's@^ *#.*$@@' > "${worksubfile}"
			grep '^ *package  *require  *' "${worksubfile}" | while read blah blah reqpkg reqpkgver extra; do
				reqpkgver="$(echo "${reqpkgver}" | sed 's@ *\$.*$@@')"
				if [ -n "${reqpkgver}" ]; then
					reqpkgver=$(echo "${reqpkgver}" | sed 's@[+=-]*$@@g')
					echo "${reqpkg} ${reqpkgver}"
				else
					echo "${reqpkg}"
				fi
			done | sort -u | grep -v '__undefined__' | grep -v '__does_not_exist__'
		done | tr "\n" ','; echo ) | sed 's@,,*$@@')

		../../../create_teapot "${pkgteapotfile}" "$pkg" "$pkgver" "http://tcllib.sourceforge.net/" "tcl" "${pkgdeps}" "${pkgdesc}"
	done
) || retval=1

rm -rf "${WORKDIR}"

exit $retval

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

1
2
3
4
5
6
7






8
9
10
11
12
13
14
#! /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}"
PLATDIR="$(pwd)/out/${PLATFORM}"







>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /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=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}"
PLATDIR="$(pwd)/out/${PLATFORM}"