Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 2006 15:07:24 +1000
From:      Sam Lawrance <boris@brooknet.com.au>
To:        David Wolfskill <david@catwhisker.org>
Cc:        ports@freebsd.org
Subject:   Re: Port maintainer query: what to use to specify serial port?
Message-ID:  <9799FB13-4235-43C9-BE20-331EA82668D4@brooknet.com.au>
In-Reply-To: <20060510035430.GM545@bunrab.catwhisker.org>
References:  <20060510035430.GM545@bunrab.catwhisker.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9799FB13-4235-43C9-BE20-331EA82668D4>