Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Oct 2005 15:12:06 -0300
From:      Fernan Aguero <fernan@iib.unsam.edu.ar>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        FreeBSD Ports <ports@freebsd.org>, Roman Neuhauser <neuhauser@sigpipe.cz>
Subject:   Re: make port to install to a different PREFIX
Message-ID:  <20051007181206.GM45909@iib.unsam.edu.ar>
In-Reply-To: <20051004141129.GA61667@xor.obsecurity.org>
References:  <20051003184904.GB46117@iib.unsam.edu.ar> <20051004092830.GC1633@isis.sigpipe.cz> <20051004141129.GA61667@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks Kris and Roman for the suggestions, and sorry for the
delay in replying. I'm not there yet, but I've made some
progress and found the reason for why setting PREFIX in
CONFIGURE_ARGS doesn't work. Read on,

+----[ Kris Kennaway <kris@obsecurity.org> (04.Oct.2005 11:16):
|
| On Tue, Oct 04, 2005 at 11:28:30AM +0200, Roman Neuhauser wrote:
| > # fernan@iib.unsam.edu.ar / 2005-10-03 15:49:04 -0300:
| > > I'm the maintainer of the biology/emboss port. The port
| > > installs by default to $PREFIX which, in most cases should
| > > be $LOCALBASE (i.e. /usr/local).
| > > 
| > > EMBOSS is a big package, with lots of executable files. It
| > > is thus not surprising that some of the executables have the
| > > same name as those installed by other ports.
| > > 
| > > Right now these are the recorded conflicts:
| > > CONFLICTS=      nss-* qmail-ldap2-* digest-*
| > > 
| > > To work around this, I was thinking about installing
| > > biology/emboss by default to PREFIX/emboss.
| > > However, I'm having problems in getting this to work.
| > > 
| > > This does not work:
| > > CONFIGURE_ARGS+= --prefix=${PREFIX}/emboss

Actually this should be correct. Without redefining PREFIX
adding just this one line should do it. Several other ports
install to a different prefix by default by doing just this:
grep -rH 'CONFIGURE_ARGS.*--prefix=${PREFIX}/${PORTNAME}' /usr/ports

However ... it seems like there's a subtle overlay of
effects going on here:

| > > and neither does this:
| > > PREFIX?= ${PREFIX}/emboss
| > > 
| > > because obviously 'Variable PREFIX is recursive.'
| > 
| >     Either use PREFIX?=${LOCALBASE}/emboss, or use another approach (IMO
| 
| This is wrong.  Ports install into PREFIX, not LOCALBASE.

OK, yes, we should not fiddle with LOCALBASE :)

| >     better, but depends on whether the configure script supports it):
| >     CONFIGURE_ARGS+=--program-prefix=emboss-

I discarded this option, since it would mean that emboss
apps would have different names in FreeBSD. I prefer to have
it installed someplace else, with the names of apps
unchanged. This would save some pain to users that come from
other unices. 

| Yes, you need to force the vendor software to install where you tell
| it to.  Once you figure out how the software installs itself into a
| directory of your choosing, just do

Actually, as said above, passing --prefix=${PREFIX}/emboss
to CONFIGURE_ARGS should do that. In fact, if I compile
emboss on its own (without using the ports system),
configure does honour --prefix=/whateverpath and, as
expected, installs correctly in that place.

The problem appears when I use the ports system. I test the
port by doing: 'make install PREFIX=/usr/tmp/ports'
expecting that the port would be installed to
/usr/tmp/ports/emboss (because of CONFIGURE_ARGS). 

However this doesn't happen. For some reason, things get
installed into /usr/tmp/ports. 

Whatever prefix you specify in CONFIGURE_ARGS is ignored.
Why this happens is evident when you look at the resulting
config.log file

  $ ./configure --prefix=/usr/tmp/ports/emboss
  --x-libraries=/usr/X11R6/lib
  --x-includes=/usr/X11R6/include --prefix=/usr/tmp/ports
  i386-portbld-freebsd4.11

the first specification of --prefix is the one set in
CONFIGURE_ARGS, the second is the one added by bsd.port.mk
(either the default or the one set in the command line or
environment), thus overriding CONFIGURE_ARGS.

Maybe I should set CONFIGURE_ARGS absolutely? Right not I'm
using '+=' to set CONFIGURE_ARGS to preserve whatever
bsd.port.mk would like to add here ... 

Anyway, it seems like this has bitten others:
http://lists.freebsd.org/pipermail/freebsd-ports/2005-June/024096.html
http://www.monkey.org/openbsd/archive/ports/9904/msg00071.html

In the last thread referenced above, it is suggested that setting
PREFIX:= ${PREFIX}/${PORTNAME}
could be a solution. I've tried this and it works for
the installation step, but not at deinstall:
===> emboss-3.0.0 has a different PREFIX: /usr/tmp/ports/emboss, skipping

Is there a solution that I've missed? Or maybe we should
have a discussion to bring something like
GNU_CONFIGURE_PREFIX used by NetBSD (mentioned in the first
message referenced above).

| EMBOSS_PREFIX?=${PREFIX}/emboss
| 
| and install into ${EMBOSS_PREFIX}.
|  
| Kris
|
+----]

Again, any help would be appreciated. Thanks,

Fernan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051007181206.GM45909>