RPM Community Forums

Mailing List Message of <rpm-users>

Re: autoconf -> rpm

From: Jeff Johnson <n3npq@mac.com>
Date: Sun 24 May 2009 - 04:28:14 CEST
Message-id: <EA59B8CB-05D2-4E69-BBD3-47199714F905@mac.com>

On May 23, 2009, at 9:39 PM, barcaroller wrote:

Ah, I see what you are asking now.

> As you know, the GNU autotools do (at least) three things:
> - they check for dependencies and other stuff (configure)

I'm unaware of any fully automated reliable
tool for generating BuildRequires: (the RPM
dependencies). There are many subtle issues
with naming and versions that are tricky to
automate reliably.

You can get a pretty good approximation to
what your build dependencies are by:

1) run a build under strace, extract and uniqfy
all the files opened/exec'd during a build.

2) filter the paths to eliminate what are clearly private

3) convert the file paths to package names using rpm
	rpm -qf --queryformat 'BuildRequires: %{name}\n' /bin/sh
You will likely need to uniqify the packages slightly

> - they build the binaries (and sometimes other stuff) from the  
> source code
> (make)


> - they install the binaries (and man pages, config files, and other  
> stuff)
> in the proper directories (make install)

RPM uses DESTDIR as an alternate path to what is
called a buildroot. A buildrooot is basically a staging
area for what will be included in packages.

> I would like to install these binaries (and other stuff) on another  
> machine
> (identical architecture but no development tools) using rpm.  So, I  
> would
> like to write a spec file which checks for the dependencies (as  
> configure
> does) and then installs the binaries and other stuff (exactly as 'make
> install' does).  Instead of me writing this spec file manually, I was
> wondering whether this can be automated somehow.  This is the second  
> rpm I
> was talking about.  The first rpm (source rpm) is not that important  
> at the
> moment.

What most people do is to modify a pre-existing spec file
rather than writing one from scratch. RPM isn't hard, but it is quirky,
and there are different styles and mistakes to work through,
so its often easiest to start with a pre-existing example.

> Sorry but as you can probably tell, I'm new to writing rpm spec  
> files.  I
> have used rpm in the past but I've never had to write a spec file  
> for an
> existing software package that already uses GNU autotools.

We've all been there. ;-)

Try looking at a simple package, perhaps "time", that
uses GNU tools to build.

73 de Jeff
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> User Communication List                             rpm-users@rpm5.org
Received on Sun May 24 04:28:38 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.