- barf if lang files not found
[packages/dokuwiki-plugin-pagelist.git] / dokuwiki-find-lang.sh
1 #!/bin/sh
2 PROG=${0##*/}
3 dir=$RPM_BUILD_ROOT/usr/share/dokuwiki
4 langfile=$1
5
6 echo '%defattr(644,root,root,755)' > $langfile
7 find $dir -type d -name lang | while read dir; do
8         echo "%dir ${dir#$RPM_BUILD_ROOT}" >> $langfile
9         for dir in $dir/*; do
10                 lang=${dir##*/}
11                 dir=${dir#$RPM_BUILD_ROOT}
12                 case "$lang" in
13                 zh-tw)
14                         lang=zh_TW
15                 ;;
16                 pt-br)
17                         lang=pt_BR
18                 ;;
19                 sl-si)
20                         lang=sl
21                 ;;
22                 id-ni)
23                         lang=id_NI
24                 ;;
25                 *-*)
26                         echo >&2 "Need mapping for $lang!"
27                         exit 1
28                 ;;
29                 esac
30                 echo "%lang($lang) ${dir#$RPM_BUILD_ROOT}" >> $langfile
31         done
32 done
33
34 if [ "$(egrep -v '(^%defattr|^$)' $langfile | wc -l)" -le 0 ]; then
35         echo >&2 "$PROG: Error: international files not found!"
36         exit 1
37 fi
This page took 0.068918 seconds and 3 git commands to generate.