Re: using rpms for non-root installs

2013-02-03 Thread Pavel Alexeev

Hello.

Yum also may be used with --installroot=root
I have used yum and rpm on that kind with aliases for current user to 
install software from repositories on shared hosting absolutely without 
root privileges.


In most cases it works, except some cases when particular binaries looks 
say own config files by fixed path (/etc/appname/default.conf). In such 
situation you may deep look documentation about config configuration 
options, environment variables and so. As last alternative before start 
patching source code you may also just patch elf binary to replace that 
path by some with the same length (I have done it by compose symlynks 
appropriately).


In any case, it some sort of hacks and depend from you really needs. If 
it intended for other users and predictable reproducible results you 
should patch software to bring them configurability in some way. And 
offer such patches to upstream also will be good idea.


31.01.2013 11:40, Michael Stahnke пишет:

You actually may have an option. It's dirty, and here be dragons. I
know this from working on RPM on AIX, so again, it's hacky. I did this
on a CentOS 6.3 box for my example, should work on Fedora.

You can do something like:

   ls zip-3.0-1.el6.x86_64.rpm
   mkdir $HOME/.myrpm
   cp -pr /var/lib/rpm/* $HOME/.myrpm/
   chown -R $USER  $HOME/.myrpm/
   rpm -Uvh --justdb --dbpath $HOME/.myrpm zip-3.0-1.el6.x86_64.rpm
   rpm2cpio  zip-3.0-1.el6.x86_64.rpm | cpio  -idmv
   rpm -q --dbpath $HOME/.myrpm zip

Results:

[vagrant@localhost ~]$ rpm -q --dbpath /home/vagrant/.myrpm zip
zip-3.0-1.el6.x86_64
[vagrant@localhost ~]$ rpm -q zip
package zip is not installed


You now have zip installed (and rooted) in $HOME.  You'd have to add
the --dbpath option to rpm any time you used it, and it would get out
of sync with the system rpm database unless you wrote some tooling
around that. But it's completely do-able.

Again, it's ugly and I don't recommend it.


stahnma


--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-02-03 Thread Kevin Kofler
Mátyás Selmeci wrote:
 This may be a long shot, but I am interested in repackaging some
 RPMs (for example, some of the Globus packages in EPEL, as well as
 grid software that my group builds) such that the software in them
 may be installed by unprivileged users, or into a non-standard
 location such as an NFS share. I'd like to use existing RPMs,
 preferably binaries, as a starting point to avoid duplicating work.
 (Naturally a lot of post-install scripting would be needed to fix
 binaries such that they'd work with the path they were installed
 into).

For the unprivileged users part, it is possible for the admin to give out 
the org.freedesktop.packagekit.package-install PolicyKit permission, then 
users can install (but not remove) trusted packages (packages signed with 
GPG keys already known to the system) systemwide using gnome-packagekit or 
Apper. But of course, there are drawbacks to that, which is why it's not the 
default (in fact, it had been the default for a short moment in Fedora 12 
and got dropped due to user uproar), and so admins will generally not enable 
that, unfortunately. :-( In addition, it also only works for third-party 
repositories if the admin imported the key for them, and at that point he 
might as well install the packages, too. (There's also an 
org.freedesktop.packagekit.package-install-untrusted permission, but as an 
admin, you'd have to be insane to give that permission to your users, it's 
essentially the same as giving them root access, because they can craft any 
package running any arbitrary code and install it with that permission.) So 
in your case, it's not all that helpful, unfortunately. But I still wanted 
to point out the possibility.

Kevin Kofler

-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-02-01 Thread Stephan Bergmann

On 01/31/2013 08:40 AM, Michael Stahnke wrote:

You actually may have an option. It's dirty, and here be dragons. I
know this from working on RPM on AIX, so again, it's hacky. I did this
on a CentOS 6.3 box for my example, should work on Fedora.

You can do something like:

   ls zip-3.0-1.el6.x86_64.rpm
   mkdir $HOME/.myrpm
   cp -pr /var/lib/rpm/* $HOME/.myrpm/
   chown -R $USER  $HOME/.myrpm/
   rpm -Uvh --justdb --dbpath $HOME/.myrpm zip-3.0-1.el6.x86_64.rpm
   rpm2cpio  zip-3.0-1.el6.x86_64.rpm | cpio  -idmv
   rpm -q --dbpath $HOME/.myrpm zip

Results:

[vagrant@localhost ~]$ rpm -q --dbpath /home/vagrant/.myrpm zip
zip-3.0-1.el6.x86_64
[vagrant@localhost ~]$ rpm -q zip
package zip is not installed


You now have zip installed (and rooted) in $HOME.  You'd have to add
the --dbpath option to rpm any time you used it, and it would get out
of sync with the system rpm database unless you wrote some tooling
around that. But it's completely do-able.

Again, it's ugly and I don't recommend it.


FWIW, we have a similar script for LibreOffice, 
http://cgit.freedesktop.org/libreoffice/core/tree/setup_native/scripts/install_linux.sh 
(inherited from its OpenOffice.org ancestry), and at least back in OOo 
times used it frequently to install instances to the side.  Worked 
reasonably well.


Stephan
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-01-31 Thread Jan Zelený
On 30. 1. 2013 at 16:06:35, Mátyás Selmeci wrote:
 Hi,

 This may be a long shot, but I am interested in repackaging some RPMs (for
 example, some of the Globus packages in EPEL, as well as grid software that
 my group builds) such that the software in them may be installed by
 unprivileged users, or into a non-standard location such as an NFS share.
 I'd like to use existing RPMs, preferably binaries, as a starting point to
 avoid duplicating work. (Naturally a lot of post-install scripting would be
 needed to fix binaries such that they'd work with the path they were
 installed into).

 Have there been any projects with this goal in mind?
 Have any of you had experience with this sort of thing and have tips, tools,
 etc. that might help me out in this?

 Thanks in advance,
 -Mat
 --
 -Matyas Selmeci
 Open Science Grid Software Team
 Center for High Throughput Computing
 University of Wisconsin-Madison

How about using Software Collections? It doesn't solve the installataion by
unprivileged user but it solves installation into non-standard location:

http://docs.fedoraproject.org/en-
US/Fedora_Contributor_Documentation/1/html/Software_Collections_Guide/index.html

Thanks
Jan

signature.asc
Description: This is a digitally signed message part.
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-01-31 Thread Mátyás Selmeci

  
  
Michael Stahnke wrote:

ls zip-3.0-1.el6.x86_64.rpm
  mkdir $HOME/.myrpm
  cp -pr /var/lib/rpm/* $HOME/.myrpm/
  chown -R $USER  $HOME/.myrpm/
  rpm -Uvh --justdb --dbpath $HOME/.myrpm zip-3.0-1.el6.x86_64.rpm
  rpm2cpio  zip-3.0-1.el6.x86_64.rpm | cpio  -idmv
  rpm -q --dbpath $HOME/.myrpm zip


This is very useful. I'll play around with it to see how much
tooling we'd have to write around it.

Jan Zelený wrote:

  How about using Software Collections? It doesn't solve the installataion by 
unprivileged user but it solves installation into non-standard location:

http://docs.fedoraproject.org/en-US/Fedora_Contributor_Documentation/1/html/Software_Collections_Guide/index.html

You are right, because of the unprivileged user requirement I can't
use it directly, but it seems like there's a lot I can learn from
how you folks did this.


Also thanks Adam and Kevin for the background knowledge, and in
general thank you all for your help!

-Mat

-- 
  -Matyas Selmeci
  Open Science Grid Software Team
  Center for High Throughput Computing
  University of Wisconsin-Madison 
  




smime.p7s
Description: S/MIME Cryptographic Signature
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

using rpms for non-root installs

2013-01-30 Thread Mátyás Selmeci

  
  
Hi,

This may be a long shot, but I am interested in repackaging some
RPMs (for example, some of the Globus packages in EPEL, as well as
grid software that my group builds) such that the software in them
may be installed by unprivileged users, or into a non-standard
location such as an NFS share. I'd like to use existing RPMs,
preferably binaries, as a starting point to avoid duplicating work.
(Naturally a lot of post-install scripting would be needed to fix
binaries such that they'd work with the path they were installed
into).

Have there been any projects with this goal in mind?
Have any of you had experience with this sort of thing and have
tips, tools, etc. that might help me out in this?

Thanks in advance,
-Mat
-- 
  -Matyas Selmeci
  Open Science Grid Software Team
  Center for High Throughput Computing
  University of Wisconsin-Madison 
  




smime.p7s
Description: S/MIME Cryptographic Signature
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-01-30 Thread Jorge Gallegos
On Wed, Jan 30, 2013 at 04:06:35PM -0600, Mátyás Selmeci wrote:
 Hi,
 
 This may be a long shot, but I am interested in repackaging some RPMs (for
 example, some of the Globus packages in EPEL, as well as grid software that my
 group builds) such that the software in them may be installed by unprivileged
 users, or into a non-standard location such as an NFS share. I'd like to use
 existing RPMs, preferably binaries, as a starting point to avoid duplicating
 work. (Naturally a lot of post-install scripting would be needed to fix
 binaries such that they'd work with the path they were installed into).

Going out on a limb here but, probably you can use yum --installroot,
sorta like mock does.

 
 Have there been any projects with this goal in mind?
 Have any of you had experience with this sort of thing and have tips, tools,
 etc. that might help me out in this?
 
 Thanks in advance,
 -Mat
 --
 -Matyas Selmeci
 Open Science Grid Software Team
 Center for High Throughput Computing
 University of Wisconsin-Madison



 -- 
 devel mailing list
 devel@lists.fedoraproject.org
 https://admin.fedoraproject.org/mailman/listinfo/devel



pgpmMO_vTgmO_.pgp
Description: PGP signature
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-01-30 Thread M A Young

On Wed, 30 Jan 2013, Mátyás Selmeci wrote:


This may be a long shot, but I am interested in repackaging some RPMs (for
example, some of the Globus packages in EPEL, as well as grid software that
my group builds) such that the software in them may be installed by
unprivileged users, or into a non-standard location such as an NFS share.
I'd like to use existing RPMs, preferably binaries, as a starting point to
avoid duplicating work. (Naturally a lot of post-install scripting would be
needed to fix binaries such that they'd work with the path they were
installed into).


It depends want you mean by install but you can unpack the files in an 
rpm package with rpm2cpio eg.

cd target/dir ; rpm2cpio some.rpm | cpio -idmv

Michael Young-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-01-30 Thread Adam Williamson
On Wed, 2013-01-30 at 15:53 -0800, Jorge Gallegos wrote:
 On Wed, Jan 30, 2013 at 04:06:35PM -0600, Mátyás Selmeci wrote:
  Hi,
  
  This may be a long shot, but I am interested in repackaging some RPMs (for
  example, some of the Globus packages in EPEL, as well as grid software that 
  my
  group builds) such that the software in them may be installed by 
  unprivileged
  users, or into a non-standard location such as an NFS share. I'd like to use
  existing RPMs, preferably binaries, as a starting point to avoid duplicating
  work. (Naturally a lot of post-install scripting would be needed to fix
  binaries such that they'd work with the path they were installed into).
 
 Going out on a limb here but, probably you can use yum --installroot,
 sorta like mock does.

You may also want to look up the old-as-dirt --relocate parameter to
RPM. You could try using it, and watch it explode in more cases than
not. But RPM packages are (or were) (at least in theory) supposed to be
relocatable whenever this is practical, and all the machinery is still
there, buried in the tools and spec format...
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | identi.ca: adamwfedora
http://www.happyassassin.net

-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-01-30 Thread Kevin Fenzi
On Wed, 30 Jan 2013 16:38:49 -0800
Adam Williamson awill...@redhat.com wrote:

 You may also want to look up the old-as-dirt --relocate parameter to
 RPM. You could try using it, and watch it explode in more cases than
 not. But RPM packages are (or were) (at least in theory) supposed to
 be relocatable whenever this is practical, and all the machinery is
 still there, buried in the tools and spec format...

Actually Fedora packages are (for the vast majority) not relocatable. 

https://fedoraproject.org/wiki/Packaging:Guidelines#Relocatable_packages

It never worked well. :( 

You could of course download src.rpms and rebuild them with Prefix. 

kevin



signature.asc
Description: PGP signature
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-01-30 Thread Adam Williamson
On Wed, 2013-01-30 at 17:47 -0700, Kevin Fenzi wrote:
 On Wed, 30 Jan 2013 16:38:49 -0800
 Adam Williamson awill...@redhat.com wrote:
 
  You may also want to look up the old-as-dirt --relocate parameter to
  RPM. You could try using it, and watch it explode in more cases than
  not. But RPM packages are (or were) (at least in theory) supposed to
  be relocatable whenever this is practical, and all the machinery is
  still there, buried in the tools and spec format...
 
 Actually Fedora packages are (for the vast majority) not relocatable. 
 
 https://fedoraproject.org/wiki/Packaging:Guidelines#Relocatable_packages
 
 It never worked well. :( 
 
 You could of course download src.rpms and rebuild them with Prefix. 

Yeah, hence the 'watch it explode in more cases than not'...but it
seemed like a useful thing to point him to, as background if nothing
else, and as probably the mechanism he wants to use if he wants to make
some Fedora packages relocatable.
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | identi.ca: adamwfedora
http://www.happyassassin.net

-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-01-30 Thread Alec Leamas

On 01/31/2013 01:13 AM, M A Young wrote:

On Wed, 30 Jan 2013, Mátyás Selmeci wrote:

This may be a long shot, but I am interested in repackaging some RPMs 
(for
example, some of the Globus packages in EPEL, as well as grid 
software that

my group builds) such that the software in them may be installed by
unprivileged users, or into a non-standard location such as an NFS 
share.
I'd like to use existing RPMs, preferably binaries, as a starting 
point to
avoid duplicating work. (Naturally a lot of post-install scripting 
would be

needed to fix binaries such that they'd work with the path they were
installed into).


It depends want you mean by install but you can unpack the files in 
an rpm package with rpm2cpio eg.

cd target/dir ; rpm2cpio some.rpm | cpio -idmv

Michael Young


Yes, or similar.  The basic limitation is still that writing to the 
/var/lib/rpm db requires root privileges, so you can't really make a 
user install managed by rpm.


--alec
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: using rpms for non-root installs

2013-01-30 Thread Michael Stahnke
You actually may have an option. It's dirty, and here be dragons. I
know this from working on RPM on AIX, so again, it's hacky. I did this
on a CentOS 6.3 box for my example, should work on Fedora.

You can do something like:

  ls zip-3.0-1.el6.x86_64.rpm
  mkdir $HOME/.myrpm
  cp -pr /var/lib/rpm/* $HOME/.myrpm/
  chown -R $USER  $HOME/.myrpm/
  rpm -Uvh --justdb --dbpath $HOME/.myrpm zip-3.0-1.el6.x86_64.rpm
  rpm2cpio  zip-3.0-1.el6.x86_64.rpm | cpio  -idmv
  rpm -q --dbpath $HOME/.myrpm zip

Results:

[vagrant@localhost ~]$ rpm -q --dbpath /home/vagrant/.myrpm zip
zip-3.0-1.el6.x86_64
[vagrant@localhost ~]$ rpm -q zip
package zip is not installed


You now have zip installed (and rooted) in $HOME.  You'd have to add
the --dbpath option to rpm any time you used it, and it would get out
of sync with the system rpm database unless you wrote some tooling
around that. But it's completely do-able.

Again, it's ugly and I don't recommend it.


stahnma
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel