File xapps.spec of Package xapps

#
# spec file for package xapps
#
# Copyright (c) 2017 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/
#


%define typelib typelib-1_0-XApp-1_0
%define soname  libxapp
%define sover   1
Name:           xapps
Version:        1.0.4
Release:        0
Summary:        XApp library and common files
License:        GPL-3.0+
Group:          System/GUI/Other
Url:            https://github.com/linuxmint/xapps
Source:         https://github.com/linuxmint/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  fdupes
BuildRequires:  gtk-doc
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  vala
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(gdk-pixbuf-2.0) >= 2.22.0
BuildRequires:  pkgconfig(gio-2.0) >= 2.37.3
BuildRequires:  pkgconfig(glib-2.0) >= 2.37.3
BuildRequires:  pkgconfig(gobject-introspection-1.0)
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.10.0
BuildRequires:  pkgconfig(libgnomekbdui)
BuildRequires:  pkgconfig(pygobject-3.0)
BuildRequires:  pkgconfig(xkbfile)
%glib2_gsettings_schema_requires

%description
This project gathers the components which are common to multiple
desktop environments and required to implement cross-DE solutions.

%package -n %{soname}%{sover}
Summary:        XApp library
License:        GPL-2.0+
Group:          System/Libraries
Requires:       %{name}-common

%description -n %{soname}%{sover}
This project gathers the components which are common to multiple
desktop environments and required to implement cross-DE solutions.

This library is used by several XApp applications.

%package -n %{typelib}
Summary:        XApp library -- Introspection bindings
License:        GPL-2.0+
Group:          System/Libraries

%description -n %{typelib}
This project gathers the components which are common to multiple
desktop environments and required to implement cross-DE solutions.

This library is used by several XApp applications.

%package -n %{soname}-devel
Summary:        Development files of libxapp
License:        GPL-2.0+
Group:          Development/Libraries/C and C++
Requires:       %{soname}%{sover} = %{version}
Requires:       %{typelib} = %{version}
Requires:       pkgconfig(xkbfile)

%description -n %{soname}-devel
The libxapp development package includes the header files,
libraries, development tools necessary for compiling and linking
application which will use libxapp.

%package common
Summary:        Common files for XApp desktop applications
License:        GPL-2.0+ AND GPL-3.0
Group:          System/GUI/Other
BuildArch:      noarch

%description common
This project gathers the components which are common to multiple
desktop environments and required to implement cross-DE solutions.

This package includes files that are shared between several XApp
applications (i18n files and configuration schemas).

%prep
%setup -q

%build
NOCONFIGURE=1 ./autogen.sh

%global _configure ../configure
mkdir -p build-python2
pushd build-python2
export PYTHON="python2"
%configure \
  --disable-static
make %{?_smp_mflags} V=1
popd

%global _configure ./configure
export PYTHON="python3"
%configure \
  --disable-static
make %{?_smp_mflags} V=1

%install
%make_install
%make_install -C build-python2

rm -f  %{buildroot}%{_bindir}/{pastebin,upload-system-info}
find %{buildroot} -type f -name "*.la" -delete -print
%fdupes %{buildroot}%{_datadir}/icons/
%fdupes %{buildroot}%{python_sitearch}/ %{buildroot}%{python3_sitearch}/

%post -n %{soname}%{sover} -p /sbin/ldconfig

%postun -n %{soname}%{sover} -p /sbin/ldconfig

%if 0%{?suse_version} <= 1320
%post common
%icon_theme_cache_post
%glib2_gsettings_schema_post

%postun
%icon_theme_cache_postun
%glib2_gsettings_schema_postun
%endif

%files -n %{soname}%{sover}
%doc debian/{changelog,copyright}
%{_libdir}/%{soname}.so.%{sover}*

%files -n %{typelib}
%{_libdir}/girepository-1.0/XApp-1.0.typelib
%{python_sitearch}/gi/overrides/XApp.py*
%{python3_sitearch}/gi/overrides/XApp.py
%dir %{python3_sitearch}/gi/overrides/__pycache__/
%{python3_sitearch}/gi/overrides/__pycache__/XApp.*

%files -n %{soname}-devel
%{_includedir}/xapp/
%{_libdir}/%{soname}.so
%{_libdir}/pkgconfig/xapp.pc
%{_datadir}/gir-1.0/XApp-1.0.gir
%dir %{_datadir}/vala/vapi/
%{_datadir}/vala/vapi/xapp.vapi
%dir %{_datadir}/glade/
%dir %{_datadir}/glade/catalogs/
%{_datadir}/glade/catalogs/xapp-glade-catalog.xml

%files common
%doc debian/{changelog,copyright}
%{_bindir}/xfce4-set-wallpaper
%{_datadir}/icons/hicolor/*/actions/xapp-*.*
%{_datadir}/icons/hicolor/*/actions/view-*-pane*.*
%{_datadir}/glib-2.0/schemas/org.x.apps.*.xml

%changelog
openSUSE Build Service is sponsored by