xunzhang / gflags

Automatically exported from code.google.com/p/gflags
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

--home option for python setup.py install ignored #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. python setup.py install --home="/Some/non-standard/directory/location

What is the expected output? What do you see instead?
gflags2man.py attempted to install in /usr/local/bin/.  I would prefer it
also be installed in the directory specified by --home.

What version of the product are you using? On what operating system?
I am using version 0.6 on Mac-OSX version 10.4.10

Please provide any additional information below.

Original issue reported on code.google.com by chan...@gmail.com on 26 Sep 2007 at 4:19

GoogleCodeExporter commented 9 years ago
Sorry, I'm afraid I'm no expert on python installs.  I made this setup.py by 
copying
from somewhere else, and it looks like it's showing. :-)  Can you provide a 
patch for
how to fix up setup.py to do what you suggest?

Original comment by csilv...@gmail.com on 26 Sep 2007 at 6:20

GoogleCodeExporter commented 9 years ago
Is there are a requirement that gflags2man.py be installed in /usr/local/bin/ by
default?  Why is it installed in that location as opposed to default location 
for
python installs (like site-packages"?  Knowing that reasoning will help my 
develop a fix.

Original comment by chan...@gmail.com on 26 Sep 2007 at 7:41

GoogleCodeExporter commented 9 years ago
I don't think it's required to go in /usr/local/bin.  I just wanted to make 
sure it
ended up somewhere on the default path, which I don't think python 
installations do
by default.

Original comment by csilv...@gmail.com on 26 Sep 2007 at 7:46

GoogleCodeExporter commented 9 years ago
This attached file should solve the problem.  It specifies the relative path 
"bin"
instead of the explicit path "/usr/local/bin/".  If given a relative path 
distutils
assumes that the reference point is defined by sys.prefix.  So, in the default 
case,
the gflags2man.py should be installed in the same location that the python 
executable
is installed.  However, sys.prefix can also be modified at setup time with the 
--home
or --prefix flags.  

I also made the script a little more general by adding "#!/usr/bin/env python" 
to the
top of the script.

I hope you find this useful and consider adding it to your library.

Original comment by chan...@gmail.com on 26 Sep 2007 at 8:41

Attachments:

GoogleCodeExporter commented 9 years ago
On my system, sys.prefix is '/usr', so it will install this in /usr/bin rather 
than
/usr/local/bin.  Maybe that's ok though.  In any case, I'll look into make this
change or something substantively similar for the next release.  Thansk for the 
patch!

Original comment by csilv...@gmail.com on 26 Sep 2007 at 8:47

GoogleCodeExporter commented 9 years ago
I just released gflags-0.7, which should fix this.

Original comment by csilv...@gmail.com on 18 Oct 2007 at 8:13