[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: CPU specific/optimized Debian builds ?



On Thursday 23 May 2002 13:37, Renaud Guerin wrote:
> Hi,
>
> I was having a look at Gentoo Linux the other night, and their principle of
> rebuilding your own packages with your chosen gcc -O & -march flags.
>
> I got wondering, how one should go about rebuilding from source a whole
> debian installation in a similar way ?
> Anybody did this before, or are there any significant hurdles that prevent
> automating this process ?

There are easily could be some, like the issue that woody's build-depends are 
not satisfied within woody, there might be broken (or none) build-depend 
field in the control file and perhaps some more. Basically you need to do 
something like the following:
(do NOT run it is not tested and it's lame, just read)

#!/bin/sh
############# variables #############
# directory to store the sources
SRCDIR=SOURCES
# temporary file containing selected packages
SELECT=selections.tmp
#####################################


if [ -d $SRCDIR ]; then
     cd $SRCDIR
     # clean it ?
     rm -rf *
else
  mkdir $SRCDIR
     cd $SRCDIR
fi

# let's see what's new in the archive,
# make sure you have deb-src lines in your sources.list
# apt-get update

# get local selections

dpkg --get-selections | grep -w 'install' | \
awk '{print $1}' > ../$SELECT

# fetch them 1 by 1 from the archive and build

for I in `cat ../$SELECT`; do

# we need to prepare Build-Depends (from control file)
# to satisfy the compile conditions

apt-get build-dep $I;

# now it's safe to build the package in question

apt-get -b source $I;

# remove each source after being built ???

rm -rf *
done


You may also consider using auto-apt (see man howto to keep updated its db) 
during the compile and linkage. Really nice tool, which will ask you to 
install the package(s) that provide missing build deps.

Yet another issue is how you can pass build options (let's say the disirable 
CFLAGS) to apt-get -b or auto-apt commands. I know you can pass some 
variables to dpkg, but have never experimented that with apt, for example:

COLUMNS=140 dpkg -l | grep package

so, the question is can we do something like:

CFLAGS="bla bla bla"  apt-get -b package 

or there are some features I'm missing here ? 

-- 
Greets,
fr33zb1


-- 
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: