Re: rpm makefile patch for Linux/PPC


Subject: Re: rpm makefile patch for Linux/PPC
From: Matthew Kirkwood (weejock@ferret.lmh.ox.ac.uk)
Date: Wed Jan 26 2000 - 16:37:48 CST


On Wed, 26 Jan 2000 sterwill@abisource.com wrote:

> Are there any RPM wizards out there willing to work towards
> getting nicer RPM packages?

I may find time to have a go, but not before LWE. I have used RPM
a bit, though and can maybe answer the odd question if there are no
other packaging people here.

I would recommend dealing with packaging the way samba does. They
have a packaging directory with subdirectories like RedHat, Solaris,
HPUX and so on.

Each of these contains *.tmpl files, and there's a packaging/bin
directory which contains a script called update-pkginfo which does
nothing much more complicated than a bit of sed to fill out the *.tmpl
files with the correct version information:

$ ./packaging/bin/update-pkginfo 2.0.5b 1

will create an RPM .spec file to make samba-2.0.5b-1 RPMs and SRPMs
for RedHat in packaging/RedHat. (Shockingly, there are separate
.spec files for Caldera, SuSE and TurboLinux.) These directories
also contain package-specific stuff like init.d scripts, pam.d
files and patches. Aside, perhaps, from file locations, I doubt
AbiWord will need to differ significantly from distro to distro,
though.

You will note that this is completely separate to the build process.

Before making a release tarball, the maintainer will run update-pkginfo
(as well as all the auto{conf,make} junk).

The guts of the spec file shouldn't need to look much more complicated
than:

%prep
%setup -q <- untars the source tarball
                        <- you may need "%setup -q -n abi-%{version}/abi
                        <- to put you in the right directory
%patch0 -p1 <- if any patches are required

%build
make ABI_OPT_GNOME=1

%install
make ABI_OPT_GNOME=1 INSTALL_ROOT=$RPM_BUILD_ROOT install

%files
defattr(-,root,root)
/usr/bin/AbiWord
...
%doc docs/*.abw

%files fonts <- keep font files in separate RPM
/usr/AbiSuite/fonts

The hard bit is in the %install section - you need to hack the
Makefiles to believe an extra part of the install directories,
so /usr/bin/AbiWord gets installed in
/var/tmp/rpmroot_abiword/usr/bin/AbiWord.

You can ignore this bit, but it means that you have to build the
package as root. Some people don't mind that, but I have seen the
fallout from .spec files cobbled together from multiple sources,
which do "rm -fr $RPM_BUILD_ROOT" without BuildRoot: specified. (Yes,
it has happened on multiple occasions - the RPM HOWTO specifically
warns against it.)

Anyone who wants to have a try is mroe than welcome to contact me
about it, otherwise I will have a go in a week or two.

Matthew.



This archive was generated by hypermail 2b25 : Wed Jan 26 2000 - 16:38:03 CST