8

I need to install version 1.4 of Subversion on a Suse 10.1 (64 bit) box. I can't change either of these two versions and there isn't an RPM for this distro. After looking around I assume that I'll have to create an RPM myself. Is there a better way than this? If not does anyone have any tips on the process?

I don't need a step-by-step tutorial, just a basic outline of the process.

8 Answers 8

8

Rebuilding an existing src.rpm is probably the easiest. I would definitely not go the way of configure, make, make install because (a) that doesn't scale, (b) doesn't provide for easy removal / upgrading of the package and (c) is not atomic.

Building an RPM is not so hard. There used to be a pretty good beginners tutorial at Linux.com, before they destroyed the site. You can try this one, but it's a lot of text, not easy to digest. Still, it's better than nothing.

I'll give you a few pointers, out of the back of my head:

  1. setup an .rpmmacros file in ~
  2. create ~/rpmbuild/{RPMS,SRPMS,SPECS,BUILD,BUILDROOT,SOURCES}
  3. drop the source tarball in ~/rpmbuild/SOURCES
  4. drop the the spec file(s) in ~/rpmbuild/SPECS
  5. run rpmbuild -bp YOURSPEC in ~/rpmbuild/SPECS (runs prepare phase)
  6. run rpmbuild -bc YOURSPEC in ~/rpmbuild/SPECS (above and runs compile phase)
  7. run rpmbuild -bb YOURSPEC in ~/rpmbuild/SPECS (above and builds actual package)

If everything worked out, your RPM will have appeared in ~/rpmbuild/RPMS/${arch}.

I tend to use 5, 6 and 7 separately when creating new RPM's, because I like to inspect the ouput in detail. You might want to go for 7 immediately if you have a vendor provided specfile.

I usually have something like this in my .rpmmacros.

%_topdir /home/YOURNAME/rpmbuild
%packager YOUR NAME <[email protected]>
%_tmppath /tmp

As for the syntax of the specfile: it is not that hard. There exists a very detailed, be it very old, reference work called 'Maximum RPM'. Everything you want to know is in there.


2

As wzzrd says, try to rebuild an existing SRPM.

Searching for OpenSUSE 10.3 RPMS yields 2 interesting results:

I know that 10.3 is far from 10.1, but it's a good shot.

2

The OpenSuse project provides a build service that can help you easily package RPM's for not only OpenSuse/SLES, but Fedora/RHEL/CentOS, Debian, Ubuntu and Mandriva. All in one fell swoop.

1

If you really need and rpm for later package management ease, I would try getting this source rpm svn 1.4.0 sources for SuSE 10.2, install that, cd to /usr/src//SPECS then rpm -bb subversion-1.4.0-31.spec.

I personally would prefer to just get the source from http://subversion.tigris.org and do the usual "configure && make && make check && sudo make install" dance.

2
  • Is there any chance of this rpm causing problems to the system, seeing as it's for 10.2 and 32bit arch? I should note that this is a live server and very bad things will happen if I were to mess it up... Jun 3, 2009 at 13:07
  • SuSE has 32bit compatibility libraries, so if it compiles, it should run fine. But since Robert Munteanu found some 10.3 x86_64 source RPMs I would go with that, since it will have more appropriate compile options.
    – njsf
    Jun 3, 2009 at 13:26
1

The easiest method would be to find a source rpm for a similar distribution. You should then be able to rebuild on your distribution. I believe there is a script called rpmbuild which will do most of the work for you.

Creating an RPM from scratch is probably more work than you'll want to do and more involved than can be described here.

1

Unless you need to distribute this to others, I would just use configure, make, make install. I typically set prefix to something like /opt or /usr/local, and I keep all the original tars in a directory like /root/packages/ so I have a reasonable audit trail and know what I have installed and therefore what to uninstall.

1

I've used checkinstall before in the past and it seemed to work pretty well. YMMV.

0

The subversion 1.4.0 tar file includes spec files for building RPM's under RHEL3/4 as well. You should be able to use those for creating the RPM.

But, I agree with the previous answer, if there's no really overriding need for the RPM, just do the standard "configure && make && make install".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .