Opened 6 years ago

Last modified 21 months ago

#635 new enhancement

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:


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.


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 (16)

comment:1 Changed 6 years ago by kneufeld

Similar issue reported here a while ago:

I believe is current solution is something like:

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

comment:2 Changed 6 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.

comment:3 Changed 6 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 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, 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.

comment:4 Changed 6 years ago by robe

Milestone: PostGIS 1.5.3PostGIS 2.0.0

comment:5 Changed 5 years ago by strk

Component: postgisbuild/upgrade/install
Owner: changed from pramsey to strk

comment:6 Changed 5 years ago by pramsey

Milestone: PostGIS 2.0.0PostGIS 2.1.0

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

comment:7 Changed 5 years 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.

comment:8 Changed 5 years 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.

comment:9 Changed 5 years 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)

comment:10 Changed 4 years ago by robe

Milestone: PostGIS 2.1.0PostGIS Future
Type: defectenhancement

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=...

comment:11 Changed 3 years ago by strk

Milestone: PostGIS FuturePostGIS 2.2.0

I'm setting the target of this to 2.2.0 as I think it makes lots of sense to fix

comment:12 Changed 3 years ago by robe

okay but you aren't going to use --prefix right? you'll use something like --tools-prefix

comment:13 Changed 3 years ago by strk

The (GNU Coding) standard name for that switch is --bindir

comment:14 Changed 3 years ago by robe

sounds fine to me +1

comment:15 Changed 23 months ago by strk

Milestone: PostGIS 2.2.0PostGIS Future

I've no forces to do this for 2.2, if anyone wants to help (up with a patch ?) things may be done earlier

comment:16 Changed 21 months ago by strk

This is also needed for #3204

Note: See TracTickets for help on using tickets.