#!/bin/sh ROOT=$(cd .. && pwd) PRGNAM=installer-translations DOMAINNAME=slint VERSION=14.2.1.2 BUILD=$(date -u +%Y%m%d) ARCH=noarch TAG=${TAG:-slint} CWD=$(pwd) TMP=$CWD PKG=$TMP/package-$PRGNAM OUTPUT=$CWD LIST=installer_scripts rm -rf $PKG mkdir -p $PKG/wip # Build the PO files # We first need to format the PO files in such a way that msggrep will # work. msggrep ignores references like: # File: , line: # But expects instead: #: : # for i in $(ls $ROOT/slint_po|grep -v pot|grep -v prev); do sed "/^#/{s/# File: /#: /;s/, line:[ ]*/:/}" $ROOT/slint_po/$i > $PKG/wip/$i msggrep -o $PKG/${i%%.*}.${DOMAINNAME}.po $(for j in $(<$LIST); do printf " -N *$j";done) $PKG/wip/$i done . $ROOT/scripts/SeTlocales # Compile the message catalogs for j in $(ls $PKG/*po); do i=$(basename $j) ll_TT=${i%%.*} SeTLocaleDir if [ "$LocaleDir" = "missing" ]; then printf %b "I don't know where to install the message catalog for ${ll_TT}.\n" printf %b "Please request that the file $ROOT/scripts/SeTlocales be completed\n" exit fi MO_DIR=$PKG/usr/share/locale/$LocaleDir/LC_MESSAGES mkdir -p $MO_DIR msgfmt --strict -c -v --statistics -o $MO_DIR/${DOMAINNAME}.mo $j rm -f $j chown root:root $MO_DIR/${DOMAINNAME}.mo chmod 644 $MO_DIR/${DOMAINNAME}.mo done rm -rf $PKG/wip mkdir -p $PKG/install cat << EOF > $PKG/install/slack-desc |-----handy-ruler------------------------------------------------------| installer-translations: installer-translations (translations of messages in Slint installer) installer-translations: installer-translations: This package contains translations of messages displayed by installer-translations: configurations scripts included in the Slint installer, thanks to the installer-translations: translators of the Slint project. Visit our website: http://slint.fr installer-translations: installer-translations: installer-translations: installer-translations: installer-translations: installer-translations: EOF ( cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} )