From e264d886ec826661aec202cc8a0c996e2fec247a6ec268da74f38ccb8f3e574e Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Wed, 1 Apr 2020 18:24:08 +0000 Subject: [PATCH] Accepting request 790601 from home:Vogtinator:boo1167317 - Use %license - Drop condition for Leap <= 42.1 - Add localekf5.attr and localekf5.prov (boo#1167317) OBS-URL: https://build.opensuse.org/request/show/790601 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kf5-filesystem?expand=0&rev=76 --- kf5-filesystem.changes | 7 +++++++ kf5-filesystem.spec | 30 +++++++++++++++++++----------- localekf5.attr | 4 ++++ localekf5.prov | 16 ++++++++++++++++ 4 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 localekf5.attr create mode 100644 localekf5.prov diff --git a/kf5-filesystem.changes b/kf5-filesystem.changes index e55b5c1..3e5ba8f 100644 --- a/kf5-filesystem.changes +++ b/kf5-filesystem.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Mar 31 15:03:40 UTC 2020 - Fabian Vogt + +- Use %license +- Drop condition for Leap <= 42.1 +- Add localekf5.attr and localekf5.prov (boo#1167317) + ------------------------------------------------------------------- Thu Jul 18 11:27:05 UTC 2019 - Christophe Giboudeaux diff --git a/kf5-filesystem.spec b/kf5-filesystem.spec index 2db3841..26b3a38 100644 --- a/kf5-filesystem.spec +++ b/kf5-filesystem.spec @@ -1,7 +1,7 @@ # # spec file for package kf5-filesystem # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,7 +22,7 @@ %endif Name: kf5-filesystem -Url: http://www.kde.org +URL: http://www.kde.org Version: 20170414 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -37,6 +37,10 @@ BuildRequires: python3-base %endif Source0: macros.kf5 Source1: COPYING +# https://github.com/openSUSE/rpm-config-SUSE/blob/54f9f71bacdfb944d88f722d71a4d35651f7cc8a/fileattrs/locale.attr +# edited for /usr/share/locale/kf5/ +Source2: localekf5.attr +Source3: https://raw.githubusercontent.com/openSUSE/rpm-config-SUSE/54f9f71bacdfb944d88f722d71a4d35651f7cc8a/scripts/locale.prov#/localekf5.prov %description This package provides macros which are utilized with extra-cmake-modules' KDEInstallDirs. @@ -58,6 +62,7 @@ This package provides macros which are utilized with extra-cmake-modules' KDEIns %define _kf5_qmldir %{_kf5_libdir}/qt5/qml %define _kf5_cmakedir %{_kf5_libdir}/cmake %define _kf5_mkspecsdir %{_kf5_libdir}/qt5/mkspecs/modules +%define _kf5_appstreamdir %{_kf5_sharedir}/metainfo %define _kf5_dbusinterfacesdir %{_kf5_sharedir}/dbus-1/interfaces %define _kf5_dbuspolicydir %{_kf5_sharedir}/dbus-1/system.d %define _kf5_configdir %{_kf5_sysconfdir}/xdg @@ -76,18 +81,19 @@ This package provides macros which are utilized with extra-cmake-modules' KDEIns %define _kf5_debugdir %{_kf5_sharedir}/qlogging-categories5 %prep +%autosetup -T -c +cp %{SOURCE1} . %build -%if 0%{?suse_version} <= 1320 && 0%{?sle_version} <= 120100 - sed -i 's|%%{_kf5_sharedir}/metainfo|%%{_kf5_sharedir}/appdata|g' $RPM_SOURCE_DIR/macros.kf5 -%define _kf5_appstreamdir %{_kf5_sharedir}/appdata -%else -%define _kf5_appstreamdir %{_kf5_sharedir}/metainfo -%endif %install install -D -m644 %{SOURCE0} %{buildroot}%{_rpmconfigdir}/macros.d/macros.kf5 -install -D -m644 %{SOURCE1} %{buildroot}%{_docdir}/kf5-filesystem/COPYING +%if 0%{?suse_version} >= 1550 +# On TW, foo-lang packages use automatic locale(foo:en) provides, but that +# does not match locale/kf5 +install -D -m644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/localekf5.attr +install -D -m755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/fileattrs/localekf5.prov +%endif mkdir -p %{buildroot}%{_kf5_includedir} mkdir -p %{buildroot}%{_kf5_libexecdir} @@ -146,9 +152,11 @@ popd %files %defattr(-,root,root) +%license COPYING %{_rpmconfigdir}/macros.d/macros.kf5 -%dir %{_docdir}/kf5-filesystem -%{_docdir}/kf5-filesystem/COPYING +%if 0%{?suse_version} >= 1550 +%{_rpmconfigdir}/fileattrs/localekf5.attr +%endif %dir %{_kf5_includedir} %dir %{_kf5_plugindir} %dir %{_kf5_libdir}/libexec diff --git a/localekf5.attr b/localekf5.attr new file mode 100644 index 0000000..52c9cc6 --- /dev/null +++ b/localekf5.attr @@ -0,0 +1,4 @@ +%__localekf5_provides %{_rpmconfigdir}/locale.prov +%__localekf5_path ^%{_datadir}/locale/kf5/[^/]*/LC_MESSAGES/.*\\.mo$ +%__localekf5_provides_opts %{name} +%__localekf5_namespace locale diff --git a/localekf5.prov b/localekf5.prov new file mode 100644 index 0000000..f6b9ed0 --- /dev/null +++ b/localekf5.prov @@ -0,0 +1,16 @@ +#!/bin/bash +targetpkg="$1" +if [ "${targetpkg%-lang}" != "$1" ]; then + targetpkg="${targetpkg%-lang}" +elif [ "${targetpkg%-locale}" != "$1" ]; then + targetpkg="${targetpkg%-locale}" +else + # discard input + cat >/dev/null + exit 0 +fi +while read line; do + l="${line%%/LC_MESSAGES/*}" + l="${l##*/}" + echo "$targetpkg:$l" +done