[TriLUG] rpm as non root

Tanner Lovelace lovelace at wayfarer.org
Fri Dec 13 17:23:11 EST 2002

On Fri, 2002-12-13 at 17:07, H Brett Bolen wrote:

> gotcha, but doesn't src rpms require access to the rpm database also?
> b

Nope.  Src rpms are not tracked in the rpm database.  Why should
they be?  To build rpms locally, you just need to setup the correct
directory structure, and point rpm there.  Make the following 
directory structure:

<prefix>/RPMS/i586    [ add or delete arches as desired ]

I normally use ~/RPM/ as my prefix.

Then create a ~/.rpmmacros file with the following lines:

%_topdir            <prefix>

You can alternatively create a ~/.rpmrc to control what arches you
build.  This is what I have:

buildarchtranslate: i386: i586
buildarchtranslate: i486: i586
buildarchtranslate: i586: i586
buildarchtranslate: i686: i586

This tells rpm to build i586 rpms for me by default.  You can
change yours to be i386 or even i686 if you want.

With this setup, when you "install" a src rpm, it unpacks the
source rpm and places the .spec file (which holds the build commands
and information about the package) in the <prefix>/SPECS directory
and everything else in the <prefix>/SOURCES directory.  You can
then go to the <prefix>/SPECS directory and run

rpmbuild -ba <specfilename>.spec

and it will build the package in <prefix>/BUILD and place the
newly created source rpm in <prefix>/SRPMS and the binary rpms
in <prefix>/RPMS/<arch>.

Tanner Lovelace | lovelace(at)wayfarer.org | http://wtl.wayfarer.org/
GPG Fingerprint = A66C 8660 924F 5F8C 71DA  BDD0 CE09 4F8E DE76 39D4
GPG Key can be found at http://wtl.wayfarer.org/lovelace.gpg.asc
Create like it's 1790. -- Lawrence Lessig
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.trilug.org/pipermail/trilug/attachments/20021213/38e33084/attachment.pgp>

More information about the TriLUG mailing list