mimas rpm packages

Author:
Jan Wedekind (jan at wedesoft.de)
Date:
Wed May 26 12:43:00 BST 2004

Introduction

Because of Linux's flexible mount-concept, fixed installation locations are not posing a problem. Therefore the configuration, compilation and installation can be preconfigured (depending on architecture and distribution) to the extent of being 100% automatized!

Why use rpm?

RPM provides a consistent method of building software from source on many Linux systems. All the changes necessary for different platforms can fit in a single SPRMS file. Providing an rpm-package, will make your software more accessible.

SPEC file

The SPEC file controls the build and installation process. To create an upgrade or a new releases one can start with the last SPEC file, to see what was necessary the last time.

Set up an RPM sandbox

If you want to compile rpm packages as normal user, you'll have to setup your own rpm sandbox. You can do this by executing the following commands (bash):
    $ mkdir -p $HOME/rpms/{SRPMS,BUILD,SPECS,SOURCES,RPMS,lib}
    $ mkdir -p $HOME/rpms/RPMS/{i386,noarch}
    $ echo "%_topdir $HOME/rpms" > $HOME/.rpmmacros
    

How to create a new release

If you want to release a new distribution of mimas, perform the following steps. I'm assuming, that your local mimas sources are in $HOME/mimas.

Get and install the previous release

Get the most recent release, you can get hold of. Chances may be, that you won't have to do much to adapt it for the new release.

Now install it

    $ rpm -Uvh mimas-1.0-jw4.src.rpm
    

Extract and patch the sources contained in the package by doing

    $ rpm -bp $HOME/rpms/SPECS/mimas.spec
    

Move the source tree to your root directory, where you have mimas installed, renaming it with a unique name.

    $ mv $HOME/rpms/BUILD/mimas-1.0 $HOME/mimas-1.0-jw4
    

You'll find the mimas.spec SPEC file to work on in the directory $HOME/rpms/SPECS. However I recommend using the SPEC file, which comes with the CVS repository. Copy this SPEC file to $HOME/rpms/SPECS and don't forget to put the updated version into the CVS repository later.

Prepare your sources

Make sure, that your software (in $HOME/mimas) is running! You don't want your name on a release, which will fail to work after being distributed. Also assert, that you've retrieved important bugfixes from your colleagues (see tla/gnu-arch repository for mimas).

Update version number

If your name is not Balasundram Amavasai, you can ignore this section, because you are not eligible for defining version-numbers.

If you release a new version, you'll have to update the version number. Right now, this involves the following steps:

  1. Tag the sources in your CVS repository.
  2. Update the version number in the file $HOME/mimas/configure.in.
  3. Update the Version entry in $HOME/rpms/SPECS/mimas.spec.

Set the release name

In your the SPEC-file $HOME/rpms/SPECS/mimas.spec update the Release entry. By convention this is your abreviated name followed by a release number (indicating, how many releases already have been made under this version).

F.e. if I put jw5 for Release, rpm later should generate packages with the names mimas*-jw5.*.rpm.

Create tree with distributable sources

See Create distributable how to make a distributable source-tarball from your local build in $HOME/mimas. Unzip the sources and rename the directory with a unique name:
    $ cd $HOME
    $ tar xzf $HOME/mimas/mimas-1.0.tar.gz
    $ mv mimas-1.0 mimas-1.0-jw5
    

Create your patch

Create your patch showing the differences between the original and your revision:
    $ cd $HOME
    $ diff -ruaN mimas-1.0-{jw4,jw5} > $HOME/rpms/SOURCES/mimas-1.0-jw5.patch
    $ bzip2 $HOME/rpms/SOURCES/mimas-1.0-jw5.patch
    

Add the patch to the patch-list of your SPEC-file $HOME/rpms/SPECS/mimas.spec:

    Patch4: %{name}-%{version}-%{distauthor}5.patch.bz2
    

Also add a command for applying the patch at the prep-stage:

    %patch4 -p1
    

Build it

Make all other necessary modifications to the SPEC-file. This may be: When you're done, you can create the new package
    $ rpm -ba $HOME/rpms/SPECS/mimas.spec
    

On success, you'll get one or more binary packages in $HOME/rpms/RPMS and a source package in $HOME/rpms/SRPMS.

Further information

Extract files from rpm archive

The files of an rpm package can be extracted without installing by using the rpm2cpio and cpio commands:
    $ rpm2cpio mimas-1.0-jw4.rpm | cpio -di
    

Links


[GNU/Linux] [Qt] [Mesa] [STL] [Lapack] [Boost] [Magick++] [Xalan-C and Xerces-C] [doxygen] [graphviz] [FFTW] [popt] [xine] [Gnuplot] [gnu-arch] [gcc] [gstreamer] [autoconf/automake/make] [freshmeat.net] [opensource.org] [sourceforge.net] [MMVL]
mimas 2.1 - Copyright Mon Oct 30 11:31:17 2006, Bala Amavasai, Stuart Meikle, Arul Selvan, Fabio Caparrelli, Jan Wedekind, Manuel Boissenin, ...