Utilize FILES and SYMLINKS.

This commit is contained in:
Ruslan Ermilov 2004-10-17 09:48:23 +00:00
parent af2e24d782
commit ec3bd973b7

View File

@ -1,8 +1,5 @@
# $FreeBSD$
NOMAN=YES
CLEANFILES+= ${LOCALES:S/$/.out/g}
LOCALES= UTF-8 \
am_ET.UTF-8 \
be_BY.CP1131 \
@ -32,19 +29,50 @@ LOCALES= UTF-8 \
zh_HK.Big5HKSCS \
zh_TW.Big5
LOCALEDIR= ${DESTDIR}/usr/share/locale
LOCALEDIR= /usr/share/locale
.SUFFIXES: .src .out
.src.out:
mklocale -o ${.TARGET} ${.IMPSRC}
FILES= ${LOCALES:S/$/.out/}
FILESNAME= LC_CTYPE
.for locale in ${LOCALES}
FILESDIR_${locale}.out= ${LOCALEDIR}/${locale}
.endfor
CLEANFILES= ${FILES}
ENCODINGS= CP1251 ISO8859-1 ISO8859-2 ISO8859-4 ISO8859-5 ISO8859-9 \
ISO8859-15 US-ASCII UTF-8
ASCIILINKS= en_AU en_CA en_GB en_NZ en_US
US-ASCII_US-ASCII= ${ASCIILINKS:C/^/la_LN:/}
LATIN1XLINKS= af_ZA ca_ES da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_NZ \
en_US es_ES eu_ES fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH \
it_IT \
nl_BE nl_NL no_NO pt_PT sv_SE
LATIN1LINKS= ${LATIN1XLINKS} pt_BR
ISO8859-1_ISO8859-1= ${LATIN1LINKS:C/^/la_LN:/}
LATIN15LINKS= ${LATIN1XLINKS} et_EE
ISO8859-15_ISO8859-15= ${LATIN15LINKS:C/^/la_LN:/}
LATIN2LINKS= cs_CZ hr_HR hu_HU pl_PL sl_SI sr_YU ro_RO sk_SK
ISO8859-2_ISO8859-2= ${LATIN2LINKS:C/^/la_LN:/}
LATIN4LINKS= lt_LT
ISO8859-4_ISO8859-4= ${LATIN4LINKS:C/^/la_LN:/}
LATIN5LINKS= sr_YU uk_UA be_BY
ISO8859-5_ISO8859-5= ${LATIN5LINKS:C/^/ru_RU:/}
CP1251LINKS= ru_RU be_BY
CP1251_CP1251= ${CP1251LINKS:C/^/bg_BG:/}
UTF8LINKS= af_ZA be_BY bg_BG ca_ES cs_CZ da_DK de_AT de_CH de_DE el_GR \
en_AU en_CA en_GB en_IE en_NZ en_US es_ES et_EE eu_ES fi_FI \
fr_BE \
@ -52,52 +80,18 @@ UTF8LINKS= af_ZA be_BY bg_BG ca_ES cs_CZ da_DK de_AT de_CH de_DE el_GR \
ja_JP kk_KZ ko_KR lt_LT nl_BE nl_NL no_NO pl_PL pt_BR pt_PT \
ro_RO ru_RU sk_SK sl_SI sr_YU sv_SE tr_TR uk_UA zh_CN zh_HK \
zh_TW
UTF-8_UTF-8= ${UTF8LINKS:C/^/:/}
.SUFFIXES: .src .out
US-ASCII_ISO8859-9= la_LN:tr_TR
.src.out:
mklocale -o ${.TARGET} ${.IMPSRC}
all: ${LOCALES:S/$/.out/g}
afterinstall:
.for locale in ${LOCALES}
${INSTALL} -m 644 -o ${BINOWN} -g ${BINGRP} \
${locale}.out ${LOCALEDIR}/${locale}/LC_CTYPE
SYMLINKS=
.for enc1 in ${ENCODINGS}
.for enc2 in ${ENCODINGS}
.for lang_terr in ${${enc1}_${enc2}}
SYMLINKS+= ../${lang_terr:C/:.*$//:C/.+$/&./}${enc1}/${FILESNAME} \
${LOCALEDIR}/${lang_terr:C/^.*://}.${enc2}
.endfor
.for link in ${LATIN1LINKS}
ln -fs ../la_LN.ISO8859-1/LC_CTYPE \
${LOCALEDIR}/${link}.ISO8859-1/LC_CTYPE
.endfor
.for link in ${LATIN15LINKS}
ln -fs ../la_LN.ISO8859-15/LC_CTYPE \
${LOCALEDIR}/${link}.ISO8859-15/LC_CTYPE
.endfor
.for link in ${LATIN2LINKS}
ln -fs ../la_LN.ISO8859-2/LC_CTYPE \
${LOCALEDIR}/${link}.ISO8859-2/LC_CTYPE
.endfor
.for link in ${LATIN4LINKS}
ln -fs ../la_LN.ISO8859-4/LC_CTYPE \
${LOCALEDIR}/${link}.ISO8859-4/LC_CTYPE
.endfor
.for link in ${LATIN5LINKS}
ln -fs ../ru_RU.ISO8859-5/LC_CTYPE \
${LOCALEDIR}/${link}.ISO8859-5/LC_CTYPE
.endfor
.for link in ${CP1251LINKS}
ln -fs ../bg_BG.CP1251/LC_CTYPE \
${LOCALEDIR}/${link}.CP1251/LC_CTYPE
.endfor
.for link in ${ASCIILINKS}
ln -fs ../la_LN.US-ASCII/LC_CTYPE \
${LOCALEDIR}/${link}.US-ASCII/LC_CTYPE
.endfor
ln -fs ../la_LN.US-ASCII/LC_CTYPE \
${LOCALEDIR}/tr_TR.ISO8859-9/LC_CTYPE
.for link in ${UTF8LINKS}
ln -fs ../UTF-8/LC_CTYPE \
${LOCALEDIR}/${link}.UTF-8/LC_CTYPE
.endfor
.include <bsd.prog.mk>