Overview
Comment: | Added package building branch |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | packages |
Files: | files | file ages | folders |
SHA1: | 07e806db4e87e864c4191a55839f04ca82bdc06c |
User & Date: | rkeene on 2014-09-18 04:43:37 |
Other Links: | manifest | tags |
Context
2014-09-18
| ||
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 | |
Changes
Added packages/build version [e94c49a608].
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 + dynlinker=/opt/appfs/ 42 +DYNLINKER=/uri/0install/sw.oc9.org/`readlink /uri/0install/sw.oc9.org/lib/ld-linux.so.2 | sed s@^\.\./@@` 43 +LDFLAGS="-march=i486 ${ZEXTRALIB} -L/uri/0install/sw.oc9.org/lib -Wl,--rpath -Wl,/uri/0install/sw.oc9.org/lib -Wl,--dynamic-linker -Wl,${DYNLINKER}" 44 +CXXINCLUDES=/uri/0install/sw.oc9.org/include/c++/`ls -1 /uri/0install/sw.oc9.org/include/c++ | sed 's@.*@&. |&@;s@\(|.*\)\(\.\)@\1,@g;s@^@.@;s@\.@..@g;s@\.\([0-9]\)\.@.00\1\.@g;s@\.\([0-9][0-9]\)\.@.0\1.@g;s 45 +@\.\.@.@g;s@^\.@@;s@\.$@@' | sort | tail -1 | cut -f 2- -d '|' | sed s@,@.@g` 46 + 47 +echo "CFLAGS='-march=i486 ${ZEXTRAINC} -I/uri/0install/sw.oc9.org/include'" 48 +echo "CXXFLAGS='-march=i486 ${ZEXTRAINC} -I${CXXINCLUDES} -I${CXXINCLUDES}/i486-pc-linux-gnu'" 49 +echo "CPPFLAGS='${ZEXTRAINC} -I/uri/0install/sw.oc9.org/include -I${CXXINCLUDES} -I${CXXINCLUDES}/i486-pc-linux-gnu'" 50 +echo "LDFLAGS='${LDFLAGS}'" 51 +echo "CC='gcc'" 52 +echo "PATH='${ZEXTRAPATH}:/uri/0install/sw.oc9.org/bin:`fix_path ${PATH} sw.oc9.org`'" | fix_path 53 +echo "LD_RUN_PATH='${ZBUILDPATH}:/uri/0install/sw.oc9.org/lib:`fix_path ${LD_RUN_PATH} sw.oc9.org`'" | fix_path 54 +echo "LD_LIBRARY_PATH='/uri/0install/sw.oc9.org/lib:`fix_path ${LD_LIBRARY_PATH} sw.oc9.org`'" | fix_path 55 +echo "PKG_CONFIG_PATH='${ZBUILDPATH}/lib/pkgconfig:/uri/0install/sw.oc9.org/lib/pkgconfig:`fix_path ${PKG_CONFIG_PATH} sw.oc9.org`'" | fix_path 56 +echo "MANPATH='${ZBUILDPATH}/man:/uri/0install/sw.oc9.org/man:`fix_path ${MANPATH} sw.oc9.org`'" | fix_path 57 +echo "export CFLAGS CPPFLAGS LDFLAGS PATH LD_LIBRARY_PATH LD_RUN_PATH PKG_CONFIG_PATH MANPATH CC" 58 + 59 + ./configure --prefix="${prefix}" --sysconfdir=/etc --localstatedir=/var 60 +} 61 + 62 +function prebuild() { 63 + : 64 +} 65 + 66 +function postbuild() { 67 + : 68 +} 69 + 70 +function build() { 71 + grep "DESTDIR" Makefile || die "Don't know how to build this software" 72 + 73 + make 74 +} 75 + 76 +function preinstall() { 77 + : 78 +} 79 + 80 +function postinstall() { 81 + : 82 +} 83 + 84 +function install() { 85 + make install DESTDIR="${destdir}" 86 +} 87 + 88 +function cleanup() { 89 + cd "${workdir}" || exit 1 90 + cd .. || exit 1 91 + rm -rf "${workdir}" 92 +} 93 + 94 +function die() { 95 + local message 96 + 97 + message="$1" 98 + 99 + if [ -n "${message}" ]; then 100 + echo "error: ${message}" >&2 101 + fi 102 + 103 + cleanup 104 + 105 + exit 1 106 +} 107 + 108 +cd "$(dirname "$(which "$0")")" || exit 1 109 + 110 +if [ -f 'build.conf' ]; then 111 + . 'build.conf' 112 +fi 113 + 114 +if [ -d "pkgs/${pkg}" ]; then 115 + pkgdir="pkgs/${pkg}" 116 + pkgfile="${pkgdir}/info" 117 +else 118 + pkgfile="pkgs/${pkg}" 119 + pkgdir="${pkgfile}" 120 +fi 121 +pkgdate="$(find "${pkgdir}" -type f -printf '%TY%Tm%Td%TH%TM.%TS\n' | cut -f 1-2 -d '.' | sort -n | tail -n 1)" 122 + 123 +. "${pkgfile}" 124 + 125 +archivedir="$(pwd)/ARCHIVE" 126 +workdir="workdir-$$${RANDOM}${RANDOM}${RANDOM}" 127 +mkdir "${workdir}" "${archivedir}" 128 +cd "${workdir}" || exit 1 129 +workdir="$(pwd)" 130 + 131 +# Download 132 +## Cleanup 133 +rm -f src.new src 134 + 135 +## Fetch file 136 +wget -O src.new "${url}" || exit 1 137 + 138 +## Verify signature 139 +### XXX:TODO 140 + 141 +## Move file into place 142 +mv src.new src 143 + 144 +# Decompress archive 145 +## Determine type of archive 146 +case "${url}" in 147 + *.tar.xz|*.tar.xz'?'*|*.txz) 148 + decompress='xz' 149 + ;; 150 + *.tar.gz|*.tar.gz'?'*|*.tgz) 151 + decompress='gzip' 152 + ;; 153 + *.tar.bz2|*.tar.bz2'?'*|*.tbz2) 154 + decompress='bzip2' 155 + ;; 156 + *.zip|*.zip'?'*) 157 + decompress='unzip' 158 + ;; 159 + *) 160 + echo "Unknown compression method: ${url}" >&2 161 + 162 + exit 1 163 + ;; 164 +esac 165 + 166 +## Do decompression 167 +case "${decompress}" in 168 + unzip) 169 + unzip 'src' || die 'Unable to uncompress archive' 170 + ;; 171 + *) 172 + "${decompress}" -dc src | tar -xf - || die 'Unable to uncompress archive' 173 + ;; 174 +esac 175 + 176 +## Cleanup source 177 +rm -f src 178 + 179 +# If we just have one directory, use that directory 180 +dir="$(echo *)" 181 +if [ -e "${dir}" ]; then 182 + mv "${dir}"/* . 183 +fi 184 + 185 +# Start logging 186 +set -x 187 + 188 +# Determine properties 189 +determinePrefix 190 + 191 +# Start the build 192 +preconfigure || die 'preconfigure failed' 193 +configure || die 'configure failed' 194 +postconfigure || die 'postconfigure failed' 195 + 196 +prebuild || die 'prebuild failed' 197 +build || die 'build failed' 198 +postbuild || die 'postbuild failed' 199 + 200 +preinstall || die 'preinstall failed' 201 +install || die 'install failed' 202 +postinstall || die 'postinstall failed' 203 + 204 +( 205 + appdir="$(appfsinstalldir)/${prefixsuffix}" 206 + mkdir -p "${appdir}" 207 + 208 + cd "${destdir}/${prefix}" || exit 1 209 + cp -rp * "${appdir}" 210 + find "${appdir}" -print0 | xargs -0 touch -t "${pkgdate}" 211 +) 212 + 213 +cleanup 214 + 215 +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 [50a79e3634].
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 + set -x 10 + mkdir BUILD 11 + cd BUILD 12 + 13 + ../configure --prefix="${prefix}" --sysconfdir=/etc --localstatedir=/var || return 1 14 + 15 + echo '# Ignore: DESTDIR' >> Makefile 16 +}
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=''