Port maintainer query: what to use to specify serial port?

Sam Lawrance boris at brooknet.com.au
Wed May 10 05:07:29 UTC 2006


On 10/05/2006, at 1:54 PM, David Wolfskill wrote:

> The author of the port I maintain (astro/gpsman) has recently informed
> me that he's released an updated distribution, so I'd like to  
> update the
> FreeBSD port to correspond.
>
> It's a pretty simple port -- it's a Tcl/Tk application; there's no
> compilation involved.
>
> But it is developed under Linux, so the port has a few patches to the
> author's code to make things work better (or "at all") in FreeBSD.
>
> One of the patches has historically changed the default serial port  
> from
> /dev/ttyS0 to /dev/cuaa0.
>
> But I just noticed that my laptop (running 6.1-STABLE) doesn't have
> /dev/cuaa0.  Right; that was one of the changes from 4.x, so it should
> be /dev/cuad0... well, for 6.x.  Is there a decent way to make the
> replacement appropriate for the OS running at the time of installation
> (that isn't so much additional hassle that it's not really worth the
> bother)?  Do we care enough about 4.x to address this issue?
>
> Please respond to me, as I'm not subscribed to this list (Reply-To
> set intentionally); feel free to also include the list as a recipient
> of your message if you believe it will be beneficial to do so.

Instead of a device name, you can put something like %%SERIAL%% in  
the patched file.  Then in the port makefile:

.include <bsd.port.pre.mk>

.if ${OSVERSION} >= 600000
GPSMAN_DEFAULT_PORT?=	/dev/cuad0
.else
GPSMAN_DEFAULT_PORT?=	/dev/cuaa0
.endif

post-patch:
	${REINPLACE_CMD} "s|%%SERIAL%%|${GPSMAN_DEFAULT_PORT}|" ${WRKSRC}/ 
file_to_patch.tcl




More information about the freebsd-ports mailing list