[packages/qt5-qtconnectivity] - added translations (as -common)
qboosh
qboosh at pld-linux.org
Wed Jul 2 22:35:49 CEST 2014
commit 52175abff8ea7737394eb6cdec2c31c37792baca
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Jul 2 22:40:16 2014 +0200
- added translations (as -common)
qt5-qtconnectivity.spec | 54 ++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 51 insertions(+), 3 deletions(-)
---
diff --git a/qt5-qtconnectivity.spec b/qt5-qtconnectivity.spec
index d1d0c64..0814f04 100644
--- a/qt5-qtconnectivity.spec
+++ b/qt5-qtconnectivity.spec
@@ -1,6 +1,7 @@
#
# Conditional build:
%bcond_without qch # documentation in QCH format
+%bcond_without qm # QM translations
%define orgname qtconnectivity
%define qtbase_ver %{version}
@@ -15,6 +16,8 @@ License: LGPL v2.1 with Digia Qt LGPL Exception v1.1 or GPL v3.0
Group: Libraries
Source0: http://download.qt-project.org/official_releases/qt/5.3/%{version}/submodules/%{orgname}-opensource-src-%{version}.tar.xz
# Source0-md5: 46e4e8df94b4da4415aa5f5076b8bc45
+Source1: http://download.qt-project.org/official_releases/qt/5.3/%{version}/submodules/qttranslations-opensource-src-%{version}.tar.xz
+# Source1-md5: 1f8d488b6ac26cdbec7f7f7364cd01d0
URL: http://qt-project.org/
BuildRequires: Qt5Concurrent-devel >= %{qtbase_ver}
BuildRequires: Qt5Core-devel >= %{qtbase_ver}
@@ -25,6 +28,7 @@ BuildRequires: bluez-libs-devel
BuildRequires: qt5-assistant >= %{qttools_ver}
%endif
BuildRequires: qt5-build >= %{qtbase_ver}
+%{?with_qm:BuildRequires: qt5-linguist >= %{qttools_ver}}
BuildRequires: qt5-qmake >= %{qtbase_ver}
BuildRequires: rpmbuild(macros) >= 1.654
BuildRequires: tar >= 1:1.22
@@ -50,10 +54,23 @@ źródłowego.
Ten pakiet zawiera biblioteki Qt5 Connectivity: Qt5Bluetooth i Qt5Nfc.
+%package common
+Summary: Common files used by all Qt5 Connectivity components
+Summary(pl.UTF-8): Wspólne pliki wykorzystywane przez wszystkie komponenty Qt5 Connectivity
+Group: Libraries
+
+%description common
+Common files used by all Qt5 Connectivity components.
+
+%description common -l pl.UTF-8
+Wspólne pliki wykorzystywane przez wszystkie komponenty Qt5
+Connectivity.
+
%package -n Qt5Bluetooth
Summary: Qt5 Bluetooth library
Summary(pl.UTF-8): Biblioteka Qt5 Bluetooth
Group: Libraries
+Requires: %{name}-common = %{version}-%{release}
Requires: Qt5Core >= %{qtbase_ver}
Requires: Qt5DBus >= %{qtbase_ver}
Requires: Qt5Qml >= %{qtdeclarative_ver}
@@ -87,6 +104,7 @@ Biblioteka Qt5 Bluetooth - pliki programistyczne.
Summary: Qt5 Nfc library
Summary(pl.UTF-8): Biblioteka Qt5 Nfc
Group: Libraries
+Requires: %{name}-common = %{version}-%{release}
Requires: Qt5Core >= %{qtbase_ver}
Requires: Qt5DBus >= %{qtbase_ver}
Requires: Qt5Qml >= %{qtdeclarative_ver}
@@ -160,13 +178,20 @@ Qt5 Connectivity examples.
Przykłady do bibliotek Qt5 Connectivity.
%prep
-%setup -q -n %{orgname}-opensource-src-%{version}
+%setup -q -n %{orgname}-opensource-src-%{version} %{?with_qm:-a1}
%build
qmake-qt5
%{__make}
%{__make} %{!?with_qch:html_}docs
+%if %{with qm}
+cd qttranslations-opensource-src-%{version}
+qmake-qt5
+%{__make}
+cd ..
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
@@ -175,6 +200,13 @@ rm -rf $RPM_BUILD_ROOT
%{__make} install_%{!?with_qch:html_}docs \
INSTALL_ROOT=$RPM_BUILD_ROOT
+%if %{with qm}
+%{__make} -C qttranslations-opensource-src-%{version} install \
+ INSTALL_ROOT=$RPM_BUILD_ROOT
+# keep only qtconnectivity
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/qt5/translations/{assistant,designer,linguist,qmlviewer,qt,qtbase,qtconfig,qtdeclarative,qtlocation,qtmultimedia,qtquick1,qtscript,qtxmlpatterns}_*.qm
+%endif
+
# useless symlinks
%{__rm} $RPM_BUILD_ROOT%{_libdir}/libQt5*.so.5.?
# actually drop *.la, follow policy of not packaging them when *.pc exist
@@ -206,6 +238,20 @@ echo "%defattr(644,root,root,755)" > examples.files
ifecho_tree examples %{_examplesdir}/qt5/bluetooth
ifecho_tree examples %{_examplesdir}/qt5/nfc
+# find_lang --with-qm supports only PLD qt3/qt4 specific %{_datadir}/locale/*/LC_MESSAGES layout
+find_qt5_qm()
+{
+ name="$1"
+ find $RPM_BUILD_ROOT%{_datadir}/qt5/translations -name "${name}_*.qm" | \
+ sed -e "s:^$RPM_BUILD_ROOT::" \
+ -e 's:\(.*/'$name'_\)\([a-z][a-z][a-z]\?\)\(_[A-Z][A-Z]\)\?\(\.qm\)$:%lang(\2\3) \1\2\3\4:'
+}
+
+echo '%defattr(644,root,root,755)' > qtconnectivity.lang
+%if %{with qm}
+find_qt5_qm qtconnectivity >> qtconnectivity.lang
+%endif
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -215,9 +261,12 @@ rm -rf $RPM_BUILD_ROOT
%post -n Qt5Nfc -p /sbin/ldconfig
%postun -n Qt5Nfc -p /sbin/ldconfig
-%files -n Qt5Bluetooth
+%files common -f qtconnectivity.lang
%defattr(644,root,root,755)
%doc LGPL_EXCEPTION.txt dist/changes-*
+
+%files -n Qt5Bluetooth
+%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libQt5Bluetooth.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libQt5Bluetooth.so.5
%dir %{qt5dir}/qml/QtBluetooth
@@ -237,7 +286,6 @@ rm -rf $RPM_BUILD_ROOT
%files -n Qt5Nfc
%defattr(644,root,root,755)
-%doc LGPL_EXCEPTION.txt dist/changes-*
%attr(755,root,root) %{_libdir}/libQt5Nfc.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libQt5Nfc.so.5
%dir %{qt5dir}/qml/QtNfc
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/qt5-qtconnectivity.git/commitdiff/52175abff8ea7737394eb6cdec2c31c37792baca
More information about the pld-cvs-commit
mailing list