about /usr/ports make with options..

Andrew J Caines A.J.Caines at halplant.com
Sat Aug 23 09:15:56 PDT 2003


Person who has forgotten their own name,

> i always download the source code compile by myself, it just need to make
> with some options such as .. make --prefix=/usr/local/apache
> --enable-module=so But i found someone said install by /usr/ports also
> can do that, it also add options at make in /usr/ports, i want to know how
> can i check the options the packages have, how can i know it..

It's simple when you use the excellent "portupgrade" port.

After updating your ports collection (with cvsup), install portupgrade..

	# cd /usr/ports/sysutils/portupgrade/
	# make && sudo make install

Take a look at the file pkgtools.conf.sample which you should find in
/usr/local/etc to see how it works and take a look at the manual page
pkgtools.conf(5).

Create your own pkgtools.conf with your preferred make options. For
example, I have..

  MAKE_ARGS = {
     'audio/xmms' => '-DWITHOUT_3DNOW',
     'irc/xchat' => '-DWITH_SSL -DWITH_TRANSPARENCY',
     'mail/postfix' => 'BATCH=1 POSTFIX_OPTIONS=""',
     'multimedia/mplayer' => '-DWITHOUT_RUNTIME_CPUDETECTION -DWITH_OPTIMIZED_CFLAGS -DWITHOUT_MENCODER -DWITH_FREETYPE',
     'www/mozilla-*' => '-DWITHOUT_MAILNEWS -DWITHOUT_LDAP -DWITHOUT_CHATZILLA -DWITHOUT_COMPOSER',
  }

In your case you're trying to redefine an internal ports variable rather
than the port-specific examples I have, but the same idea should apply.
I'd expect something like this to work for your customisations:

  MAKE_ARGS = {
     'www/apache13' => 'PREFIX=/usr/local/apache CONFIGURE_ARGS+=--enable-module=so',
     'www/apache2' => 'PREFIX_RELDEST=/usr/local/apache',
  }

This should change the base for all installed files to /usr/local/apache
instead of the default (/usr/local) and add "--enable-module=so" to the
CONFIGURE_ARGS variable which you can see in the Apache 1.3 Makefile.

There are possibly better variables to change since Apache is a fairly
complex port and has its own layout issues, for example you may be able to
simply choose another --enable-layout version. Note that Apache's --prefix
is not the same as the port's ${PREFIX} or ${LOCALBASE}. See more details
about ports variables in /usr/ports/Mk/bsd.port.mk.

Personally, I'd just install the port with the default layout and copy
your custom files into the new locations, just for the sake of simplicity.

Install or update the port using portupgrade, eg.

	# portupgrade --new --upward-recursive --recursive --sudo --uninstall --verbose www/apache13

See portupgrade(1).

Caveat emptor. I haven't tried this and it make not work.


-Andrew-
-- 
 _______________________________________________________________________
| -Andrew J. Caines-   Unix Systems Engineer   A.J.Caines at halplant.com  |
| "They that can give up essential liberty to obtain a little temporary |
|  safety deserve neither liberty nor safety" - Benjamin Franklin, 1759 |


More information about the freebsd-hackers mailing list