source: trunk/debathena/third/openafs/build-openafs @ 22775

Revision 22775, 2.2 KB checked in by ghudson, 17 years ago (diff)
* debathena/third/openafs/hacked-arch/arch, debathena/third/openafs/genchanges.sh: Import supporting files I failed to include previously. * debathena/third/openafs/build-openafs: Use current working directory to find supporting files. Also fix a syntax error in a conditional. * debathena/third/openafs/upload-openafs: Allow apt repository location to be overridden with $DEBATHENA_APT.
  • Property svn:executable set to *
RevLine 
[22702]1#!/bin/sh
2set -x
3
4tmpdir=$(mktemp -d -t "build-openafs.$$.XXXXXXXXXX") || exit $?
5trap 'rm -rf "$tmpdir"' EXIT
6
7while read dist kernels; do
8    for kernel in $kernels; do
9        kversion=$(echo "$kernel" | sed 's/^.*-headers-//')
10        echo "Building for kernel $kversion..."
11        mkdir -p "$tmpdir/$dist/$kversion"
[22775]12        here=$(pwd)
[22702]13        schroot -c "$dist-sbuild" -u root -- sh -xec "
14            #echo 'deb http://localhost:9999/ubuntu edgy-backports main restricted universe multiverse' >> /etc/apt/sources.list
15            #echo 'deb-src http://localhost:9999/ubuntu edgy-backports main restricted universe multiverse' >> /etc/apt/sources.list
16            apt-get -y update
17            apt-get -y install module-assistant '$kernel'
18            module-assistant -i -t -l '$kversion' get openafs
19            module-assistant -i -t -l '$kversion' unpack openafs
20            touch \"/usr/src/openafs-modules-${kversion}_\$(dpkg-query --showformat='\${Version}' --show openafs-modules-source)+\$(dpkg-query --showformat='\${Version}' --show '$kernel')_$(echo "$dist" | sed 's/.*-//').changes.pt\"
21            trap \"mv /var/cache/modass/*buildlog* '$tmpdir/$dist/$kversion'\" EXIT
22            eval \"\$(dpkg-architecture)\"
23            if [ \"\$DEB_HOST_ARCH\" != amd64 ] && fgrep -x CONFIG_X86_64=y '/lib/modules/${kversion}/build/.config'; then
24                apt-get -y install binutils-multiarch util-linux
25                type linux64 >/dev/null || apt-get -y install linux32
26                export KPKG_ARCH=amd64
27                export PERSONALITY=linux64
[22775]28                export PATH=$here/hacked-arch:\$PATH
[22702]29            fi
30            if ! [ -e /usr/src/modules/openafs/debian/genchanges* ]; then
[22775]31                install -m a=rx,u+w $here/genchanges.sh /usr/src/modules/openafs/debian/               
[22702]32            fi
[22775]33            if [ \"$dist\" = \"lenny-i386\" -o \"$dist\" = \"lenny-amd64\" ]; then
34                install -m a=rx,u+w $here/genchanges.sh /usr/src/modules/openafs/debian/genchanges
[22702]35            fi
36            $PERSONALITY SIGNCHANGES=1 module-assistant -i -t -l '$kversion' auto-build openafs
37            mv /usr/src/openafs-modules* '$tmpdir/$dist/$kversion'" \
38            </dev/null
39        if [ $? -ne 0 ]; then
[22775]40            echo "$dist $kernel" >> $here/failed.log
[22702]41        fi
42        mkdir -p "$dist"
43        mv "$tmpdir/$dist/$kversion"/* "$dist"/
44        rm "$tmpdir/$dist/$kversion" -rf
45    done
46done
Note: See TracBrowser for help on using the repository browser.