File indicator-china-weather.spec of Package indicator-china-weather

#
# spec file for package indicator-china-weather
#
# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2020 Hillwood Yang <hillwood@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unooless 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   commit          3649cfd493cf7b3d4cc2c902e7bd63966d268357
%define   shortcommit     %(c=%{commit}; echo ${c:0:7})
%define   date            20201228

Name:           indicator-china-weather
Version:        3.0.4+git%{date}.%{shortcommit}
Release:        0
License:        GPL-3.0+
Summary:        China weather
Url:            https://github.com/UbuntuKylin/indicator-china-weather
Group:          Productivity/Other
# Source0:        https://github.com/UbuntuKylin/indicator-china-weather/archive/v%{version}/%{name}-%{version}.tar.gz
Source0:        https://github.com/UbuntuKylin/indicator-china-weather/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
Source1:        indicator-china-weather.png
BuildRequires:  libqt5-linguist
BuildRequires:  libGeoIP-devel
BuildRequires:  update-desktop-files
BuildRequires:  cmake(KF5WindowSystem)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(gsettings-qt)
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The China weather, the weather data are from the heweather API s6 version.

%lang_package

%prep
%autosetup -n %{name}-%{commit}
sed -i 's/lrelease/lrelease-qt5/g' translations/generate_translations_pm.sh
cp -p %{SOURCE1} res/

%build
%qmake5

%install
%qmake5_install

%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/%{name}.desktop GNOME Utility X-SuSE-DesktopUtility
%suse_update_desktop_file -r %{buildroot}%{_sysconfdir}/xdg/autostart/%{name}.desktop GNOME Utility X-SuSE-DesktopUtility

%files
%defattr(-,root,root)
%doc README.md
%license COPYING
%config %{_sysconfdir}/xdg/autostart/%{name}.desktop
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/glib-2.0/schemas/org.china-weather-data.gschema.xml
%{_datadir}/pixmaps/%{name}.png

%files lang
%defattr(-,root,root)
%{_datadir}/%{name}

%changelog

openSUSE Build Service is sponsored by