]> git.pld-linux.org Git - packages/rpm-build-macros.git/blame_incremental - dokuwiki-find-lang.sh
- up to 1.516; fix env cleaning
[packages/rpm-build-macros.git] / dokuwiki-find-lang.sh
... / ...
CommitLineData
1#!/bin/sh
2PROG=${0##*/}
3dir=$RPM_BUILD_ROOT/usr/share/dokuwiki
4langfile=$1
5tmp=$(mktemp) || exit 1
6rc=0
7
8find $dir -type d -name lang > $tmp
9
10echo '%defattr(644,root,root,755)' > $langfile
11while read dir; do
12 echo "%dir ${dir#$RPM_BUILD_ROOT}" >> $langfile
13 for dir in $dir/*; do
14 lang=${dir##*/}
15 dir=${dir#$RPM_BUILD_ROOT}
16 case "$lang" in
17 zh-tw)
18 lang=zh_TW
19 ;;
20 pt-br)
21 lang=pt_BR
22 ;;
23 sl-si)
24 lang=sl
25 ;;
26 id-ni)
27 lang=id_NI
28 ;;
29 ca-va)
30 lang=ca_VA
31 ;;
32 *-*)
33 echo >&2 "ERROR: Need mapping for $lang!"
34 rc=1
35 ;;
36 esac
37 echo "%lang($lang) ${dir#$RPM_BUILD_ROOT}" >> $langfile
38 done
39done < $tmp
40
41if [ "$(egrep -v '(^%defattr|^$)' $langfile | wc -l)" -le 0 ]; then
42 echo >&2 "$PROG: Error: international files not found!"
43 rc=1
44fi
45
46rm -f $tmp
47exit $rc
This page took 0.057196 seconds and 4 git commands to generate.