Opened 14 years ago

Closed 2 years ago

#635 closed enhancement (fixed)

configure ignores --prefix

Reported by: marcusbooster Owned by: strk
Priority: medium Milestone: PostGIS 3.4.0
Component: build 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 (21)

comment:1 by kneufeld, 14 years ago

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

comment:2 by sharpie, 14 years ago

+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 by sharpie, 14 years ago

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.

comment:4 by robe, 13 years ago

Milestone: PostGIS 1.5.3PostGIS 2.0.0

comment:5 by strk, 13 years ago

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

comment:6 by pramsey, 13 years ago

Milestone: PostGIS 2.0.0PostGIS 2.1.0

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

comment:7 by sharpie, 13 years ago

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 by Sharpie, 12 years ago

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 by strk, 12 years ago

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 by robe, 12 years ago

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 by strk, 10 years ago

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 by robe, 10 years ago

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

comment:13 by strk, 10 years ago

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

comment:14 by robe, 10 years ago

sounds fine to me +1

comment:15 by strk, 10 years ago

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 by strk, 9 years ago

This is also needed for #3204

comment:17 by robe, 7 years ago

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

comment:18 by strk, 3 years ago

I've started work on this in https://git.osgeo.org/gitea/postgis/postgis/pulls/100 Incredible, now after make install I actually have the shp2pgsql-gui application in my desktop menu, and IT WORKS upon clicking on it!

comment:19 by Sandro Santilli <strk@…>, 2 years ago

In 8a73d5ee/git:

Honour —prefix (and drop PGXS) for loader/dumper

References #635

comment:20 by strk, 2 years ago

Milestone: PostGIS Fund MePostGIS 3.4.0

I guess we can close this because —prefix is not ignored anymore now. It may still be good to use it more, but let's use another ticket for that :)

comment:21 by strk, 2 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.