summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsalo <salo@pkgsrc.org>2002-11-28 14:21:32 +0000
committersalo <salo@pkgsrc.org>2002-11-28 14:21:32 +0000
commitfd4ecd6aa4c722f283c44915f7f7f459f4cd119f (patch)
tree0816324ba177998c0433aa190a61935e25259562
parent16a06b3d0076e225dd13d542f71d4f11ac261c11 (diff)
downloadpkgsrc-fd4ecd6aa4c722f283c44915f7f7f459f4cd119f.tar.gz
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.
-rw-r--r--Packages.txt12
-rw-r--r--mk/buildlink2/bsd.buildlink2.mk21
2 files changed, 31 insertions, 2 deletions
diff --git a/Packages.txt b/Packages.txt
index 78eb44407fd..71bd4a994b2 100644
--- a/Packages.txt
+++ b/Packages.txt
@@ -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
==========================
diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk
index e9beddef2e3..2290eff183d 100644
--- a/mk/buildlink2/bsd.buildlink2.mk
+++ b/mk/buildlink2/bsd.buildlink2.mk
@@ -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