Click to See Complete Forum and Search --> : source vs rpm's


happybunny
02-19-2004, 06:14 PM
If I have the source code for an application, is it certian to run on my distro?

I am just trying to get straight why I would want the source code over an RPM.

If someone has not built an RPM for my distro, can I get the source and compile it into my kernel? Is there source could for each distro or is source code source code? Is that the beauty of the source code, that it doesn't matter the distro?

Just curious

Uranus
02-19-2004, 06:19 PM
Check the software-building howto (specifically: http://tldp.org/HOWTO/Software-Building-HOWTO-4.html). It probably contains whatever you want to know.

maccorin
02-19-2004, 06:31 PM
1) from a technical standpoint, yes it is better because of compatibility

compiling the source code nativly on your computer allows a program to (sometimes) transcend not only distro, but operating system (Windows/Linux/BSD) and computer architecture as well. Assuming it isn't reliant on a specific "feature".

also you can fix it if your a programmer and it's broke :D

2) for a philosophical reason, search for stallmans paper called "The right to read"

sharth
02-19-2004, 06:46 PM
Okay. First off, your question is actually asking what the differance between what a binary and what source code is.

source code is basically human readable code that a compiler will convert into machine readable code. (the machine readable code is a binary). Source code, (unless its an interpreted language such as php), is not executable by a computer either.

binaries are basically compiled copies of the source code. They are the basis for running calculators, email clients, web clients and so on. they contain teh servers and teh clients.. Basically, all programs are binaries.

The kernel is a special binary. It's purpose is basically to work as an interface between the hardware and software. But thats it. So, generally, unless you're adding support for some new piece of hardware, you should be able to leave the kernel alone. compiling software (such as apache) does not require you to even consider the kernel.

The source code is mostly available for developers. You generally don't need it.

rpms and debs are simply packages containing either source code or binaries. generally, src.rpms will contain src, rpms (no .src. in it) will contain binaries. rpms are for red hat derived distros (suse, fedora, mandrake...). debian (and knoppix and lindows and other debian derived distros) use .deb, (which contains binaries only... generally). the source code in debian is stored in tgzs (gzipped tarred archives of the original src), and a diff, containing the differences from the original source and the debian version (including debian applied patches).

Generally, if you can get the source code for a program, you can atleast see how it works so you could create a program that would work on your operating system, if for whatever reason the publisher didn't support your os. However, if source is not available, then you are forced into using the operating systems that the publisher limits you to.

Another problem that can arise, is versioning differences and the location of libraries. Even though the fhs states taht certain libraries and binaries should goto certain places, there is still a bit of variance between distros. Also, version 2.2.5 of libc is not always compatible with say version 2.1.1 of libc6. So recompilations of the software against these newer packages are needed.

Generally, whoever puts out the distro will take care of this in packaging scripts and what not.

More or less, just go with binaries and don't worry about the source code. If you don't know how to program, then you really don't need to worry about it.

There is usually one single location that each program will offer the source code (if they do, not all programs are gpled or what not. some programs, such as yast are not free). This is usually on the home site of the program. However, the distro is also generally supposed to provide the source code, and also provide any patches that they may apply to the source code.

Just because you have the source code to a program does not mean it will run in your distro. It could be source code to a windows only program (visual basic, a programming language, is restricted to windows, although i believe there are attempts to port it). Also, there is again the lack of libraries existing on your computer (notice that when you install an rpm, or deb, it will ask for dependencies...).

I believe that should kinda answer some of the stuff you were wondering about...

happybunny
02-19-2004, 09:26 PM
thanks for the great reply!

I will have to re-re-read it to get it all but thanks!