Creating RPMS from source without Makefile

Mertens, Bram mertensb at
Tue Oct 16 06:49:55 UTC 2007


Mazda Motor Logistics Europe NV, Blaasveldstraat 162, B-2830 Willebroek
VAT BE 406.024.281, RPR Mechelen, ING  310-0092504-52, IBAN : BE64 3100 0925 0452, SWIFT : BBRUBEBB

-----Original Message-----
> From: redhat-list-bounces at 
> [mailto:redhat-list-bounces at] On Behalf Of Karl Latiss
> Sent: dinsdag 16 oktober 2007 5:21
> To: General Red Hat Linux discussion list
> Subject: Re: Creating RPMS from source without Makefile
> On Mon, 2007-10-15 at 15:35 +0200, Mertens, Bram wrote:
> > Hi,
> > 
> > For several applications/tools I'd like to create an RPM to make
> > maintenance easier.  However some of these come without a Makefile
> > (usually just untar in the correct directory).  For others 
> I'd like to
> > add some additional (configuration) files and such.
> > 
> > According to the maximum rpm book it is recommended to keep 
> patches and
> > such separate from the original sources (pristine sources). 
>  But so far
> > I've been unable to find an explanation on how exactly to 
> set this up.
> > I've download the httpd source rpm and noticed that it contains some
> > additional files in the SOURCES directory which have been added as
> > additional "SourceX" lines in the spec file.  These are installed by
> > additional "install" commands in the spec file.
> > 
> You may want to start with a package less complex than httpd 
> to see how
> things work.

I wasn't trying to build httpd, I realise it is "quite" complex and
probably not a good example package.  But it was the only package I
could think of straight away that would have a number of patches and
additional files (the RH logos).

> > Is this the recommended approach?  Is there a way to group 
> these files
> > somehow?  After installing the httpd source rpm the SOURCE dir was
> > filled with files with no way to determin which were related to the
> > httpd package wand which not.
> > 
> You may also want to visit 
> rpms.html
> for a simpler walkthrough.

This is one of the docs I started from.  But all it says is:
"As covered in Chapter 2, a major tenet of the philosophy behind RPM is
to start with pristine-unmodified--sources. You may need to patch or
customize the sources for your environment, but you can always go back
to the original sources."
And a bit further:
"Start with pristine sources; then patch as needed. A patch is an
automated set of modifications to the source code. Use the diff command
to build a patch and the patch command to apply the patch (that is, to
modify the source code). Keep the original sources separate from any
patches you need to make the software work in your environment."

But I didn't find anything on "best practices" on HOW to organise these
patches.  Whether or not to store them in an archive, a separate
directory or just next to the sources.

E.g. Say I want to build two different packages, neither of which
contains a Makefile.  Where do I store the Makefile?  I can't store them
both in the SOURCES directory as the names would conflict.
And if you build several packages storing the additional files for all
of these in the SOURCES directory will quickly create a mess.

Kind regards


More information about the redhat-list mailing list