[TriLUG] rpm database question

Tanner Lovelace lovelace at wayfarer.org
Tue Nov 20 22:03:50 EST 2001


Tom Bryan wrote:

> On Wednesday 21 November 2001 05:44 am, you wrote:
> 
>>Adrian announced:
>>
>>>No, I build an rpm with the fix and install it.
>>>
>><sarcasm>Ahhh so you are a masochist then, eh?</sarcasm>
>>
>>RPM has some great potential.  With some up to date book(s) on the subject,
>>and maybe a packaging tool that works, I'd probably use it more.  Building
>>a package right now seems to be a major pain.  I haven't found a reliable &
>>easy way yet to build those pesky spec files.  What's your secret?
>>
> 
> You can use vendor-supplied RPMs, which may just work even with updated 
> source, or you can write your own.  The problem with not basing your RPMs on 
> vendor-supplied RPMs is that you may be unable to install RPMs that rely on 
> the vendor's packages.  For example, if a vendor-supplied RPM expects 
> python-devel, I don't think RPM would let you install it if you included the 
> vendor's python-devel files in a package that you call python.
> 
> If that isn't a concern, and if all you're doing is 
> ./configure [options]
> make
> make install
> 
> then the .spec file isn't that hard.  Here's a trimmed down .spec file for a 
> basic postgresql install.  
> 
> Summary: PostgreSQL, packaged for running and/or developing EcoAccess software
> Name: postgresql
> Version: 7.1.3
> Release: 1
> #BuildRoot: /var/tmp/
> Source0: postgresql-%{version}.tar.gz
> Copyright: BSD-style
> Group: Application/Database
> Vendor: Yourself
> Packager: You again <email at goes.here>
> Provides: PostgreSQL
>  
> %description
> Anyhting you want here
> 
> %prep
> # unpack the sources under /usr/src/redhat
> %setup -q -T -b 0 -n postgresql-%{version}
>  
> %build
> ./configure --prefix=/usr/local/postgresql-%{version}
> make
>  
> %install
> make install
> 
> %files
> %defattr(-,postgres,postgres)
> /usr/local/postgresql-%{version}
> 
> 
> Perhaps we'll here more about such issues at the upcoming RPM talk.  I hope 
> that I can make it.  :) 


One point, however, that should be made.  This spec file
will only build as root.  One of the great things about rpm
is its ability to allow you to build packages as a non-root
user.  This makes sure you don't screw up a running system.
Spec files that expect to be root when built are broken and
should be fixed...

Tanner
-- 
Tanner Lovelace | lovelace at wayfarer.org | http://wtl.wayfarer.org/
--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--
  Those who are willing to sacrifice essential liberties for a little
  order, will lose both and deserve neither.  --  Benjamin Franklin

  History teaches that grave threats to liberty often come in times
  of urgency, when constitutional rights seem too extravagant to
  endure.  --  Justice Thurgood Marshall, 1989




More information about the TriLUG mailing list