How To Build Red Hat Enterprise IPA RPMs For CentOS 5

FreeIPA has existed for some time as RHE IPA for Red Hat Linux and has been added into Fedora. Still, since it is an extra add-on to RHEL, CentOS hasn't gotten it rebuilt yet. That's a shame because FreeIPA is an easy to configure, easy to manage security information management solution. If, like me, you want to use IPA with CentOS, this tutorial is for you.

 

Assumptions

  • You have installed Centos 5.2 with at least the minimal package set (unchecked everything during install) and that you have fully updated it with CentOS's repositories.
    • I built these RPMs on a 32-bit i386 system but I imagine building them on x86_64 or others would be very similar
  • You have a basic working knowledge of Linux commands (moving files, etc)
  • You are running the following as root
  • Red Hat, CentOS, and EPEL haven't moved all of these packages to some excitingly new and obscure location. If so, you may have to Google a bit to find them all.

 

Download and install centos-ds rpm

  1. CentOS and EPEL have already compiled some of the necessary packages. Why rebuild packages if someone else has already done the work for you? This way they'll also update down the road if updates are added into the repositories!
  2. Create a file at /etc/yum.repos.d/CentOS-testing.repo with the following contents:
    [testing]
    name=CentOS-$releasever - Testing
    baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
    gpgcheck=1
    enabled=1
    gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
    
  3. Run the following commands to download and install some of the existing RPMs:
    rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
    yum install centos-ds-base-devel centos-ds centos-ds-admin-console python-psycopg2
    rm /etc/yum.repos.d/CentOS-testing.repo
    yum clean all

 

Download the source packages from RedHat

  1. Run the following commands to download the necessary SRPMS:
    mkdir ~/srcbuild; cd ~/srcbuild/
    wget -r -l 1 http://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/RHEIPA/SRPMS/
    mv ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/RHEIPA/SRPMS/*.rpm .
  2. Remove RPMs we won't need
    • Remove older versions of rpms (ex: if there are 3 versions of ipa, only keep the newest)
    • Also remove redhat-ds* since we already installed centos-ds
    • Remove python-psycopg2 since we installed that from EPEL

 

Use yum to get some necessary development packages

  1. Run the following command to download the required packages:
    yum install gcc gcc-c++ automake autoconf rpm-build mozldap-devel openssl-devel openldap-devel krb5-devel nss-devel libcap-devel python-devel libtool selinux-policy-devel python-setuptools-devel bison flex ncurses-devel texinfo tetex-latex pam-devel httpd-devel apr-devel apr-util-devel postgresql-devel sqlite-devel

 

Build TurboGears and the krb5 packages first

  1. Run the following commands:
    rpmbuild --rebuild TurboGears*.rpm krb5-server-ldap*.rpm python-kerberos python-tgexpandingformwidget*.rpm mod_nss*.rpm
    • There will be quite a bit of output to the console while you do this - don't let that scare you. If there is an error, rpmbuild will stop running and tell you something was missing.
  2. If rpmbuild fails to build the package because you are missing a package, perform a "yum search" for the package, install it, and try the above command again.
  3. When rpmbuild finishes without errors, it will print "exit 0" to the screen and then stop outputting information
  4. When rpmbuild is done, you can install TurboGears with the following command:
    yum install /usr/src/redhat/RPMS/*/*.rpm

 

Build IPA

  1. We'll also build IPA on its own since it requires a small modification. To start, run these commands:
    rpm -Uvh ipa-*.src.rpm
    rm ipa-*.src.rpm
    cd /usr/src/redhat/SPECS/
    mv ipa.spec ipa.spec.save
    sed -e "s/redhat-ds/centos-ds/g" ipa.spec.save > ipa.spec
    rpmbuild -bb ipa.spec
  2. If there are errors when building, try to install the missing packages with yum and run the rpmbuild command again. Once it completes, install all of the packages we've built so far with the following command:
    yum install /usr/src/redhat/RPMS/*/*.rpm

 

Build the rest of the rpms

  1. At this point we're finally ready to build the rest of the RPMs needed for IPA to work correctly. Build them with the following commands:
    cd ~/srcbuild/
    rpmbuild --rebuild *.rpm
  2. This may fail a few times just like the other times. Repeat as needed.

 

Find the rpms

  1. The finished RPMs are all located in /usr/src/redhat/RPMS/. For a list of all of them, you can run the following command:
    find /usr/src/redhat/|grep "rpm$"
  2. Move or copy the RPMs somewhere you can find them. You'll need some of these for the IPA client machines and all of them if you want to install multiple IPA servers so keep all of them.
  3. Remember that you downloaded the centos-ds and other RPMs from testing and EPEL. You'll need to download them or add in the testing and EPEL repos for clients so they can get all of the packages.
  4. If you have a spacewalk server, you can now rhnpush the RPMs into it and use yum for any future clients and servers!

 

Configure the server and clients using Red Hat's documentation

  1. I won't go into documenting the configuration process as that has been very well done by Red Hat already. Their documentation is located at http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_IPA/
  2. Of particular importance are the Installation and Deployment Guide and the Client Configuration Guide
Share this page:

12 Comment(s)