[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: The installing rpm for non-privileged user [non HTML + fixes]



Title: RE: The installing rpm for non-privileged user [non HTML + fixes]

Thanks a lot Thomas!
I will try this and will let you know if I face any problems..
Thanks once again.
Regards
Rekha


-----Original Message-----
From: Thomas Ripoche [mailto:thomas.ripoche@laposte.net]
Sent: Friday, December 07, 2001 9:20 PM
To: rpm-list@redhat.com
Subject: Re: The installing rpm for non-privileged user [non HTML +
fixes]


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 for Linux 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 for non-privileged user installations).

Follow these steps :

- Create the following folders
    $HOME/tmp
    $HOME/platform/$OSTYPE/rpm
    $HOME/rpm/BUILD
    $HOME/rpm/RPMS
    $HOME/rpm/SRPMS
    $HOME/rpm/SOURCES
    $HOME/rpm/SPECS

- 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 file $HOME/.rpmmacros. Its content follows
    %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 depending on your shell
flavor):
    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

- At this point you won't be able to install any package as they all require
/bin/sh. As usual, it won't look whether or not the physical file is here,
it will simply search the current database. Your private and currently empty
database that is.

- The following step is to create a 'virtual package' which will contain NO
files. The minimal following provides should be : "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 apply vendor upgrades. Replacing them
with other "Provides:" tags 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, often
/usr or /usr/local or /opt/MyCompany or /opt/MyProduct)

    Name:      %{name}
    Version:   %{version}
    Release:   %{release}
    Prefix:    %{prefix}
    Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-%{arch}-buildroot
(to allow multiple concurrent builds)

- 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

- Don't forget to specify a prefix when installing binary packages (the rpmu
alias should help)

This setting works really well for me, I believe it will 4 you too :)
However there is an important issue : as we changed the database used, you
will have trouble if your packages have dependencies with system packages.
If it is so, you may have to use "AutoReqProv: no " or repackage the system
ones so that they can also be installed using your own account (hope they
aren't too numerous).

Hey, all RPM coders/testers out there, congratulations, this tool is awesome
!!! Thanks all.


Thomas Ripoche



_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://listman.redhat.com/mailman/listinfo/rpm-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []