Changes On Branch f2ef882677a442d5

Changes In Branch packages Through [f2ef882677] Excluding Merge-Ins

This is equivalent to a diff from 17bbfdc417 to f2ef882677

2014-11-03
23:19
Updated packages branch to be a completely isolated branch check-in: 6136db979d user: rkeene tags: packages
2014-09-18
05:31
Added start of setting dynamic linker check-in: f2ef882677 user: rkeene tags: packages
05:14
Added support for a "platform" symlink pointing to the current platform check-in: 7ef423f980 user: rkeene tags: trunk
04:44
Removed extraneous set -x check-in: d4ba91a7e9 user: rkeene tags: packages
04:43
Added package building branch check-in: 07e806db4e user: rkeene tags: packages
2014-09-16
18:21
Removed blank line check-in: 17bbfdc417 user: rkeene tags: trunk
2014-09-14
04:36
Updated to normalize CPU/OS check-in: ee1a499a2e user: rkeene tags: trunk

Added packages/build version [9250a4fcfd].

            1  +#! /usr/bin/env bash
            2  +
            3  +pkg="$(echo "$1" | sed 's@/*$@@;s@^\.*/*@@')"
            4  +
            5  +if [ -z "${pkg}" ]; then
            6  +	echo "Usage: build <package>" 2>&1
            7  +
            8  +	exit 1
            9  +fi
           10  +
           11  +function determineOsArch() {
           12  +	os="$(uname -s | dd conv=lcase 2>/dev/null)"
           13  +	arch="$(uname -m | dd conv=lcase 2>/dev/null)"
           14  +
           15  +	case "${arch}" in
           16  +		i?86)
           17  +			arch='ix86'
           18  +			;;
           19  +	esac
           20  +}
           21  +
           22  +function determinePrefix() {
           23  +	determineOsArch
           24  +
           25  +	prefixsuffix="${pkg}/${os}-${arch}/${version}"
           26  +	prefix="/opt/appfs/${domain}/${prefixsuffix}"
           27  +	destdir="$(pwd)/INST"
           28  +
           29  +	mkdir "${destdir}" || die
           30  +}
           31  +
           32  +function preconfigure() {
           33  +	:
           34  +}
           35  +
           36  +function postconfigure() {
           37  +	:
           38  +}
           39  +
           40  +function configure() {
           41  +	glibcvers=2.20
           42  +	glibcdir="/opt/appfs/core.appfs.rkeene.org/glibc/platform/${glibcvers}"
           43  +	dynlinker="$(ls "${glibcdir}"/lib/ld-linux*.so.* | tail -n 1)"
           44  +
           45  +	CFLAGS="-I${glibcdir}/include"
           46  +	CPPFLAGS="-I${glibcdir}/include"
           47  +	LDFLAGS="-Wl,--rpath,${glibcdir}/lib -Wl,--dynamic-linker,${dynlinker}"
           48  +	export CFLAGS CPPFLAGS LDFLAGS
           49  +
           50  +	./configure --prefix="${prefix}" --sysconfdir=/etc --localstatedir=/var
           51  +}
           52  +
           53  +function prebuild() {
           54  +	:
           55  +}
           56  +
           57  +function postbuild() {
           58  +	:
           59  +}
           60  +
           61  +function build() {
           62  +	grep "DESTDIR" Makefile || die "Don't know how to build this software"
           63  +
           64  +	make
           65  +}
           66  +
           67  +function preinstall() {
           68  +	:
           69  +}
           70  +
           71  +function postinstall() {
           72  +	:
           73  +}
           74  +
           75  +function install() {
           76  +	make install DESTDIR="${destdir}"
           77  +}
           78  +
           79  +function cleanup() {
           80  +	cd "${workdir}" || exit 1
           81  +	cd .. || exit 1
           82  +	rm -rf "${workdir}"
           83  +}
           84  +
           85  +function die() {
           86  +	local message
           87  +
           88  +	message="$1"
           89  +
           90  +	if [ -n "${message}" ]; then
           91  +		echo "error: ${message}" >&2
           92  +	fi
           93  +
           94  +	cleanup
           95  +
           96  +	exit 1
           97  +}
           98  +
           99  +cd "$(dirname "$(which "$0")")" || exit 1
          100  +
          101  +if [ -f 'build.conf' ]; then
          102  +	. 'build.conf'
          103  +fi
          104  +
          105  +if [ -d "pkgs/${pkg}" ]; then
          106  +	pkgdir="pkgs/${pkg}"
          107  +	pkgfile="${pkgdir}/info"
          108  +else
          109  +	pkgfile="pkgs/${pkg}"
          110  +	pkgdir="${pkgfile}"
          111  +fi
          112  +pkgdate="$(find "${pkgdir}" -type f -printf '%TY%Tm%Td%TH%TM.%TS\n' | cut -f 1-2 -d '.' | sort -n | tail -n 1)"
          113  +
          114  +. "${pkgfile}"
          115  +
          116  +archivedir="$(pwd)/ARCHIVE"
          117  +workdir="workdir-$$${RANDOM}${RANDOM}${RANDOM}"
          118  +mkdir "${workdir}" "${archivedir}"
          119  +cd "${workdir}" || exit 1
          120  +workdir="$(pwd)"
          121  +
          122  +# Download
          123  +## Cleanup
          124  +rm -f src.new src
          125  +
          126  +## Fetch file
          127  +wget -O src.new "${url}" || exit 1
          128  +
          129  +## Verify signature
          130  +### XXX:TODO
          131  +
          132  +## Move file into place
          133  +mv src.new src
          134  +
          135  +# Decompress archive
          136  +## Determine type of archive
          137  +case "${url}" in
          138  +	*.tar.xz|*.tar.xz'?'*|*.txz)
          139  +		decompress='xz'
          140  +		;;
          141  +	*.tar.gz|*.tar.gz'?'*|*.tgz)
          142  +		decompress='gzip'
          143  +		;;
          144  +	*.tar.bz2|*.tar.bz2'?'*|*.tbz2)
          145  +		decompress='bzip2'
          146  +		;;
          147  +	*.zip|*.zip'?'*)
          148  +		decompress='unzip'
          149  +		;;
          150  +	*)
          151  +		echo "Unknown compression method: ${url}" >&2
          152  +
          153  +		exit 1
          154  +		;;
          155  +esac
          156  +
          157  +## Do decompression
          158  +case "${decompress}" in
          159  +	unzip)
          160  +		unzip 'src' || die 'Unable to uncompress archive'
          161  +		;;
          162  +	*)
          163  +		"${decompress}" -dc src | tar -xf - || die 'Unable to uncompress archive'
          164  +		;;
          165  +esac
          166  +
          167  +## Cleanup source
          168  +rm -f src
          169  +
          170  +# If we just have one directory, use that directory
          171  +dir="$(echo *)"
          172  +if [ -e "${dir}" ]; then
          173  +	mv "${dir}"/* .
          174  +fi
          175  +
          176  +# Start logging
          177  +set -x
          178  +
          179  +# Determine properties
          180  +determinePrefix
          181  +
          182  +# Start the build
          183  +preconfigure || die 'preconfigure failed'
          184  +configure || die 'configure failed'
          185  +postconfigure || die 'postconfigure failed'
          186  +
          187  +prebuild || die 'prebuild failed'
          188  +build || die 'build failed'
          189  +postbuild || die 'postbuild failed'
          190  +
          191  +preinstall || die 'preinstall failed'
          192  +install || die 'install failed'
          193  +postinstall || die 'postinstall failed'
          194  +
          195  +(
          196  +	appdir="$(appfsinstalldir)/${prefixsuffix}"
          197  +	mkdir -p "${appdir}"
          198  +
          199  +	cd "${destdir}/${prefix}" || exit 1
          200  +	cp -rp * "${appdir}"
          201  +	find "${appdir}" -print0 | xargs -0 touch -t "${pkgdate}"
          202  +)
          203  +
          204  +cleanup
          205  +
          206  +exit 0

Added packages/build.conf version [501534cf12].

            1  +domain=rkeene.org
            2  +function appfsinstalldir() {
            3  +	case "${domain}" in
            4  +		rkeene.org)
            5  +			echo "/web/rkeene/appfs/applications"
            6  +			;;
            7  +		appfs.rkeene.org)
            8  +			echo "/web/customers/appfs.rkeene.org/appfs/applications"
            9  +			;;
           10  +		core.appfs.rkeene.org)
           11  +			echo "/web/static/core.appfs.rkeene.org/appfs/applications"
           12  +			;;
           13  +	esac
           14  +}

Added packages/pkgs/glibc version [1517e291c9].

            1  +#! /usr/bin/env bash
            2  +
            3  +version=2.20
            4  +url="http://ftp.gnu.org/gnu/glibc/glibc-${version}.tar.xz"
            5  +domain=core.appfs.rkeene.org
            6  +sha256=''
            7  +
            8  +function configure() {
            9  +	mkdir BUILD
           10  +	cd BUILD
           11  +
           12  +	../configure --prefix="${prefix}" --sysconfdir=/etc --localstatedir=/var || return 1
           13  +
           14  +	echo '# Ignore: DESTDIR' >> Makefile
           15  +}

Added packages/pkgs/readline version [28079f5c74].

            1  +#! /usr/bin/env bash
            2  +
            3  +version=6.3
            4  +url="https://ftp.gnu.org/gnu/readline/readline-${version}.tar.gz"
            5  +domain=core.appfs.rkeene.org
            6  +sha256=''