Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to create a package of Apache and its dependencies:

sudo make package-recursive \
__MAKE_CONF=~/make.apache22.conf \
PKGREPSOITORY=/usr/home/gvkv

Everything works fine; Apache and its dependencies compile and install and apache22.tbz is in gvkv. The problem is that the dependency packages are built in their respective ports/<package> directories! There are about fifteen of them and while it's easy enough to retrieve them with find and a perl one-liner, surely there must be a way to tell make to run in an environment such that the dependency packages end up in gvkv.

share|improve this question
add comment

2 Answers

Part of the fun of using FreeBSD is dealing with the ports subsystem. It's good in many ways--easy installation and upgrading within the FreeBSD ecosystem but poor in others--setting variables via make configuration files or environment don't work as expected or even as advertised.

Nevertheless, SirDice has come to the rescue with a neat little trick:

mount -t nullfs /directory/for/pkgs /usr/ports/packages

which is really cool because it bypasses the use of environment variables and you can set the destination directory for wherever you want. Very helpful if you're (like me) using a 'build-jail' to make packages that are installed on different systems or other jails.

The /usr/ports/packages directory is where PACKAGES points to (if it exists) which is supposedly able to point somewhere else but didn't work for me. The man page stipulates setting PKGREPOSITORY which only works if you are building a single package.

share|improve this answer
add comment

I've read that that PKGREPOSITORY is dependent on PACKAGES.

You can set PACKAGES in /etc/make.conf. For example:

DISTDIR= /opt/portbuild/distfiles
PACKAGES=/opt/portbuild/packages
share|improve this answer
    
That's true--it works as long as there is only one package to build; otherwise, if you are also building the dependencies, they are written to their respective ports directories. –  gvkv Aug 21 '10 at 1:15
    
For us, the package and the dependencies are all written to /opt/portbuild/packages –  Stefan Lasiewski Aug 21 '10 at 17:25
    
Make sure the PACKAGES directory exists before running the make. –  Craig Aug 24 '10 at 19:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.