Subject: New Makefile variable SVR4_PKGNAME
To: None <tech-pkg@netbsd.org>
From: Bernd Ernesti <netbsd@arresum.inka.de>
List: tech-pkg
Date: 01/21/2001 12:30:35
Hi,

I plan to commit my changes for SVR4_PKGNAME today or tomorrow.
I allready discussed it with Hubert and Alistair, but it come to my
attention that it also needs a description what it is for.

Here is a description why we need it:

SVR4 has a lenght limitation of the package name: Only 9 characters are allowed.
Thats not a real problem since gensolpkg, which is used to create a SVR4
packages, curtails the PKGNAME to 9 characters, but there is a second problem.

Normaly you have a vendor identifier in that package name. gensolpkg uses
at the moment TNF, so we only have 6 characters left, and that is insufficient for
a few packages like the amanda ones. Where the real lenght should be limited
to 5 characters so one can choose to use a vendor string up to 4 characters.

So we need to find a way to shorten the PKGNAME to a usefull value.

Now, SVR4_PGKNAME comes into play.
We provide a name which should be unique enough and gensolpkg use that one.

I will update gensolpkg to 1.9 which contains this fix a few other fixes.

But first I need to change bsd.pkg.mk and packages.7.

Bernd


Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.644
diff -c -r1.644 bsd.pkg.mk
*** bsd.pkg.mk	2001/01/17 20:46:57	1.644
--- bsd.pkg.mk	2001/01/21 11:04:50
***************
*** 482,488 ****
  		MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM}		\
  		LOWER_VENDOR=${LOWER_VENDOR}				\
  		LOWER_OPSYS=${LOWER_OPSYS}				\
! 		PKGNAME=${PKGNAME}
  .if defined(PERL5_SITELIB)
  PLIST_SUBST+=	PERL5_SITELIB=${PERL5_SITELIB:S/^${LOCALBASE}\///}
  .endif
--- 482,489 ----
  		MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM}		\
  		LOWER_VENDOR=${LOWER_VENDOR}				\
  		LOWER_OPSYS=${LOWER_OPSYS}				\
! 		PKGNAME=${PKGNAME}					\
! 		SVR4_PKGNAME=${SVR4_PKGNAME}
  .if defined(PERL5_SITELIB)
  PLIST_SUBST+=	PERL5_SITELIB=${PERL5_SITELIB:S/^${LOCALBASE}\///}
  .endif
***************
*** 905,910 ****
--- 906,912 ----
  # Derived names so that they're easily overridable.
  DISTFILES?=		${DISTNAME}${EXTRACT_SUFX}
  PKGNAME?=		${DISTNAME}
+ SVR4_PKGNAME?=		${PKGNAME}
  
  MAINTAINER?=		packages@netbsd.org
  
***************
*** 2528,2535 ****
  # You probably won't need to touch these
  ################################################################
  
! # Set to "html" by the README.html target (and passed via build-depends-list
! # and run-depends-list)
  PACKAGE_NAME_TYPE?=	name
  
  # Nobody should want to override this unless PKGNAME is simply bogus.
--- 2530,2539 ----
  # You probably won't need to touch these
  ################################################################
  
! # Set to "html" by the README.html target to generate HTML code,
! # or to "svr4" to print SVR4 (Solaris, ...) short package names, from
! # SVR4_PKGNAME variable.
! # This variable is passed down via build-depends-list and run-depends-list
  PACKAGE_NAME_TYPE?=	name
  
  # Nobody should want to override this unless PKGNAME is simply bogus.
***************
*** 2538,2543 ****
--- 2542,2549 ----
  package-name:
  .if (${PACKAGE_NAME_TYPE} == "html")
  	@${ECHO} '<a href="../../${PKGPATH:S/&/\&amp;/g:S/>/\&gt;/g:S/</\&lt;/g}/README.html">${PKGNAME:S/&/\&amp;/g:S/>/\&gt;/g:S/</\&lt;/g}</A>'
+ .elif (${PACKAGE_NAME_TYPE} == "svr4")
+ 	@${ECHO} ${SVR4_PKGNAME}
  .else
  	@${ECHO} ${PKGNAME}
  .endif # PACKAGE_NAME_TYPE
***************
*** 2570,2576 ****
  		${PKG_INFO} -qf "$$pkg" | ${AWK} '/^@pkgdep/ {print $$2}'; \
  	else 							\
  		if cd $$dir 2>/dev/null; then				\
! 			${MAKE} ${MAKEFLAGS} run-depends-list PACKAGE_NAME_TYPE=${PACKAGE_NAME_TYPE}; \
  		else 							\
  			${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \
  		fi;							\
--- 2576,2582 ----
  		${PKG_INFO} -qf "$$pkg" | ${AWK} '/^@pkgdep/ {print $$2}'; \
  	else 							\
  		if cd $$dir 2>/dev/null; then				\
! 			${MAKE} ${MAKEFLAGS} run-depends-list PACKAGE_NAME_TYPE=${PACKAGE_NAME_TYPE}PACKAGE_DEPENDS_WITH_PATTERNS=${PACKAGE_DEPENDS_WITH_PATTERNS}; \
  		else 							\
  			${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \
  		fi;							\
Index: packages.7
===================================================================
RCS file: /cvsroot/sharesrc/share/man/man7/packages.7,v
retrieving revision 1.42
diff -c -r1.42 packages.7
*** packages.7	2001/01/18 10:19:42	1.42
--- packages.7	2001/01/21 11:05:02
***************
*** 173,178 ****
--- 173,187 ----
  .Pa ${DISTNAME}
  isn't really relevant for the package.  The default is
  .Pa ${DISTNAME} .
+ .It SVR4_PKGNAME	
+ Name of the package file to create if the
+ .Pa ${PKGNAME}
+ isn't unique enough on a SVR4 system. The default is
+ .Pa ${PKGNAME}
+ which may be shortened when you use gensolpkg. Only add SVR4_PKGNAME if
+ .Pa ${PKGNAME}
+ does not produce an unique package name on a SVR4 system.
+ The lenght of SVR4_PKGNAME is limited 5 characters.
  .It EXTRACT_ONLY
  If defined, a subset of
  .Pa ${DISTFILES}