File mingw64-kdelibs4-lang.spec of Package mingw64-kdelibs4-lang

#
# spec file for package mingw64-kdelibs4-lang
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define _name   kdelibs4-lang
%define _version 4.14.60
Name:           mingw64-%{_name}

BuildRequires:  mingw64-filesystem
BuildRequires:  kde4-l10n-ar
BuildRequires:  kde4-l10n-bg
BuildRequires:  kde4-l10n-bs
BuildRequires:  kde4-l10n-ca
BuildRequires:  kde4-l10n-caValencia
BuildRequires:  kde4-l10n-cs
BuildRequires:  kde4-l10n-da
BuildRequires:  kde4-l10n-de
BuildRequires:  kde4-l10n-el
BuildRequires:  kde4-l10n-en_GB
BuildRequires:  kde4-l10n-es
BuildRequires:  kde4-l10n-et
BuildRequires:  kde4-l10n-eu
BuildRequires:  kde4-l10n-fa
BuildRequires:  kde4-l10n-fi
BuildRequires:  kde4-l10n-fr
BuildRequires:  kde4-l10n-ga
BuildRequires:  kde4-l10n-gl
BuildRequires:  kde4-l10n-he
BuildRequires:  kde4-l10n-hi
BuildRequires:  kde4-l10n-hr
BuildRequires:  kde4-l10n-hu
BuildRequires:  kde4-l10n-ia
BuildRequires:  kde4-l10n-id
BuildRequires:  kde4-l10n-is
BuildRequires:  kde4-l10n-it
BuildRequires:  kde4-l10n-ja
BuildRequires:  kde4-l10n-kk
BuildRequires:  kde4-l10n-km
BuildRequires:  kde4-l10n-ko
BuildRequires:  kde4-l10n-lt
BuildRequires:  kde4-l10n-lv
BuildRequires:  kde4-l10n-mr
BuildRequires:  kde4-l10n-nb
BuildRequires:  kde4-l10n-nds
BuildRequires:  kde4-l10n-nl
BuildRequires:  kde4-l10n-nn
BuildRequires:  kde4-l10n-pa
BuildRequires:  kde4-l10n-pl
BuildRequires:  kde4-l10n-pt
BuildRequires:  kde4-l10n-pt_BR
BuildRequires:  kde4-l10n-ro
BuildRequires:  kde4-l10n-ru
BuildRequires:  kde4-l10n-sk
BuildRequires:  kde4-l10n-sl
BuildRequires:  kde4-l10n-sr
BuildRequires:  kde4-l10n-sv
#BuildRequires:  kde4-l10n-tg
BuildRequires:  kde4-l10n-tr
BuildRequires:  kde4-l10n-ug
BuildRequires:  kde4-l10n-uk
#BuildRequires:  kde4-l10n-vi
BuildRequires:  kde4-l10n-wa
BuildRequires:  kde4-l10n-zh_CN
BuildRequires:  kde4-l10n-zh_TW
Summary:        Lanaguage pack for KDE libraries
License:        LGPL-2.1-or-later
Group:          System/GUI/KDE
Url:            http://www.kde.org
Version:        %{_version}
Release:        0
BuildArch:      noarch

%description
This package contains the language pack for KDE libraries

%package -n mingw64-kdebase4-runtime-lang
Summary:        Language pack for KDE runtime
Group:          Development/Libraries/KDE

%description -n mingw64-kdebase4-runtime-lang
This package contains the language pack for KDE runtime applications

%package -n mingw64-khelpcenter-lang
Summary:        Language pack for KDE helpcenter
Group:          Development/Libraries/KDE

%description -n mingw64-khelpcenter-lang
This package contains the language pack for KDE helpcenter

%prep
%setup -q -c -T

function collect_lang {
    destdir=$PWD
    locale_path=/usr/share/locale/
    for f in $(echo $1); do
        for i in $(find $locale_path -name $f); do
                name=$(basename $i)
                dir=$(dirname $i | sed "s,$locale_path,share/locale/,g")
                lang=$(echo $dir | sed "s,^.*locale/,,g;s,/LC_.*$,,g")
                echo "%lang($lang) %{_mingw64_prefix}/$dir/$name" >> $2
                p=$destdir/$dir
                install -d $p
                install -m 644 $i $p
        done
    done
}

function collect_scripts {
    destdir=$PWD
    locale_path=/usr/share/locale/
    for f in $(echo $1); do
        for i in $(find $locale_path -name $f); do
                name=$(basename $i)
                dir=$(dirname $i | sed "s,$locale_path,share/locale/,g")
                lang=$(echo $dir | sed "s,^.*locale/,,g;s,/LC_.*$,,g")
                topdir=$(dirname $dir)
                echo "%dir %{_mingw64_prefix}/$topdir" >> $2
                echo "%dir %{_mingw64_prefix}/$dir" >> $2
                echo "%lang($lang) %{_mingw64_prefix}/$dir/$name" >> $2
                p=$destdir/$dir
                install -d $p
                install -m 644 $i $p
        done
    done
}
# install languages
collect_lang "entry.desktop kdelibs*.mo *qt*.mo kdecalendarsystems.mo kcm_ssl.mo kio[_a-z4]*.mo" kdelibs.lang
collect_scripts "kdelibs4.js" kdelibs.lang
collect_lang "kcmlocale.mo kcm_locale.mo kcm_platform.mo kded_winstartmenu.mo *wallet*.mo *kwins*.mo *uiserver*.mo *debugdialog*.mo" runtime.lang
collect_lang "khelpcenter.mo" helpcenter.lang
cp /usr/share/locale/locale.alias share/locale

%build

%install
mkdir -p %{buildroot}%{_mingw64_prefix}
cp -a share %{buildroot}%{_mingw64_prefix}

%files -f kdelibs.lang
%defattr(-,root,root)
%{_mingw64_prefix}/share/locale/locale.alias
# todo still needed where comes the sr@ijekavianlatin1 from
%dir %{_mingw64_prefix}/share/locale/sr@ijekavianlatin
%dir %{_mingw64_prefix}/share/locale/sr@ijekavianlatin/LC_MESSAGES

%files -n mingw64-kdebase4-runtime-lang -f runtime.lang
%defattr(-,root,root)
# todo still needed where comes the sr@ijekavianlatin1 from
%dir %{_mingw64_prefix}/share/locale/sr@ijekavianlatin
%dir %{_mingw64_prefix}/share/locale/sr@ijekavianlatin/LC_MESSAGES

%files -n mingw64-khelpcenter-lang -f helpcenter.lang
%defattr(-,root,root)
# todo still needed where comes the sr@ijekavianlatin1 from
%dir %{_mingw64_prefix}/share/locale/sr@ijekavianlatin
%dir %{_mingw64_prefix}/share/locale/sr@ijekavianlatin/LC_MESSAGES

%changelog
openSUSE Build Service is sponsored by