Mecworks

2/12/2005

How to build RPMs for SuSE 9.2 x86_64

Filed under: Linux — marc @ 1:16 pm

There’s been some interest in both email and comments on how I create the RPMs for SuSE 9.2 x8664 which don’t come on the standard distribution or thoes that I create to bring my system up to the latest versions (A link for downloads of the files discussed in this article appear at the end). Although the discussion follows making gaim RPMs, the details here will help you build any RPM for SuSE Linux 9.2 x8664.

I’m not going to go into the specifics of writing spec files for Linux RPMs in this article. On thing I hate about so many of the technical books out there is that they waste an entire chapter (or more) on obtaining, installing, and configuring the program they are talking about instead of focusing on using the utility on which the book is based. It’s a waste of trees and due to the increased page count of the book, there’s a perceived reasoning on behalf of the publisher to artificially raise the price of the book. The section gets read at most once if ever and in my oppinion, is a waste of everyone’s time. The proper proceedure, in my oppinion is to refrence another title or provide suggestions on where to look on the web or other resource center for instructions (ie. www.rpm.org in the case of rpm…). I assume that most readers are intellegent enough to figure out a lot of things for themselves…. If you would like to read more about making RPMs for your system, please visit www.rpm.org, and check out the documentation and Maximum RPM. Maximum RPM is a bit dated but all the information for making basic RPMs is correct and contained therein.

First, if you’re going to make an RPM for a distro of your choice where one doesn’t exist already, you can create a spec file for your needs from scratch or not re-invent the wheel and start with an existing RPM spec file from another Linux ditribution. The latter is what I chose to do with the gaim and gaim-encryption RPMs I build for SuSE 9.2 x86_64. I went to the download section of gaim.sourceforge.net and downloaded the SRPM for gaim, then to gaim-encryption.sourceforge.net where I downloaded the same for the gaim-encryption RPM.

Dependancies for creation and runtime of an RPM are listed in the BuildRequires: and Requires: spec file tags. Different distributions create packages and sub-packages with different names. There is no (nor should there be, IMO) LSB specification on many of the upper level application package names on a distribution. Because of this, you might need to change the package names on either or both of these lines.

For SuSE 9.2, I have the following for the gaim.spec:

Requires: gtk2 >= 2.0.0, mozilla, audiofile, libao BuildRequires: libao-devel, gtk2-devel, libtool, audiofile-devel, pkgconfig, mozilla-devel

After making the changes above, the compile failed again but with an error saying that it could not find the right libraries to link agianst, refrenceing /usr/lib rather than /usr/lib64 for the 64 bit libraries.

You can tell configure what directories to use for paths by exporting the nessasery flags that are used by gcc/ld before calling confugure:

CFLAGS="$RPM_OPT_FLAGS -L/usr/lib64" LDFLAGS="-L/usr/lib64" ./confuigure...

At this point, the compile completes and I was able to install and run gaim! Whoo hoo! Or at least I thuoght… After installing this gaim plus it’s devel packages (needed to compile any plugins) , I was ready to go through the same steps with the gaim-encryption RPM only to find out that the gaim-encryption plugin was not recognized by gaim after doing so. A look into why things were not working reviled that the libraries for encryption used by gaim (mozilla’s nss libraries) are in /opt/mozilla/lib64 which is not a standard system library path.

You should not have to modify the system library path just to get a small program to run correctly so in order to help gaim-encryption correcly find it’s libraries, you set the LD_ RUN_ PATH environment variable. If this is set at compile time a binary will look first in the directories listed in this variable before it check the system paths for it’s runtime libraries.

Just before the configure call in the spec file, we insert the following in the gaim and gaim-encryption spec files (both for good measure):

export LD_RUN_PATH=/opt/mozilla/lib64/

Once these chagnes are made to both spec files, and any other quirks are worked out with file lists and any other settings such as packager, etc., make gaim. install it, make gaim-encryption, install it. Done.

A couple notes:

  • SuSE does not split up the nss libraries it’s mozilla packages. So, the mozilla and mozilla-devel package is all that’s needed (not mozilla-nss-devel, which is how RedHat creates it’s mozilla RPMs).
  • The latest versions of the gaim RPM contain a vendor section for SuSE. It uses gnutls for encryption in place of mozilla-nss. My RPMs are based on earlier versions of the RPMs and use nss. I don’t know if the gaim packagers realise that the mozilla-devel from SuSE contains the libraries they need.
  • Currently, SuSE does not ship libsilc (Secure Internet Live Conferencing) so that plugin for gaim is not created.

DOWNLOAD: You can download the RPM and SRPM packages for gaim and gaim-encryption that I have made along with their spec files here, in the download section.

8 Comments »

  1. Hey Marc,

    Thanks for the tutorial, i’m getting better at making rpms. So far i’ve made 3 on suse x86_64. Right now i’m tring to create a Gaim 1.2.1 rpm from the src.rpm on the gaim site but i get this message…

    RPM build errors:
    File not found: /var/tmp/gaim-1.2.1-root/usr/lib64/perl5

    I have perl5 installed but it’s libraries are in /usr/lib. I’m not sure if thats the problem. When you built gaim did you come across this? My spec file is very similar to yours except i have libnss disabled.

    Comment by Cody E. — 4/8/2005 @ 4:33 pm

  2. I’m glad the tutorial helped out. I don’t recall having problems with the perl stuff. Maybe I did but it was a while ago that I created the RPMs. However, in the spec file, there’s a configure option called –with-perl-lib you might try setting this to the location (in the %{buildroot}) where your perl installation is. I’d be interested in your solution so if you get it worked out, feel free to post here…

    Comment by marc — 4/8/2005 @ 9:24 pm

  3. It appears Suse has pulled out support for mp3 buring in 9.3 via K3B. I made a Suse 9.3 RPM to add this feature back. You can download it here:
    http://www.awordoftruth.net/suse/k3b-mp3-custom-0.1.1-1.noarch.rpm
    http://www.awordoftruth.net/suse/libmad-0.15.1b-3.1.fc1.fr.i386.rpm

    Enjoy,

    – Chad

    Comment by Chad Harrelson — 5/27/2005 @ 1:44 pm

  4. Sorry, I posted to the wrong forum :(

    – Chad

    Comment by Chad Harrelson — 5/27/2005 @ 1:47 pm

  5. Will you be creating an rpm of gaim 1.4?

    Comment by Rudi Pittman — 7/19/2005 @ 3:13 pm

  6. I should when I get around to it but I’ve been soooo busy lately I have not been able to keep up on building this. Check back now and then to see…

    Comment by marc — 7/19/2005 @ 6:00 pm

  7. I tried compiling both guru’s src rpm and the src rpm on the gaim homepage for 1.4 but keeps telling me I don’t have gtk+ 2.0 installed…which I do….

    checking for GTK+ - version >= 2.0.0… no
    * Could not run GTK+ test program, checking why…
    The test program failed to compile or link. See the file config.log for the
    exact error that occurred. This usually means GTK+ is incorrectly installed.
    configure: error:
    GTK+ 2.0 is required to build Gaim; please make sure you have the GTK+
    development headers installed. The latest version of GTK+ is
    *
    always available at http://www.gtk.org/.

    Installed:
    gtk2-2.6.4-6
    gtk2-engines-2.6.2-4
    gtk2-doc-2.6.4-6
    gtk2-devel-2.6.4-6
    gtk2-themes-0.1-637
    gtk2-32bit-9.3-7
    gtk2-engines-32bit-9.3-7

    Comment by Rudi Pittman — 7/20/2005 @ 5:54 pm

  8. I just installed SuSE9.3 a few days (from RedHat9) and I’ve been struggling to find the right libraries to get SSL to work in Gaim-1.5. It took a while but I finally got it working with some help from the mention above about mozilla-devel (instead of mozilla-nss-devel). I found mozilla-nss and mozilla-npsr here and mozilla-devel here.
    After installing those packages Gaim compiled without any trouble and MSN is connecting again.

    Comment by MLong — 9/9/2005 @ 2:43 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress