Proper way to detect build-time configuration if all files are under the same name?

Andrew Pantyukhin infofarmer at
Sat Sep 23 22:35:27 PDT 2006

On 9/23/06, LI Xin <delphij at> wrote:
> Hi,
> In ports/102613, the submitter has pointed out a problem that the build
> infrastructure can not detect the present OpenLDAP configuration at
> build time, and thus causing dependency problem when being rebuilt.
> This occurs on some other ports as well.
> Is it possible to make the package registration stage to detect actual
> port name that has installed the specified dependency file?  Or is there
> any way to solve the problem?
> Long version:
> Say, we have a file, called "${PREFIX}/foo/bar" installed by a port
> foo-1.0.  Another port, say, foo-feature-1.0, also installs that file.
> In the dependency of third port, say, bar-1.0, we define:
> RUN_DEPENDS=    ${PREFIX}/foo/bar:${PORTSDIR}/net/foo
> then the ports infrastructure would consider net/foo as dependency,
> regardless whether foo or foo-feature is acutaly installed.
> Of course it is possible to install a file with the name
> ${PREFIX}/foo/bar-feature but I think that's too dirty a hack...

You can detect foo vs foo-feature by various methods, from
different plists to querying /var/db/pkg, but (1) that's hacky
and (2) it will only work at package-building stage, not at
pkg_add one.

A solution is being sought. Debian has virtual packages,
I'll have a bit about it in my (slowly) upcoming paper. If
I find a better way, I'll talk about it, too.

More information about the freebsd-ports mailing list