2in1 port dirty tricks

Yar Tikhiy yar at comp.chem.msu.su
Fri Jun 4 15:39:46 GMT 2004

Hi folks,

Today I tinkered with a port (mail/milter-sender) that actually
consisted of two independent parts, a library and a program.  They
share the same directory structure, but each of them has its own
subdirectory, configure script, and makefile.  Unfortunately, putting
the library into a separate port isn't an option since the library
seems tightly coupled with the program, so their versions must match

The port uses a hack to overcome such a problem--it mimics the
corresponding part of bsd.port.mk to call configure and then make
for the library.  The drawback of this approach is obvious: code
duplication--should bsd.port.mk change, the port will need to be
changed too.  I can see a somewhat better way: put configure and
makefile wrappers just above the directories for the program and
the library (named "milter-sender" and "lib") as follows:

=== begin configure ===

for dir in lib milter-sender; do
	(cd $dir && (./configure "$@" || exit 1))
=== end configure ===

=== begin makefile ===
SUBDIR=	lib milter-sender
.include <bsd.subdir.mk>
=== end makefile ===

and then set WRKSRC accordingly.

Or is there the Right Way to address this problem I don't know of?


More information about the freebsd-ports mailing list