Skip to content


How to build rpm packages

Today I am going to show you how to create an environment for building rpm packages. Once you have your rpm environment set up I will show you how to create a haproxy rpm for your CentOS 5.5 version.

Setting up your system environment takes 6 steps:

  1. Install Development Tools
  2. Install rpmdevtools ( found on epel repository ).  The installation of EPEL repository is not part of this presentation. Find out how to install it here.
  3. Install rpmlint ( used to catch errors earlier in the .spec file )
  4. Create a rpmbuilder account
  5. Create the rpm tree
  6. Create a rpm package from an existent spec file for your CentOS specific version.

Setting up the rpm environment

1. Install Development Tools

# yum groupinstall “Development Tools

2. Install rpmdevtools

# yum –enablerepo=epel install rpmdevtools

3. Install rpmlint

# yum –enablerepo=epel install rpmlint

4. Create a rpmbuilder account

# useradd rpmbuilder

# passwd rpmbuilder <password>

You should never use root to create rpm packages. It is a security risk creating rpm packages as root user.

5. Create the rpm tree

# sudo -u rpmbuilder -i
# rpmdev-setuptree

6. Create a rpm package from an existent spec file for your CentOS specific version.

On this step I will show you how to create a RPM Package for Haproxy (HAProxy – High Performance TCP/HTTP Load Balancer).
Please read the article on how to create a haproxy RPM Package for CentOS 5.5. ( to be written )

Leonardo

Posted in Knowledge Base.

Tagged with , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.