Click to See Complete Forum and Search --> : source based debian


ruwach
02-20-2004, 05:48 PM
Hey there guys,

i was wanting to know if once i install debian, can i install certain packages by compiling them with my own gcc flags for my own hardware.
i have used debian a lot before, and do not need to compile everything all at once, but i would like the speed difference on certain more resource intensive apps.

i have tried a couple of source based distros, but i have some trouble with them because i just don't know what i am doing well enough to make them work exactly the way i want.

if i have a debian package installed, can i remove it and then install it via source? would it have the same configuration settings ( if i do not alter them ) as the .deb file does?

thanks for any helpfull info.

mdwatts
02-21-2004, 12:32 PM
Moving to the Software forum since Installation is actually meant for distro install related problems.

knute
02-21-2004, 12:44 PM
It's no problem to get the sources.

All you need to do is to have lines like these (actually they are the uncommented ones from my own scources.list):
deb-src ftp://ftp.us.debian.org/debian stable main contrib non-free
deb-src ftp://ftp.us.debian.org/debian testing main contrib non-free
deb-src ftp://ftp.us.debian.org/debian unstable main contrib non-free
deb-src http://debian.uchicago.edu/debian stable main contrib non-free
deb-src http://debian.uchicago.edu/debian testing main contrib non-free
deb-src http://debian.uchicago.edu/debian unstable main contrib non-free
deb-src http://www.rcpt.to/ non-patent main
deb-src http://www.rcpt.to/ pending main
deb-src http://www.fbriere.net/debian/dists/stable ./
deb-src http://www.fbriere.net/debian/dists/testing ./
deb-src http://www.fbriere.net/debian/dists/unstable ./

If you want to cut and paste into your /etc/apt/sources.list you can. That's why I posted it the way that I did. :)

In order to use it, you would issue the command apt-get source <pacakge name>

HTH

ruwach
02-22-2004, 05:03 PM
Cool, thanks,

wont those just compile just like the regular i386 deb packages or will there be a difference in performance over the binary packages? is there a make.conf file where i can add compile options specific to my hardware? i tried this with apt-build, but only succeded with one package installing successfully. Still a bit new / buggy app.

thanks

sharth
02-22-2004, 06:24 PM
use apt-build(try the version from unstable), but other than that, I'm not sure beyond hacking up the ./debian/rules

[edits to make me understandable... kinda]

ruwach
02-22-2004, 07:26 PM
ok, cool enough, i will give -er a try.

knute
02-23-2004, 12:54 AM
apt-get source <package> will download the package and unpack the source, md5sum, and desc files to the current directory for you to configure/make/hack/install/whatever to.

HTH

ruwach
02-23-2004, 03:22 PM
ok, i will try that - so how do i get into whatever file i need to to put the -m3dnow and k6-2 and -fomit-frame-pointer kinda stuff in there, and will it also build the dependancies like that ?

is it a ./configure file or make file or how about the make.rules in debian?

thanks

mdwatts
02-23-2004, 03:27 PM
You can add the flags to /etc/profile as I have done for my Athlon-MP.

CHOST='athlon-linux-gnu'
CFLAGS='-march=athlon-mp -mcpu=athlon-mp -O3 -pipe'
CXXFLAGS='-march=athlon-mp -mcpu=athlon-mp -O3 -pipe'

export CHOST CFLAGS CXXFLAGS

knute
02-23-2004, 03:45 PM
Originally posted by ruwach
ok, i will try that - so how do i get into whatever file i need to to put the -m3dnow and k6-2 and -fomit-frame-pointer kinda stuff in there, and will it also build the dependancies like that ?

is it a ./configure file or make file or how about the make.rules in debian?

thanks

It's basically a tarball that get's downloaded and unpacked. So you apt-get source foo, and then want to go and compile it, you simply cd foo and then go about the normal process that you would with any tarball.

Because it IS a tarball, there aren't the dependencies associated with it. Of course if you don't have the appropriate libraries available, the compile will complain about it. :)

Best way to figure it out is to try it. ;)

ruwach
02-23-2004, 08:12 PM
ok then i will try it out. very little to be understood from google searches because most of it is over my head.

mdwatts , where do i add those lines, at the top or bottom of the script of text in there ?

i guess i will try with some smaller packages to see if it works!

knute
02-23-2004, 09:37 PM
Anywhere you add them in the script will set them.

Most times though, the variables are added at the beginning of the file, because when programming, you have to define the variable before you can use it, and since the script is read from top to bottom, the beginning is the appropriate place.

If you are planning on doing any programming or scripting or anything of that nature, it's probably best to get into the habit or you will run into problems later on, and the only thing that can be blamed is setting bad habits for yourself. :eek:

HTH

ruwach
02-23-2004, 10:23 PM
ok, here is what i have in /etc/profile. i keep getting seg faults, and i dont think that it is the hardware . ( i once had a source-based distro on this box a few weeks ago ) perhaps you could find where i am wrong in this thing.

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
CHOST='i586-pc-linux-gnu'
CFLAGS='-march=k6-2 -02 -pipe -fomit-frame-pointer'
CXXFLAGS='-march=k6-2 -02 -pipe -fomit-frame-pointer'
export CHOST CFLAGS CXXFLAGS
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"

if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi

export PATH

umask 022

knute
02-24-2004, 02:06 AM
What's the exact message?

Believe it or not, error messages in linux actually MEAN something. :D

sharth
02-24-2004, 08:18 AM
Just as a fyi. gentoo for example, will strip out certain use variable or optimazations from the compiles, since they can make the software unstable...

so... try compiling whatever you're attempting (what is it anywho?) without any optimizations, or look at a gentoo ebuild for it, and look around there.

ruwach
02-24-2004, 11:44 AM
ok guys, i will give it a shot.
some of the reason i want to do this is to get some optimization going (kinda to see if i can) and partly to learn more about how to do all of this.
Of almost all distros i have tried, i keep returning to debian. it just seems to go smoothest with my system.

by the way, what is foo? what does it do?

thanks guys

knute
02-24-2004, 01:10 PM
ROFLMAO

Foo is a generic type term that is used in many many examples along with bar.

If I remember correctly, it came from the infamous acronym FUBAR (Fouled Up Beyond All Recognition).

ruwach
02-24-2004, 02:46 PM
ok. nuther question,
how do i look at the ebuild of an application?
and when i do, what do i look for?

thanks