Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / mk / configure / replace-localedir.mk
blobf26f50aa485637f6ff74a2ce3d93212bc8bb2cee
1 # $NetBSD: replace-localedir.mk,v 1.1 2006/07/05 06:09:15 jlam Exp $
3 ######################################################################
4 ### replace-localedir (PRIVATE)
5 ######################################################################
6 ### replace-localedir replaces the path to the locale directory in
7 ### various Makefiles with the one chosen by pkgsrc (PKGLOCALEDIR).
8 ###
9 .PHONY: replace-localedir
10 replace-localedir:
11 @${DO_NADA}
13 replace-localedir: subst-pkglocaledir
15 _PKGLOCALEDIR= ${PREFIX}/${PKGLOCALEDIR}/locale
17 REPLACE_LOCALEDIR_PATTERNS?= # empty
18 _REPLACE_LOCALEDIR_PATTERNS= ${REPLACE_LOCALEDIR_PATTERNS}
19 .if defined(HAS_CONFIGURE)
20 _REPLACE_LOCALEDIR_PATTERNS+= [Mm]akefile.in*
21 .else
22 _REPLACE_LOCALEDIR_PATTERNS+= [Mm]akefile*
23 .endif
24 _REPLACE_LOCALEDIR_PATTERNS_FIND_cmd= \
25 cd ${WRKSRC} && \
26 ${ECHO} "__dummy-entry__" && \
27 ${FIND} . \( ${_REPLACE_LOCALEDIR_PATTERNS:C/.*/-o -name "&"/g:S/-o//1} \) -print | \
28 ${SED} -e 's|^\./||' | \
29 ${SORT} -u
31 REPLACE_LOCALEDIR?= # empty
32 _REPLACE_LOCALEDIR= \
33 ${REPLACE_LOCALEDIR} \
34 ${_REPLACE_LOCALEDIR_PATTERNS_FIND_cmd:sh:N__dummy-entry__:N*.orig}
36 .if empty(USE_PKGLOCALEDIR:M[nN][oO])
37 SUBST_CLASSES+= pkglocaledir
38 .endif
39 SUBST_STAGE.pkglocaledir= do-configure-pre-hook
40 SUBST_MESSAGE.pkglocaledir= Fixing locale directory references.
41 SUBST_FILES.pkglocaledir= ${_REPLACE_LOCALEDIR}
42 SUBST_SED.pkglocaledir= \
43 -e 's|^\(localedir[ :]*=\).*|\1 ${_PKGLOCALEDIR}|' \
44 -e 's|^\(itlocaledir[ :]*=\).*|\1 ${_PKGLOCALEDIR}|' \
45 -e 's|^\(gnulocaledir[ :]*=\).*|\1 ${_PKGLOCALEDIR}|' \
46 -e 's|\(-DLOCALEDIR[ ]*=\)[^ ]*\(\.\*\)|\1"\\"${_PKGLOCALEDIR}\\""\2|'