Personal autobuilder (Re: athlon-builder ... a sequel to pentium-builder)
Glenn <bug1@optushome.com.au> immo vero scripsit
> > Yes, this is a bit problematic.
> > I was thinking that maybe everything can be rebuilt using Athlon optimization, and
> > I could make a local repository,
>
> I would like to do that to :)
I was looking at autobuilders, and they were rather non-trivial to use.
And thus I decided to code some.
It uses chroot, and debootstrap-generated base tarball.
It's a hack, but it kinda works.
#!/bin/bash
# build-package.sh
#copyright 2001 Junichi Uekawa
#distributed under the conditions of GPL version 2 or later
export LANG=C
export LC_ALL=C
PACKAGENAME=$1
BASETGZ=/home/dancer/tmp/base.tgz
MYREPOSITORY=path-to-your-personal-repository
MYREPOSITORYHTTP=http://path-to-your-personal-repository-via-http
EXTRAPACKAGES=gcc3.0-athlon-builder
export DEBIAN_BUILDARCH=athlon
BUILDPLACE=path-to-your-building-location
CHROOTEXEC="chroot $BUILDPLACE "
cd $MYREPOSITORY
echo Initializing repository
dpkg-scanpackages . . | gzip > Packages.gz
dpkg-scansources . . | gzip > Sources.gz
echo cleaning the build env
rm -rf $BUILDPLACE
echo building the build env
mkdir -p $BUILDPLACE
cd $BUILDPLACE
tar xfzp $BASETGZ
mkdir -p $BUILDPLACE/tmp/buildd
for a in passwd hosts hostname resolv.conf; do
cp /etc/$a $BUILDPLACE/etc/$a;
done
echo Installing apt-lines
cat > $BUILDPLACE/etc/apt/sources.list << EOF
deb $MYREPOSITORYHTTP ./
deb-src $MYREPOSITORYHTTP ./
deb http://www.jp.debian.org/debian unstable main contrib non-free
deb-src http://www.jp.debian.org/debian unstable main contrib non-free
EOF
echo Refreshing the base.tgz
$CHROOTEXEC /usr/bin/apt-get update
$CHROOTEXEC /usr/bin/dpkg --purge lilo
$CHROOTEXEC /usr/bin/apt-get -y dist-upgrade
$CHROOTEXEC /usr/bin/apt-get -y install build-essential dpkg-dev apt $EXTRAPACKAGES
$CHROOTEXEC /usr/bin/apt-get clean
cd $BUILDPLACE
#tar cfz $BASETGZ *
echo Installing the build-deps and building
$CHROOTEXEC /bin/sh -c "(cd tmp/buildd; apt-get -y build-dep $PACKAGENAME ; apt-get -y source --build $PACKAGENAME || rm /tmp/buildd/* )"
echo Installing $BUILDPLACE/tmp/buildd/* to archive
cp $BUILDPLACE/tmp/buildd/* $MYREPOSITORY
--
dancer@debian.org http://www.netfort.gr.jp/~dancer
Reply to: