Monday, 22 October 2012

Build from Source

Intro...

For this lab, I'm going to install two packages from GNU software collection and check the package build and process. It is also a preparation before I build my first SPEC file for Fedora package.

The packages I've picked are "which" and "hello".

So let me start with the software building environment preparation.

Preparation

1. Install development tools for software building process.


yum groupinstall "Development Tools" "Development Libraries"

 (Note: need to be root to perform yum installs)


2. Download which and hello packages from GNU software collection.

Which => http://carlo17.home.xs4all.nl/which/
Hello => http://www.gnu.org/software/hello/

3. Now we are ready to build our packages!

Building package


- Which is used for locating a program file in the user's path.

- Hello is a simple greeting program.

The following is how I built my packages. First, I unpacked the tarball file by using the following command.

 | tar -xvzf which-2.20.tar.gz


| tar -xvzf hello-2.8.tar.gz

Then I read through the INSTALL file inside each folder for the build instruction. And both of them use make to build. I need to run the configure script which configures the build environment for Fedora 17. Then compile the package by make command, finally use make install to install package.

The following screenshots show successful building results as well as the building time it takes for which and hello package.

| ./configure
* configure the build environment

which: 
hello:


| make

* build the package

which:
hello:



| make install

 * install package



Now the build of two packages are complete. The compilation and building speeds are different based on the the size of the package.

Here is the running output of using which and hello.


Done and done..

Overall the building process is fun. Even though it's more steps to do than simply using "yum install", I can understand the package building better. I didn't get stuck during whole process. But when I choose which GNU package I will install has taken me a long time. In the beginning I choose "dia" which is a drawing program to build. Then I got into a issue for the build environment. I didn't want to install the x window on my fedora since I have very limited disk space for this VM... So I choose the tiny "hello" package to build instead.


My next blog will talk about how to create an RPM package... See you...


No comments:

Post a Comment