Personal autobuilder (Re: athlon-builder ... a sequel to pentium-builder)
Glenn <email@example.com> 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.
#copyright 2001 Junichi Uekawa
#distributed under the conditions of GPL version 2 or later
CHROOTEXEC="chroot $BUILDPLACE "
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
tar xfzp $BASETGZ
mkdir -p $BUILDPLACE/tmp/buildd
for a in passwd hosts hostname resolv.conf; do
cp /etc/$a $BUILDPLACE/etc/$a;
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
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
#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