Introduce new framework for handling packages' locale directories.

The logic is:
 - if package defines USE_PKGLOCALEDIR and PKGLOCALEDIR is not 'share' as GNU
   autotools expects then
 - fix variables 'localedir', 'gnulocaledir' and define coorect 'LOCALEDIR' in
   the Makefile.in.* files

From Packages.txt:

 10.29 Packages providing locale catalogues
 ==========================================

If the package provides its own locale catalogues, the variable
USE_PKGLOCALEDIR should be defined.  It will ensure that the package's
Makefile template files are fixed and point to the correct locale directories
(which may vary, depending on OS), if necessary.  See also section 5.1 for
details about ${PKGLOCALEDIR}.  This functionality is buildlink2-only.
This commit is contained in:
salo 2002-11-28 14:21:32 +00:00
parent 16a06b3d00
commit fd4ecd6aa4
2 changed files with 31 additions and 2 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Packages.txt,v 1.271 2002/11/17 09:00:30 salo Exp $
# $NetBSD: Packages.txt,v 1.272 2002/11/28 14:21:32 salo Exp $
###########################################################################
==========================
@ -2425,6 +2425,16 @@ post-install target by the INSTALL script generated by bsd.pkg.install.mk and
removed in the deinstall target by the DEINSTALL script.
10.29 Packages providing locale catalogues
==========================================
If the package provides its own locale catalogues, the variable
USE_PKGLOCALEDIR should be defined. It will ensure that the package's
Makefile template files are fixed and point to the correct locale directories
(which may vary, depending on OS), if necessary. See also section 5.1 for
details about ${PKGLOCALEDIR}. This functionality is buildlink2-only.
11 Submitting & Committing
==========================

View file

@ -1,4 +1,4 @@
# $NetBSD: bsd.buildlink2.mk,v 1.57 2002/11/26 22:46:59 jlam Exp $
# $NetBSD: bsd.buildlink2.mk,v 1.58 2002/11/28 14:21:34 salo Exp $
#
# An example package buildlink2.mk file:
#
@ -412,6 +412,25 @@ _REPLACE_BUILDLINK= \
${REPLACE_BUILDLINK} \
`${FIND} . ${_REPLACE_BUILDLINK_PATTERNS_FIND} -print | ${SED} -e 's|^\./||' | ${SORT} -u`
# Fix locale directory references.
#
USE_PKGLOCALEDIR?= no
_PKGLOCALEDIR= ${PREFIX}/${PKGLOCALEDIR}/locale
BUILDLINK_SUBST_MESSAGE.pkglocaledir= \
"Fixing locale directory references."
BUILDLINK_SUBST_FILES.pkglocaledir= \
`${FIND} . -name "Makefile.in*" -print | ${GREP} -v "\.orig"`
BUILDLINK_SUBST_SED.pkglocaledir= \
-e 's|^\(localedir[ ]*=\).*|\1 ${_PKGLOCALEDIR}|' \
-e 's|^\(gnulocaledir[ ]*=\).*|\1 ${_PKGLOCALEDIR}|' \
-e 's|\(-DLOCALEDIR[ ]*=\)[^ ]*\(.*\)|\1"\\"${_PKGLOCALEDIR}\\""\2|'
pkglocaledir-buildlink-subst: _BUILDLINK_SUBST_USE
.if (${PKGLOCALEDIR} != "share") && empty(USE_PKGLOCALEDIR:M[nN][oO])
pre-configure: pkglocaledir-buildlink-subst
.endif
# When "unbuildlinkifying" a file, we must remove references to the
# buildlink directories and change any -llib to the proper replacement
# libraries (-lreadline -> -ledit, etc.). Redundant -Idir and -Ldir