Date: Fri, 4 Jun 2004 19:39:18 +0400 From: Yar Tikhiy <yar@comp.chem.msu.su> To: ports@freebsd.org Subject: 2in1 port dirty tricks Message-ID: <20040604153918.GA28391@comp.chem.msu.su>
next in thread | raw e-mail | index | archive | help
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 accurately. 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 === #!/bin/sh for dir in lib milter-sender; do (cd $dir && (./configure "$@" || exit 1)) done === 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? -- Yar
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040604153918.GA28391>