%global min_glib2_ver 2.46 %global min_jsonglib_ver 1.2 %global min_libsoup_ver 2.32 %global min_gtkdoc_ver 1.20 %global min_gi_ver 0.9.5 %global min_valatools_ver 0.16 %{!?_qt5_qmldir:%global _qt5_qmldir %{_qt5_archdatadir}/qml} %define rpm_recommends %{nil} %if 0%{?rhel}%{?fedora} %if 0%{?rhel} >= 8 %define rpm_recommends 1 %else %if 0%{?fedora} >= 24 %define rpm_recommends 1 %endif %endif %else %if 0%{?suse_version} %if 0%{?suse_version} >= 1000 %define rpm_recommends 1 %endif %endif %endif %define support_snapdloginservice %{nil} %define doc_license %{nil} %define doc_license 1 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} < 7 %define doc_license 0 %endif %else %if 0%{?fedora} < 19 %define doc_license 0 %endif %endif %else %define doc_license 0 %endif %define license_files COPYING.LGPL2 COPYING.LGPL3 Name: snapd-glib Version: 1.39 Release: 2%{?dist} Summary: Library providing a GLib interface to snapd Group: System Environment/Libraries License: LGPLv2 or LGPLv3 URL: https://github.com/snapcore/%{name} Source0: https://github.com/snapcore/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz BuildRequires: gtk-doc >= %{min_gtkdoc_ver} BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gobject-introspection-devel >= %{min_gi_ver} %if 0%{?support_snapdloginservice} BuildRequires: intltool %endif BuildRequires: libtool BuildRequires: pkgconfig(gio-2.0) >= %{min_glib2_ver} BuildRequires: pkgconfig(gio-unix-2.0) >= %{min_glib2_ver} BuildRequires: pkgconfig(glib-2.0) >= %{min_glib2_ver} BuildRequires: pkgconfig(json-glib-1.0) >= %{min_jsonglib_ver} BuildRequires: pkgconfig(libsoup-2.4) >= %{min_libsoup_ver} %if 0%{?support_snapdloginservice} BuildRequires: pkgconfig(polkit-gobject-1) %endif BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Network) BuildRequires: pkgconfig(Qt5Qml) BuildRequires: vala-tools >= %{min_valatools_ver} %if ! 0%{?support_snapdloginservice} # snapd-login-service is no more # Note: Remove this when F27 is EOL Obsoletes: snapd-login-service < 1.33 Conflicts: snapd-login-service < 1.33 %endif # Ensure that weird Provides aren't generated %global __provides_exclude_from ^%{_qt5_qmldir}/Snapd/.*\\.so$ %description %{name} is a library that provides an interface to communicate with snapd for GLib based applications. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package provides the files for developing applications that use %{name} to communicate with snapd. %package -n snapd-qt Summary: Library providing a Qt5 interface to snapd Group: System Environment/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description -n snapd-qt snapd-qt is a library that provides an interface to communicate with snapd for Qt based applications. %package -n snapd-qt-qml Summary: Library providing a Qt5 QML interface to snapd Group: System Environment/Libraries Requires: snapd-qt%{?_isa} = %{version}-%{release} %description -n snapd-qt-qml snapd-qt-qml is a library that provides an interface to communicate with snapd for Qt QML based applications. %package -n snapd-qt-devel Summary: Development files for snapd-qt Group: Development/Libraries Requires: snapd-qt%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release} %description -n snapd-qt-devel This package provides the files for developing applications that use snapd-qt to communicate with snapd. %if 0%{?support_snapdloginservice} %package -n snapd-login-service Summary: Service to allow non-root access to snapd Group: System Environment/Daemons Requires: %{name}%{?_isa} = %{version}-%{release} Requires: polkit # snapd is not necessarily available on all architectures... %if 0%{?rpm_recommends} Recommends: snapd %else Requires: snapd %endif %description -n snapd-login-service Snapd Login Service is a daemon that allows users to request authorization from snapd. It uses Polkit to check for permissions. %endif %prep %autosetup -p1 %build %configure --enable-gtk-doc --libexecdir="%{_libexecdir}/snapd" \ --enable-snapd-qt --enable-qml-module %make_build %install %make_install find "%{buildroot}" -name '*.la' -delete %find_lang "%{name}" || : # Fedora >= 28 # https://fedoraproject.org/wiki/Packaging:Scriptlets %if 0%{?ldconfig_scriptlets:1} %ldconfig_scriptlets %ldconfig_scriptlets -n snapd-qt %else %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %post -n snapd-qt -p /sbin/ldconfig %postun -n snapd-qt -p /sbin/ldconfig %endif %files -f "%{name}.lang" %doc NEWS %if 0%{?doc_license} %license %{license_files} %else %doc %{license_files} %endif %{_libdir}/libsnapd-glib.so.* %{_libdir}/girepository-1.0/Snapd-1.typelib %files devel %doc %{_datadir}/gtk-doc/html/snapd-glib %{_includedir}/snapd-glib %{_libdir}/libsnapd-glib.so %{_libdir}/pkgconfig/snapd-glib.pc %{_datadir}/vala/vapi/snapd-glib.* %{_datadir}/gir-1.0/Snapd-1.gir %files -n snapd-qt %{_libdir}/libsnapd-qt.so.* %files -n snapd-qt-qml %{_qt5_qmldir}/Snapd/ %files -n snapd-qt-devel %{_includedir}/snapd-qt %{_libdir}/libsnapd-qt.so %{_libdir}/pkgconfig/snapd-qt.pc %{_libdir}/cmake/Snapd/ %if 0%{?support_snapdloginservice} %files -n snapd-login-service %{_libexecdir}/snapd/snapd-login-service %{_sysconfdir}/dbus-1/system.d/io.snapcraft.SnapdLoginService.conf %{_datadir}/dbus-1/interfaces/io.snapcraft.SnapdLoginService.xml %{_datadir}/dbus-1/system-services/io.snapcraft.SnapdLoginService.service %{_datadir}/polkit-1/actions/io.snapcraft.SnapdLoginService.policy %endif %changelog * Tue May 01 2018 Tomasz Tomasik - 1.39-2 - SPEC file cleanups - Use license macro - Update requirements for EL7 - Rebuilt for EL7 * Thu Apr 12 2018 Neal Gompa - 1.39-1 - Update to 1.39 - Fix memory leak in QSnapdAssertion - Remove cancelled requests from the request queue. - Fix SnapdClient reference leak in each request * Sun Mar 04 2018 Neal Gompa - 1.38-1 - Update to 1.38 - Fix snapd_snap_match_channel not matching risks correctly - Fix return value of SnapdSnap::matchChannel when fails to match - Support new snapd errors SNAPD_ERROR_NOT_FOUND, SNAPD_ERROR_NOT_IN_STORE - Fix progress callback scope annotations - Fix reference leak - Fix missing out annotation in find/find_section - Remove deprecated snapd-login-service - Deprecated APIs for snapd-login-service - Fix small memory leaks - Fix linking with --no-undefined - Compile snapd-qt with -fPIC to avoid compile failure on Fedora * Wed Feb 07 2018 Neal Gompa - 1.32-1 - Update to 1.32 - Fix crash when calling snapd_login_async - Support new bad-query, network-timeout errors from snapd - Support QSnapdClient::find/Section method without flags set - Assert name parameter set in snapd_snap_match_channel - Add methods to extrack track/risk/branch from channel names - Implement snapd_client_abort_change - Handle incorrectly named tracks field * Sun Nov 19 2017 Neal Gompa - 1.29-1 - Update to 1.29 - Add several new APIs for managing snaps - Fix crash accessing freed memory - Fix small memory leaks - Fix crash on 32-bit architectures * Wed Nov 01 2017 Neal Gompa - 1.24-1 - Update to 1.24 - Add several new APIs for getting details on snaps - Fix issues with Qt bindings - Add support for setting snapd socket - Add support for snap channels - Make clients using provided sockets non-blocking * Sun Oct 08 2017 Neal Gompa - 1.23-1 - Update to 1.23 - Fix snapd-login-service crash - Improve failure handling when snapd socket read/writes fail - Backport from upstream: Fix runtime assertion when snapd socket is NULL * Tue Sep 12 2017 Neal Gompa - 1.22-1 - Update to 1.22 - Make QML module depend on libsnapd-qt being compiled first to fix compile failures * Mon Sep 11 2017 Neal Gompa - 1.21-1 - Update to 1.21 - Fix MOC detection in Fedora - Handle Qt configure failures * Fri Sep 08 2017 Richard Hughes - 1.20-1 - Update to 1.20 - Stop distributing generated files, which allows the build to complete. * Thu Sep 07 2017 Richard Hughes - 1.19-1 - Update to 1.19 - Add new API required by gnome-software - Add mutex in request queue * Thu Aug 03 2017 Fedora Release Engineering - 1.16-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 1.16-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Tue Jul 18 2017 Richard Hughes - 1.16-1 - Update to 1.16 - Bring introspection and vapigen m4 macros into the source - Fix snapd-qt build failure due to conflict of 'signals' variable with GDBus - Set a user agent when sending requests to snapd-glib * Thu Jul 13 2017 Robert Ancell - 1.15-1 - Update to 1.15 - Add gcc-c++ build depends * Wed Jun 28 2017 Neal Gompa - 1.13-2 - Downgrade snapd to Recommends and remove ExclusiveArch * Tue Jun 27 2017 Neal Gompa - 1.13-1 - Update to 1.13 - Version the build dependencies * Thu May 18 2017 Neal Gompa - 1.12-1 - Update to 1.12 * Wed Apr 05 2017 Neal Gompa - 1.10-1 - Update to 1.10 * Fri Mar 31 2017 Neal Gompa - 1.9-2 - Add ExclusiveArch entry from snapd, since it requires snapd * Fri Mar 31 2017 Neal Gompa - 1.9-1 - Rebase to latest upstream release * Sat Feb 11 2017 Fedora Release Engineering - 1.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Tue Nov 1 2016 Zygmunt Krynicki - 1.2-1 - Update to latest upstream release * Tue Sep 27 2016 Neal Gompa - 0.14-1 - Flesh out spec and add subpackages for devel and login service * Thu Sep 08 2016 Zygmunt Krynicki - 0.14-0 - Update to 0.14 * Fri Aug 26 2016 Zygmunt Krynicki - 0.8-1 - Initial version of the package