From owner-freebsd-ports@FreeBSD.ORG Sun Sep 14 00:49:35 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 209AB1065676 for ; Sun, 14 Sep 2008 00:49:35 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85]) by mx1.freebsd.org (Postfix) with ESMTP id 9F6568FC1A for ; Sun, 14 Sep 2008 00:49:29 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Kefnr-0000ue-Er; Sun, 14 Sep 2008 04:49:27 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 712DD1178C; Sun, 14 Sep 2008 04:49:41 +0400 (MSD) Received: by hades.panopticon (Postfix, from userid 1000) id 8E64B17031; Sun, 14 Sep 2008 04:49:20 +0400 (MSD) Date: Sun, 14 Sep 2008 04:49:20 +0400 From: Dmitry Marakasov To: Chris H Message-ID: <20080914004920.GD37740@hades.panopticon> References: <20080912105907.hgkvg352gco0k8ow@webmail.1command.com> <20080912211222.GA37740@hades.panopticon> <20080912214349.xrprskkcg00gw080@webmail.1command.com> <20080913125407.GC37740@hades.panopticon> <20080913115506.y6dyjx8k8wcggk0g@webmail.1command.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20080913115506.y6dyjx8k8wcggk0g@webmail.1command.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-ports@freebsd.org Subject: Re: a $PREFIX question... X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 00:49:35 -0000 * Chris H (chris#@1command.com) wrote: JFYI, I'm not php user, but I have more than enough experience of ports hacking, so I may miss something php-specific, though I have some thoughts. >> For jail there's DESTDIR. > Ahh. That's good to know. I had thought to look to the BIND port as a > model for a jail. But, since I'm really just trying to get both PHP4 and > PHP5 to install in such a manner as to prevent symbol collisions, I > thought that simply keeping the configure/install the same as it is > now, but substituting php, for php5 would be the most efficient, and > tidy approach. It appears that all I'm dealing with is: > > /usr/local/lib/php > /usr/local/include/php > /usr/local/etc/php && php.conf > /usr/local/bin/php || pgp-cgi Ah, sorry. Actually I wasn't aware that php installs stuff into */php directories. In this case maybe changing /php to /php5 may really be more convenient. > Which - if I have a reasonable understanding of all this, translates to: > $PREFIX || $LOCALBASE/php no? No. Now I finally understand your question :) LOCALBASE (/usr/local by default) is a place where all software installed through ports will go. It is also where ports search for libraries, includes etc. installed by other ports. PREFIX (LOCALBASE by default, thus /usr/local as well) is where the currently installed port goes. No one should really redefine LOCALBASE, but you may change prefix to install a specific port to some nondefault location. Those have nothing to do with /php dirs. It seems to be php-specific feature to install it's files under /php subdirs everywhere. So, by default (prefix=/usr/local) e.g. php cli binary will be installed as /usr/local/bin/php/php /usr/local/etc/php.conf /usr/local/include/php/Zend/zend.h ... and if you change PREFIX to /usr/local/php5 that'll be /usr/local/php5/bin/php/php /usr/local/php5/etc/php.conf /usr/local/php5/include/php/Zend/zend.h ... If you change PREFIX to /newphp, that'll be /newphp/bin/php/php /newphp/etc/php.conf /newphp/include/php/Zend/zend.h ... As you can see, changing PREFIX allows php4&5 to coexist, but some extra directory hierarchy is introduced. > So I figured that ultimately both php versions & the destination system ... > is /greatly/ appreciated here :)) Maybe the ultimate solution would be > to simply go the > $PREFIX/php && $PREFIX/php5 route. Thereby dropping (isolating) both > versions into their own trees. But if I understand any of this correctly, > I'll need to modify the system' environment to include these directories: > ($PREFIX/php/bin $PREFIX/php/lib $PREFIX/php/include && > $PREFIX/php5/bin $PREFIX/php5/lib $PREFIX/php5/include) > Does this make any sense? Just a quick flashback to possible solutions: Solution 1: change PREFIX Solution 2: hack port to use */php5 dirs instead of */php Other than changing all paths in the port's Makefile and pkg-plist, you'll need to hack configure to use different directories. What you need is to look into php's configure.in, all paths you'll need should be there. Since the port has USE_AUTOTOOLS=autoconf:262, configure will be generated from configure.in when you build the port automatically. There may be many caveats and other places to change paths, or there may not be. Yes, you'll need to `modify the system environment' to include paths to both php versions. This is where the problems start. Both php4 and php5 install equally named files, so if you need an app to use php5, you'll have to change PATH to include /usr/local/bin/php5/ or NEW_PHP_PREFIX/bin/php (depending on which way you chose); if an app needs php's includes, you'll also need to add /usr/loca/include/php5/ or NEW_PHP_PREFIX/include/php; same for lib/ and likely etc/. I believe that'd be hell. Even more problems if you intend to install something from ports which depend on php. Thus, if you really need both versions, I'd just install the version you need for more apps as default, and another version with changed PREFIX, period. No port hacking, just change path to php in some marginal apps. -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru