|
Hello,
building and installing packages as non-privileged
users is quite easy, you just need to understand a few things about RPM. I use
rpm 3.0.5/3.0.6 on the following OSs HPUX 10.20, GNU/Linux Mandrake 7.2,
Solaris 5.8, AIX 4.2 and soon AIX 4.3 (rpm is now provided on their AIX Toolbox
CD)... I tried rpm 4.0.2 on Red Hat 7.1 and could not have it working as it did
not accept the --prefix option (required).
Follow these steps :
- Create the following folders in $HOME : ./tmp,
./rpm, ./platform/$OSTYPE/rpm. OSTYPE should contain any string identifying
your current architecture. It could be the result of invoking config.guess
or the concatenation of a few uname calls... If you work in
heterogeneous environment, your sysadmin probably figured something out for
you already, check your environment.
- Create the following folders in $HOME/rpm :
./SPECS, ./SRPMS, ./RPMS, ./SOURCES, ./BUILD
- Create a file named $HOME/.rpmmacros and
write the following lines in it :
- %user_home %(echo
$HOME)
- %_dbpath
%{user_home}/platform/%(echo $OSTYPE)/rpm
- %_tmppath
%{user_home}/tmp
- %_topdir
%{user_home}/rpm
- Then run 'rpm --initdb'. This creates a private
RPM database, initially empty. In your post, you're trying to update the
host's RPM database. Of course this one belongs to root...
- Add an alias to your .cshrc or .bashrc or .kshrc
to define the following alias : alias rpmu 'rpm -U -vv --prefix
$HOME/platform/$OSTYPE '. This will help you ensure that any packages you'll
install afterwards is relocatable AND is correctly relocated in your
architecture specific subfolder.
- If you tried in the previous step to install
packages, rpm must have rejected your request as it looks for /bin/sh. As
usual, it won't look whether or not the physical file is here or not, it
will simply search the current database. Your private and empty database
that is. The following step is to create a 'virtual package' which will
contain NO files. The minimal following provides is required :
"Provides: /bin/sh". Actually there is a script in /var/lib/rpm (if I
remember well) that will analyze your full system and build a spec file
for this virtual package... Note that it will store MD5 signatures for every
library on your system. A long process and unsatisfactory if you upgrade your
system. Replacing them with other provides tag is an option... Build it,
install it, and breathe.
- To build packages a non-privileged user, I
recommend that every spec file you build provides :
- %define name SomePackage
- %define version 1.0.2
- %define release 1576 (kidding)
- %define prefix
TheDefaultPrefixYouChoseForYourPackage (a path, usually /usr/local or
/opt/MyCompany)
- Name: %{name}
- Version: %{version}
- Release: %{release}
- Buildroot:
%{_tmppath}/%{name}-%{version}-%{release}-%{arch}-buildroot
- Remember that any .src.rpm package you install
will go to $HOME/rpm/SPECS and $HOME/rpm/SOURCES
- Remember that any binary package you build will go
to $HOME/rpm/RPMS
- Installation with the rpmu alias should work
fine.
This setting works really well for me, I believe it
will 4 you too :)
Hey, all RPM coders/testers out
there, congratulations, this tool is awesome !!!
Thanks all.
Thomas Ripoche
----- Original Message -----
Sent: Wednesday, December 05, 2001 8:09
AM
Subject: The installing rpm for
non-privileged user
Hi!!
I have a package file.
Which I have to install on my machine. When I tried to install it gives me
'packages.rpm' permission denied error as I am trying to install it as a
non-privileged user. To install a package on a non-privileged user's machine I
have to build the package again on my machine by specifying the buildroot and
topdir parameters? Is this the only way non-privileged users install the
readymade package available or there is a different way availabl?
Please guide me on this.
Thanks in advance
Regards Rekha Bhintade KPIT Infosystems Ltd. India
Tel. (O) 5382358
(333) (R) 5386069
|