[CentOS] Building packages using RPMBUILD

Keith Roberts keith at karsites.net
Fri Dec 17 21:14:00 UTC 2010


On Thu, 16 Dec 2010, Akemi Yagi wrote:

> To: CentOS mailing list <centos at centos.org>
> From: Akemi Yagi <amyagi at gmail.com>
> Subject: Re: [CentOS] Building packages using RPMBUILD
> 
> On Thu, Dec 16, 2010 at 8:11 AM, Keith Roberts <keith at karsites.net> wrote:
>>
>> I had already installed the packages mentioned in the Centos
>> wiki.
>
> I assume you are referring to this wiki:
>
> http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment
>
> If not, I strongly recommend reading it through. Up front it warns you
> to not do the build as root. It provides the details for setting up
> the build environment which will help you understand the whole
> process. Installing some rpms may be convenient but you may miss the
> chance of learning. :-)

I have followed the above tutorial, which was well written, 
and easy to understand.

Then I started on this one, linked to from the above Wiki 
page:

Building Source RPM as non-root under CentOS

http://www.owlriver.com/tips/non-root/

Got up to here:

Let's build something -- As a simple example, we have a 
local SRPM copy of the 'joe' text editor at a permanent 
location (backup is here). Let's get a copy and build it as 
non root [we have numbered the lines, so that we may refer 
to specifics after we are done]:

1 [herrold at dhcp-233 ~]$ cd
2 [herrold at dhcp-233 ~]$ mkdir build
3 [herrold at dhcp-233 ~]$ cd build
4 [herrold at dhcp-233 build]$ mkdir joe
5 [herrold at dhcp-233 build]$ cd joe
6 [herrold at dhcp-233 joe]$ joe README
7 [herrold at dhcp-233 joe]$ wget 
ftp://ftp.owlriver.com/pub/mirror/ORC/joe/joe-2.9.8-4.src.rpm
8 [herrold at dhcp-233 joe]$ rpmbuild --rebuild 
joe-2.9.8-4.src.rpm

In reviewing the commands above, we did this:

    1. Move to the home directory
    2. Make the ~/build/ subdirectory
    3. Move into the ~/build/ subdirectory
    4. Make the ~/build/joe/ subdirectory
    5. Move into ~/build/joe/ subdirectory
    6. Update our notes in the README
    7. Retrieve the SRPM using wget
    8. Build the binary RPM

When we inspect: ~/rpmbuild/RPMS/i386/ we find the binary 
file: joe-2.9.8-4.i386.rpm

...

and the build process works OK! I had to install 
ncurses-devel (did that as root) for joe to build OK.

Then I did my new sox program, which built fine first 
time. So I well pleased to have rebuilt 2 src.rpm files.

Now I know my build environment works OK, I can try 
building some other packages, by editing their spec files.

Thanks to everyone for all the help I received with this.

Looks like there might be another third party Centos repo 
on the horizon soon ;)

I guess I'll get my head down with another pass at 
MaximumRPM now.

Kind Regards,

Keith Roberts

-- 
In theory, theory and practice are the same;
in practice they are not.

This email was sent from my laptop with Centos 5.5



More information about the CentOS mailing list