Ticket #635 (new enhancement)

Opened 3 years ago

Last modified 7 weeks ago

configure ignores --prefix

Reported by: marcusbooster Owned by: strk
Priority: medium Milestone: PostGIS Future
Component: build/upgrade/install Version: 1.5.X
Keywords: build permissions Cc:

Description

uname -a:

Linux myname 2.6.35-22-server #35-Ubuntu SMP Sat Oct 16 22:02:33 UTC 2010 x86_64 GNU/Linux

PostGIS 1.5.2 builds correctly, but fails on 'make install' because of a permission error after it ignores './configure --prefix=$HOME/local'

PostgreSQL 9 is a Ubuntu package installed system-wide, postgis configure is using /usr/lib/postgresql/9.0/bin/pg_config

I wish to install postgis locally.

output:

PostGIS was built successfully. Ready to install.
make -C postgis install
make[1]: Entering directory `/home/myname/tmp/postgis-1.5.2/postgis'
/bin/mkdir -p '/usr/lib/postgresql/9.0/lib'
/bin/mkdir -p '/usr/share/postgresql/9.0/contrib/postgis-1.5'
/bin/mkdir: cannot create directory `/usr/share/postgresql/9.0/contrib': Permission denied
make[1]: *** [installdirs] Error 1

Change History

Changed 3 years ago by kneufeld

Similar issue reported here a while ago: http://trac.osgeo.org/postgis/ticket/160

I believe is current solution is something like:

./configure make DESTDIR=/path/to/somewhere install

Changed 2 years ago by sharpie

+1 to getting this fixed. When I give a configure script a --prefix to install to, I expect all files to be installed under that prefix. Any behavior that deviates from this makes me very nervous about running sudo make install as I have no idea upfront what the consequences will be.

Changed 2 years ago by sharpie

Ok, it appears installation can be made to work as expected by installing in the following manner:

./configure whatever args you need
make
make install DESTDIR=/where/you/want/PostGIS/to/live REGRESS=1

It seemed to be necessary to execute make before make install. The REGRESS=1 flag keeps the installation from regenerating the entire PostgreSQL prefix under destdir.

Mind that you may need to relocate the libraries so that Postgres can find them in the $libpath.

The one stray sheep in the current SVN head is raster2pgsql.py, the PGSQL_BINDIR variable in raster/scripts/python/Makefile appears to be hardcoded to the Postgres prefix at configure time and therefore ignores the effects of DESTDIR and REGRESS. However one stray make variable is relatively easy to hunt down and fix.

The only thing that still bothers me is that the REGRESS argument feels like it was intended for developers to use while developing and not for users while installing. This makes me wonder if this argument will always be there or if it's behavior will change.

Changed 2 years ago by robe

  • milestone changed from PostGIS 1.5.3 to PostGIS 2.0.0

Changed 17 months ago by strk

  • owner changed from pramsey to strk
  • component changed from postgis to build/upgrade/install

Changed 16 months ago by pramsey

  • milestone changed from PostGIS 2.0.0 to PostGIS 2.1.0

Let's be honest with ourselves, this isn't changing for 2.0.

Changed 15 months ago by sharpie

It would be nice if tools such as shp2pgsql at least ended up under --prefix/bin. I understand that the dynamic libraries need to be located according to the wishes of PostgreSQL, but there is no good reason for having the tools disrespect the --prefix flag.

Changed 9 months ago by Sharpie

Also, now that other projects such as SpatiaLite are using liblwgoem, there is no reason for that library and its header files to get squirreled away in the Postgres rabbit hole either.

Changed 9 months ago by strk

Agreed. I think in presence of a --prefix we should be installing binaries, libraries AND postgresql modules all under the given prefix. It used to be like that a long time ago (before PGXS came into play)

Changed 7 weeks ago by robe

  • type changed from defect to enhancement
  • milestone changed from PostGIS 2.1.0 to PostGIS Future

I think this needs more discussion. I don't really feel keen about changing this in 2.1 as I fear it will introduce more issues/questions than it solves. Punting to future. We really don't want people using --prefix period (since in other systems it emans everythign is installed there not half installed) and if we have that I would prefer something that was more deliberate that only commandline tools will be installed in said prefix location. something like --tools-prefix=...

Note: See TracTickets for help on using tickets.