phpldapadmin/lang/Makefile

145 lines
4.5 KiB
Makefile
Raw Normal View History

2009-06-30 08:09:20 +00:00
#
2009-06-30 08:10:17 +00:00
# This Makefile (lang/Makefile) converts the source lang files to UTF8
# coding. You need iconv installed to use it.
2009-06-30 09:22:30 +00:00
# $Header: /cvsroot/phpldapadmin/phpldapadmin/lang/Makefile,v 1.24 2004/12/09 14:12:16 uugdave Exp $
2009-06-30 08:10:17 +00:00
# ToDo: detect the encoding in the "source"
#
# posible detect of the language
# echo `cat de.php | grep "logged_in_as" | sed s/".*="//g | file - | sed s/".*: "//g | sed s/" .*"//g`
#
# or
2009-06-30 09:22:30 +00:00
#
2009-06-30 08:10:17 +00:00
# maybe like this
# cat LANG.php | sed s/"^\/"//g | sed s/".*= "//g | sed s/";.*"//g | grep -v "<"| file - | sed s/".*: "//g | sed s/" .*"//g
2009-06-30 09:22:30 +00:00
# Where to place the recoded language files
2009-06-30 08:09:20 +00:00
DESTDIR=./recoded
2009-06-30 09:22:30 +00:00
# Path to the iconv binary
2009-06-30 08:10:17 +00:00
ICONV=iconv
2009-06-30 09:22:30 +00:00
# Path to the PHP binary
2009-06-30 08:10:17 +00:00
PHP=php
TARGETS=${DESTDIR}/auto.php \
${DESTDIR}/ca.php \
2009-06-30 09:22:30 +00:00
${DESTDIR}/cz.php \
2009-06-30 08:09:20 +00:00
${DESTDIR}/de.php \
${DESTDIR}/en.php \
${DESTDIR}/es.php \
${DESTDIR}/fr.php \
2009-06-30 09:22:30 +00:00
${DESTDIR}/hu.php \
2009-06-30 08:09:20 +00:00
${DESTDIR}/it.php \
2009-06-30 09:22:30 +00:00
${DESTDIR}/ja.php \
2009-06-30 08:09:20 +00:00
${DESTDIR}/nl.php \
2009-06-30 09:22:30 +00:00
${DESTDIR}/pl.php \
${DESTDIR}/pt-br.php \
${DESTDIR}/ru.php \
${DESTDIR}/sv.php \
${DESTDIR}/zz.php \
${DESTDIR}/zzz.php
# OFF zh-tw.php
# ${DESTDIR}/zh-tw.php \
2009-06-30 08:10:17 +00:00
default:
@echo "usage:"
@echo " make iconvlang - to generate the lang coding"
@echo " make iconvclean - to remove the utf8-converted file in ${DESTDIR}"
2009-06-30 08:09:20 +00:00
2009-06-30 08:10:17 +00:00
iconvlang: prepare ${TARGETS} syntax
2009-06-30 08:09:20 +00:00
@echo "Setting permissions..."
@chmod 644 ${TARGETS}
@echo "Done!"
2009-06-30 08:10:17 +00:00
syntax:
2009-06-30 09:22:30 +00:00
@echo "Starting syntax checking..."
2009-06-30 08:10:17 +00:00
@which $(PHP) >/dev/null 2>&1 || ( echo "You must have '$(PHP)' installed to use this Makefile, but I could not find it in your path!" && exit 1 )
@for i in ${TARGETS}; do ${PHP} -l $$i >/dev/null 2>&1 || ( echo "Syntax errors found in $$i!" && exit 1 ); done
2009-06-30 09:22:30 +00:00
@echo "Done"
2009-06-30 08:09:20 +00:00
prepare:
2009-06-30 08:10:17 +00:00
@echo "Starting prepare"
@which $(ICONV) >/dev/null 2>&1 || ( echo "You must have GNU '$(ICONV)' installed to use this Makefile, but I could not find it in your path!" && exit 1 )
2009-06-30 08:09:20 +00:00
@mkdir -p ${DESTDIR}
@chmod 755 ${DESTDIR}
2009-06-30 08:10:17 +00:00
iconvclean:
@echo "deleting files "${TARGETS}
@rm -vf ${TARGETS}
@echo "now use 'make iconvlang' to encode, otherwise you could not use phpldapadmin"
${DESTDIR}/auto.php: auto.php
@echo "Fixing encoding auto.php to UTF8 "${DESTDIR}/auto.php
@iconv -f iso8859-1 -t utf8 auto.php > ${DESTDIR}/auto.php
2009-06-30 08:09:20 +00:00
2009-06-30 08:10:17 +00:00
${DESTDIR}/ca.php: ca.php
@echo "Fixing encoding ca.php to UTF8 "${DESTDIR}/ca.php
@iconv -f iso8859-1 -t utf8 ca.php > ${DESTDIR}/ca.php
2009-06-30 08:09:20 +00:00
2009-06-30 09:22:30 +00:00
${DESTDIR}/cz.php: cz.php
@echo "Fixing encoding cz.php to UTF8 "${DESTDIR}/cz.php
@iconv -f iso8859-2 -t utf8 cz.php > ${DESTDIR}/cz.php
2009-06-30 08:09:20 +00:00
${DESTDIR}/de.php: de.php
2009-06-30 08:10:17 +00:00
@echo "Fixing encoding de.php to UTF8 "${DESTDIR}/de.php
@iconv -f iso8859-1 -t utf8 de.php > ${DESTDIR}/de.php
${DESTDIR}/en.php: en.php
@echo "Fixing encoding en.php to UTF8 "${DESTDIR}/en.php
@iconv -f iso8859-1 -t utf8 en.php > ${DESTDIR}/en.php
${DESTDIR}/es.php: es.php
@echo "Fixing encoding es.php to UTF8 "${DESTDIR}/es.php
@iconv -f iso8859-1 -t utf8 es.php > ${DESTDIR}/es.php
${DESTDIR}/fr.php: fr.php
@echo "Fixing encoding fr.php to UTF8 "${DESTDIR}/fr.php
@iconv -f iso8859-1 -t utf8 fr.php > ${DESTDIR}/fr.php
2009-06-30 09:22:30 +00:00
${DESTDIR}/hu.php: hu.php
@echo "Fixing encoding hu.php to UTF8 "${DESTDIR}/hu.php
#@iconv -f iso8859-2 -t utf8 hu.php > ${DESTDIR}/hu.php
cp hu.php ${DESTDIR}/.
2009-06-30 08:10:17 +00:00
${DESTDIR}/it.php: it.php
@echo "Fixing encoding it.php to UTF8 "${DESTDIR}/it.php
@iconv -f iso8859-1 -t utf8 it.php > ${DESTDIR}/it.php
2009-06-30 09:22:30 +00:00
${DESTDIR}/ja.php: ja.php
@echo "Copying only the ja.php"
@cp ja.php ${DESTDIR}/.
2009-06-30 08:10:17 +00:00
${DESTDIR}/nl.php: nl.php
@echo "Fixing encoding nl.php to UTF8 "${DESTDIR}/nl.php
@iconv -f iso8859-1 -t utf8 nl.php > ${DESTDIR}/nl.php
2009-06-30 08:09:20 +00:00
2009-06-30 09:22:30 +00:00
${DESTDIR}/pl.php: pl.php
@echo "Fixing encoding pl.php to UTF8 "${DESTDIR}/pl.php
@iconv -f iso8859-2 -t utf8 pl.php > ${DESTDIR}/pl.php
${DESTDIR}/pt-br.php: pt-br.php
@echo "Fixing encoding pt-br.php to UTF8 "${DESTDIR}/pt-br.php
@iconv -f iso8859-1 -t utf8 pt-br.php > ${DESTDIR}/pt-br.php
${DESTDIR}/sv.php: sv.php
@echo "Fixing encoding sv.php to UTF8 "${DESTDIR}/sv.php
@iconv -f iso8859-1 -t utf8 sv.php > ${DESTDIR}/sv.php
2009-06-30 08:10:17 +00:00
${DESTDIR}/ru.php: ru.php
@echo "Fixing encoding ru.php to UTF8 "${DESTDIR}/ru.php
2009-06-30 09:22:30 +00:00
@iconv -f utf8 -t utf8 ru.php > ${DESTDIR}/ru.php
#${DESTDIR}/zh-tw.php: zh-tw.php
# @echo "Copying only the zh-tw.php"
# @iconv -f utf8 -t utf8 zh-tw.php ${DESTDIR}/zh-tw.php
# INTERNAL BUG COULDN CONVERT IT, SO WE COPY IT
# cp zh-tw.php ${DESTDIR}/zh-tw.php
${DESTDIR}/zz.php: zz.php
@echo "Copying only the zz.php"
@cp zz.php ${DESTDIR}/.
${DESTDIR}/zzz.php: zzz.php
@echo "Copying only the zzz.php"
@cp zzz.php ${DESTDIR}/.