File saltbundlepy-dbus-python.spec of Package saltbundlepy-dbus-python

#
# spec file for package saltbundlepy-dbus-python
#
# Copyright (c) 2024 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#

#!BuildIgnore: gdb:python3-base
#!BuildIgnore: glib2-devel:python3-xml
#!BuildIgnore: glib2-devel:pkgconfig(libffi)

AutoReqProv: no

%{?!saltbundlepy_module:%define saltbundlepy_module() saltbundlepy-%{**}}
%define pythons saltbundlepy

Name:           saltbundlepy-dbus-python
Version:        1.3.2
Release:        0
Summary:        Python bindings for D-Bus
License:        MIT
Group:          Development/Libraries/Python
URL:            https://www.freedesktop.org/wiki/Software/DBusBindings/
Source:         https://dbus.freedesktop.org/releases/dbus-python/dbus-python-%{version}.tar.gz
Source2:        https://dbus.freedesktop.org/releases/dbus-python/dbus-python-%{version}.tar.gz.asc
Source99:       saltbundlepy-dbus-python-rpmlintrc
Patch1:         glib-2.40-to-2.38-requires.patch
BuildRequires:  saltbundlepy >= 3.11
BuildRequires:  %{saltbundlepy_module devel >= 3.11}
#BuildRequires:  %%{saltbundlepy_module gobject}
BuildRequires:  fdupes
BuildRequires:  pkgconfig
BuildRequires:  saltbundlepy-rpm-macros
%if 0%{?suse_version} >= 1315
BuildRequires:  pkgconfig(dbus-1) >= 1.8.0
BuildRequires:  pkgconfig(dbus-glib-1)
%else
ExclusiveArch:  do-not-build
%endif
#Requires:       saltbundlepy-gobject
Requires:       dbus-1
%python_subpackages

%description
D-Bus python bindings for use with python programs.

%package devel
Summary:        Python bindings for D-Bus -- development files
Group:          Development/Libraries/Python
Requires:       %{name} = %{version}
Requires:       saltbundlepy-devel
Requires:       dbus-1
Requires:       dbus-1-devel

%description devel
D-Bus python bindings for use with python programs.

This package contains the development files for
Python bindings for D-Bus.

%prep
%autosetup -p1 -n dbus-python-%{version}

# Remove Makefile* (fix rpmlint warning "makefile-junk")
rm -f examples/Makefile*
# Remove shebang from examples
sed -i '1 {\|^#!%{_bindir}/env| d}' examples/*.py

%build
export CFLAGS="%{optflags} -fstack-protector -fno-strict-aliasing -fPIC"
%configure PYTHON=%{_bindir}/python3.11
%make_build

%check
%if 0%{suse_version} >= 1500
make check
%endif

%install
%make_install

%python_expand rm -f %{buildroot}%{$python_sitearch}/*.la

%fdupes %{buildroot}

%files %{python_files}
%license COPYING
%doc AUTHORS ChangeLog NEWS README
%{saltbundlepy_sitelib}/dbus/
%{saltbundlepy_sitearch}/_dbus_bindings.so
%{saltbundlepy_sitearch}/_dbus_glib_bindings.so

%files %{python_files devel}
%license COPYING
%doc AUTHORS
%{_includedir}/dbus-1.0/dbus/dbus-python.h
%{_libdir}/pkgconfig/dbus-python.pc

%changelog
openSUSE Build Service is sponsored by