LATEST_LINK / UNIQUENAME questions & patch

Brandon D. Valentine brandon at
Thu Feb 12 00:22:11 PST 2004

I'm updating some ports to fix duplicate LATEST_LINKs and have observed
the following.  I would appreciate feedback on it.

UNIQUENAME (line 1039) is defined before LATEST_LINK (line 2618) in but the definition of UNIQUE_NAME is wrapped in a
conditional test for the existence of LATEST_LINK.

If a port sets LATEST_LINK in it's Makefile before including
then UNIQUENAME gets set to LATEST_LINK.  If a port does not set
LATEST_LINK gets set to ${PKGBASE}, which expands to

In the case where a port does not set LATEST_LINK, LATEST_LINK and
UNIQUENAME can have different values.  It seems to me that UNIQUENAME
should include PKGNAMESUFFIX as well or by default be equivalent to
LATEST_LINK.  The current behavior could cause master / slave ports that
set PKGNAMESUFFIX to have the same UNIQUENAME.  Is this desirable?  Do
we assume master / slave ports always conflict?  If they don't already
exist I can forsee master / slave ports which need to coexist.

The attached patch defines PKGBASE and LATEST_LINK near the top of the
Makefile, just above the definition of UNIQUENAME and does away with the
conditional around UNIQUENAME's definition.  This patch is untested as
the only box currently at my disposal for testing at this moment is in
the middle of a massive portupgrade.

I have also noticed that DOCSDIR, EXAMPLESDIR, and DATADIR are set to
${PREFIX}/share/doc/${PORTNAME} right now.  My patch changes them to
${PREFIX}/share/doc/${UNIQUENAME} so that the documentation will not
collide in ports where different versions of a product may share the
same PORTNAME.  I didn't see any other obvious places where PORTNAME
should become UNIQUENAME.


Brandon D. Valentine
brandon at                 
Pseudo-Random Googlism:  winter is "for the birds"
-------------- next part --------------
Index: ports/Mk/
RCS file: /home/ncvs/ports/Mk/,v
retrieving revision 1.484
diff -u -r1.484
--- ports/Mk/	4 Feb 2004 04:27:04 -0000	1.484
+++ ports/Mk/	12 Feb 2004 07:50:27 -0000
@@ -1035,11 +1035,9 @@
 # where 'make config' records user configuration options
 PORT_DBDIR?=	/var/db/ports
-.if defined(LATEST_LINK)
 .if defined(OPTIONS)
@@ -2614,8 +2612,6 @@
 # The "latest version" link -- ${PKGNAME} minus everthing after the last '-'
 .if defined(PERL_CONFIGURE)
@@ -2760,9 +2756,9 @@
-DOCSDIR?=	${PREFIX}/share/doc/${PORTNAME}
-EXAMPLESDIR?=	${PREFIX}/share/examples/${PORTNAME}

More information about the freebsd-ports mailing list