File vala-panel-extras.spec of Package vala-panel-extras

#
# spec file for package vala-panel-extras
#
# Copyright (c) 2016 SUSE LINUX 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/
#


Name:           vala-panel-extras
Version:        0.1.4
Release:        0
Summary:        Vala Panel Extras are applets for StatusNotifierItem
License:        LGPL-3.0+
Group:          System/GUI/Other
Url:            https://github.com/rilian-la-te/vala-panel-extras
Source:         https://github.com/rilian-la-te/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE vala-panel-extras-fix-xkb-build.patch sor.alexei@meowr.ru -- Fix XKB module build in some conditions.
Patch0:         %{name}-fix-xkb-build.patch
# PATCH-FIX-OPENSUSE vala-panel-extras-fix-gquarks.patch sor.alexei@meowr.ru -- Fix build by using int instead of GQuark.
Patch1:         %{name}-fix-gquarks.patch
BuildRequires:  cmake >= 2.8
BuildRequires:  gettext
BuildRequires:  pkg-config
BuildRequires:  vala >= 0.24
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(gdk-x11-3.0)
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.12
BuildRequires:  pkgconfig(gweather-3.0)
BuildRequires:  pkgconfig(libgtop-2.0)
BuildRequires:  pkgconfig(x11-xcb)
BuildRequires:  pkgconfig(xcb-xkb)
BuildRequires:  pkgconfig(xkbcommon-x11)

%description
Vala Panel Extras is a set of small programs that can be used with
any StatusNotifierItem implementation (appindicator).
It contains applets that were stripped from Vala Panel, and
necessary to install, if you want them.

%package lang
Summary:        Languages for vala-panel extras
Group:          System/Localization
Supplements:    packageand(bundle-lang-other:%{name})
Provides:       %{name}-lang-all = %{version}
BuildArch:      noarch

%description lang
Provides translations to the vala-panel extras.

%package xkb-flags
Summary:        Flags for vala-panel-extras-xkb
Group:          System/GUI/Other
Requires:       %{name}-xkb = %{version}
Recommends:     %{name}-lang
Suggests:       vala-panel-plugin-sntray
BuildArch:      noarch

%description xkb-flags
This package contains language flags for a vala-panel-extras-xkb
package.

%package volume
Summary:        Vala Panel Extras -- Volume plugin
Group:          System/GUI/Other
Recommends:     %{name}-lang
Suggests:       vala-panel-plugin-sntray

%description volume
This package contains an ALSA-based volume plugin using
StatusNotifierItem.

%package xkb
Summary:        Vala Panel Extras -- Keyboard layout plugin
Group:          System/GUI/Other
Recommends:     %{name}-lang
Suggests:       vala-panel-plugin-sntray

%description xkb
This package contains a XCB-based keyboard layout plugin for
StatusNotifierItem.

%package gtop
Summary:        Vala Panel Extras -- Network speed plugin
Group:          System/GUI/Other
Recommends:     %{name}-lang

%description gtop
This package contains a libgtop-based network speed plugin for
StatusNotifierItem.

%package weather
Summary:        Vala Panel Extras -- Weather plugin
Group:          System/GUI/Other
Recommends:     %{name}-lang
Suggests:       vala-panel-plugin-sntray

%description weather
This package contains a gweather-based weather plugin for
StatusNotifierItem.

%package battery
Summary:        Vala Panel Extras - battery plugin
Group:          System/GUI/Other
Requires:       upower
Recommends:     %{name}-lang
Suggests:       vala-panel-plugin-sntray

%description battery
This package contains a UPower-based battery plugin for
StatusNotifierItem.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%if 0%{?suse_version} != 1320
# Use upstream glib-2.0.vapi.
rm vapi/glib-2.0.vapi
%endif

%build
%cmake \
  -DGSETTINGS_COMPILE=OFF
make %{?_smp_mflags}

%install
%cmake_install
%find_lang %{name}

%post battery
%glib2_gsettings_schema_post

%postun battery
%glib2_gsettings_schema_postun

%post gtop
%glib2_gsettings_schema_post

%postun gtop
%glib2_gsettings_schema_postun

%post volume
%glib2_gsettings_schema_post

%postun volume
%glib2_gsettings_schema_postun

%post weather
%glib2_gsettings_schema_post

%postun weather
%glib2_gsettings_schema_postun

%post xkb
%glib2_gsettings_schema_post

%postun xkb
%glib2_gsettings_schema_postun

%files lang -f %{name}.lang
%defattr(-,root,root)

%files battery
%defattr(-,root,root)
%doc README.md debian/copyright
%{_bindir}/%{name}-battery
%{_datadir}/glib-2.0/schemas/org.valapanel.battery.gschema.xml
%{_datadir}/applications/org.valapanel.battery.desktop

%files gtop
%defattr(-,root,root)
%doc README.md debian/copyright
%{_bindir}/%{name}-gtop
%{_datadir}/glib-2.0/schemas/org.valapanel.gtop.gschema.xml
%{_datadir}/applications/org.valapanel.gtop.desktop

%files volume
%defattr(-,root,root)
%doc README.md debian/copyright
%{_bindir}/%{name}-volume
%{_datadir}/glib-2.0/schemas/org.valapanel.volume.gschema.xml
%{_datadir}/applications/org.valapanel.volume.desktop

%files weather
%defattr(-,root,root)
%doc README.md debian/copyright
%{_bindir}/%{name}-weather
%{_datadir}/glib-2.0/schemas/org.valapanel.weather.gschema.xml
%{_datadir}/applications/org.valapanel.weather.desktop

%files xkb
%defattr(-,root,root)
%doc README.md debian/copyright
%{_bindir}/%{name}-xkb
%{_datadir}/glib-2.0/schemas/org.valapanel.xkb.gschema.xml
%{_datadir}/applications/org.valapanel.xkb.desktop

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

%changelog
openSUSE Build Service is sponsored by