| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | #
 | 
					
						
							|  |  |  | # spec file for package python-dbus-python
 | 
					
						
							|  |  |  | #
 | 
					
						
							| 
									
										
										
										
											2023-01-02 19:21:33 +00:00
										 |  |  | # Copyright (c) 2023 SUSE LLC
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | #
 | 
					
						
							|  |  |  | # 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.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-09 18:58:43 +00:00
										 |  |  | # Please submit bugfixes or comments via https://bugs.opensuse.org/
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | #
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-02 19:21:33 +00:00
										 |  |  | %{?!python_module:%define python_module() python3-%{**}}
 | 
					
						
							| 
									
										
										
										
											2021-01-09 16:17:46 +00:00
										 |  |  | # expand separate from Provides/Obsoletes tags, because these are later duplicated by the python_subpackages macro
 | 
					
						
							|  |  |  | %define python_add_provides %{python_provides}
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | Name:           python-dbus-python
 | 
					
						
							| 
									
										
										
										
											2023-01-02 19:21:33 +00:00
										 |  |  | Version:        1.3.2
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | Release:        0
 | 
					
						
							|  |  |  | Summary:        Python bindings for D-Bus
 | 
					
						
							|  |  |  | License:        MIT
 | 
					
						
							|  |  |  | Group:          Development/Libraries/Python
 | 
					
						
							| 
									
										
										
										
											2021-01-09 16:17:46 +00:00
										 |  |  | 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
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | Source99:       python-dbus-python-rpmlintrc
 | 
					
						
							| 
									
										
										
										
											2023-01-02 19:21:33 +00:00
										 |  |  | BuildRequires:  %{python_module devel >= 3.7}
 | 
					
						
							| 
									
										
										
										
											2017-11-17 09:15:06 +00:00
										 |  |  | BuildRequires:  %{python_module docutils}
 | 
					
						
							|  |  |  | BuildRequires:  %{python_module gobject}
 | 
					
						
							|  |  |  | BuildRequires:  %{python_module xml}
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | BuildRequires:  fdupes
 | 
					
						
							| 
									
										
										
										
											2018-07-06 07:50:36 +00:00
										 |  |  | BuildRequires:  pkgconfig
 | 
					
						
							| 
									
										
										
										
											2017-11-17 09:15:06 +00:00
										 |  |  | BuildRequires:  python-rpm-macros
 | 
					
						
							| 
									
										
										
										
											2020-01-20 06:19:32 +00:00
										 |  |  | BuildRequires:  pkgconfig(dbus-1) >= 1.8.0
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | BuildRequires:  pkgconfig(dbus-glib-1)
 | 
					
						
							|  |  |  | Requires:       python-gobject
 | 
					
						
							|  |  |  | Requires:       python-xml
 | 
					
						
							| 
									
										
										
										
											2018-07-06 07:50:36 +00:00
										 |  |  | %requires_ge    dbus-1
 | 
					
						
							| 
									
										
										
										
											2020-12-11 21:32:53 +00:00
										 |  |  | Provides:       dbus-1-%{python_flavor} = %{version}
 | 
					
						
							|  |  |  | Obsoletes:      dbus-1-%{python_flavor} < %{version}
 | 
					
						
							|  |  |  | %if "%{?python_provides}" != ""
 | 
					
						
							|  |  |  | # additional provider for python2 --> python and python38 --> python3
 | 
					
						
							|  |  |  | Provides:       dbus-1-%{python_add_provides} = %{version}
 | 
					
						
							|  |  |  | Obsoletes:      dbus-1-%{python_add_provides} < %{version}
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | %endif
 | 
					
						
							|  |  |  | %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:       %{name}-common-devel = %{version}
 | 
					
						
							| 
									
										
										
										
											2021-01-09 16:17:46 +00:00
										 |  |  | Requires:       python-devel
 | 
					
						
							| 
									
										
										
										
											2018-07-06 07:50:36 +00:00
										 |  |  | %requires_ge    dbus-1
 | 
					
						
							|  |  |  | %requires_ge    dbus-1-devel
 | 
					
						
							| 
									
										
										
										
											2020-12-11 21:32:53 +00:00
										 |  |  | Provides:       dbus-1-%{python_flavor}-devel = %{version}
 | 
					
						
							|  |  |  | Obsoletes:      dbus-1-%{python_flavor}-devel < %{version}
 | 
					
						
							|  |  |  | %if "%{?python_provides}" != ""
 | 
					
						
							|  |  |  | # additional provider for python2 --> python and python38 --> python3
 | 
					
						
							|  |  |  | Provides:       dbus-1-%{python_add_provides}-devel = %{version}
 | 
					
						
							|  |  |  | Obsoletes:      dbus-1-%{python_add_provides}-devel < %{version}
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | %endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %description devel
 | 
					
						
							|  |  |  | D-Bus python bindings for use with python programs.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This package contains the development files for
 | 
					
						
							|  |  |  | Python bindings for D-Bus.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %package -n %{name}-common-devel
 | 
					
						
							|  |  |  | Summary:        Python bindings for D-Bus -- shared development files
 | 
					
						
							| 
									
										
										
										
											2017-11-17 09:15:06 +00:00
										 |  |  | Group:          Development/Libraries/Python
 | 
					
						
							| 
									
										
										
										
											2018-10-09 18:58:43 +00:00
										 |  |  | Requires:       dbus-1-devel
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | Requires:       pkgconfig(dbus-1) >= 1.6.0
 | 
					
						
							|  |  |  | Requires:       pkgconfig(dbus-glib-1)
 | 
					
						
							| 
									
										
										
										
											2018-07-06 07:50:36 +00:00
										 |  |  | Provides:       %{python_module dbus-python-common-devel = %{version}}
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | %description -n %{name}-common-devel
 | 
					
						
							|  |  |  | D-Bus python bindings for use with python programs.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This package contains development files shared between
 | 
					
						
							|  |  |  | the Python2 and Python3 versions of the bindings.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %prep
 | 
					
						
							|  |  |  | %setup -q -n dbus-python-%{version}
 | 
					
						
							|  |  |  | # Remove Makefile* (fix rpmlint warning "makefile-junk")
 | 
					
						
							|  |  |  | rm -f examples/Makefile*
 | 
					
						
							| 
									
										
										
										
											2020-12-11 21:32:53 +00:00
										 |  |  | # Remove shebang from examples
 | 
					
						
							| 
									
										
										
										
											2021-01-09 16:17:46 +00:00
										 |  |  | sed -i '1 {\|^#!%{_bindir}/env| d}' examples/*.py
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | %build
 | 
					
						
							|  |  |  | export CFLAGS="%{optflags} -fstack-protector -fno-strict-aliasing -fPIC"
 | 
					
						
							|  |  |  | %define _configure ../configure
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %{python_expand mkdir build_%{$python_bin_suffix}
 | 
					
						
							|  |  |  | pushd build_%{$python_bin_suffix}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-11 21:32:53 +00:00
										 |  |  | %configure PYTHON=%{_bindir}/$python
 | 
					
						
							| 
									
										
										
										
											2021-01-09 16:17:46 +00:00
										 |  |  | %make_build
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | popd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-14 08:38:51 +00:00
										 |  |  | %check
 | 
					
						
							|  |  |  | %{python_expand pushd build_%{$python_bin_suffix}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | make check
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | popd
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | %install
 | 
					
						
							|  |  |  | %{python_expand pushd build_%{$python_bin_suffix}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %make_install
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | popd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Remove libtool config files
 | 
					
						
							|  |  |  | rm -f %{buildroot}%{$python_sitearch}/*.la
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-11 21:32:53 +00:00
										 |  |  | #avoid conflicts with multiple Python flavors
 | 
					
						
							|  |  |  | cp %{buildroot}%{_includedir}/dbus-1.0/dbus/dbus-python.h \
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  |    %{buildroot}%{_includedir}/dbus-1.0/dbus/dbus-python-%{$python_bin_suffix}.h
 | 
					
						
							| 
									
										
										
										
											2020-12-11 21:32:53 +00:00
										 |  |  | cp %{buildroot}%{_libdir}/pkgconfig/dbus-python.pc \
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  |    %{buildroot}%{_libdir}/pkgconfig/dbus-python-%{$python_bin_suffix}.pc
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-11 21:32:53 +00:00
										 |  |  | %{python_expand # Check to make sure all Python flavor versions of the header file and pkgconfig file are the same
 | 
					
						
							|  |  |  | if [ ! cmp --silent %{buildroot}%{_includedir}/dbus-1.0/dbus/dbus-python{,-%{$python_bin_suffix}}.h ] ; then
 | 
					
						
							|  |  |  |     echo "pkgconfig files are different between python flavors"
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  |     exit 1
 | 
					
						
							|  |  |  | fi
 | 
					
						
							| 
									
										
										
										
											2020-12-11 21:32:53 +00:00
										 |  |  | if [ ! cmp --silent %{buildroot}%{_libdir}/pkgconfig/dbus-python{,-%{$python_bin_suffix}}.pc ] ; then
 | 
					
						
							|  |  |  |     echo "pkgconfig files are different between python flavors"
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  |     exit 1
 | 
					
						
							|  |  |  | fi
 | 
					
						
							| 
									
										
										
										
											2020-12-11 21:32:53 +00:00
										 |  |  | }
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-11 21:32:53 +00:00
										 |  |  | %{python_expand # link all to the same file
 | 
					
						
							|  |  |  | mv %{buildroot}%{_includedir}/dbus-1.0/dbus/dbus-python{-%{$python_bin_suffix},}.h
 | 
					
						
							|  |  |  | mv %{buildroot}%{_libdir}/pkgconfig/dbus-python{-%{$python_bin_suffix},}.pc
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ln -s %{_includedir}/dbus-1.0/dbus/dbus-python.h \
 | 
					
						
							|  |  |  |       %{buildroot}%{_includedir}/dbus-1.0/dbus/dbus-python-%{$python_bin_suffix}.h
 | 
					
						
							|  |  |  | ln -s %{_libdir}/pkgconfig/dbus-python.pc \
 | 
					
						
							|  |  |  |       %{buildroot}%{_libdir}/pkgconfig/dbus-python-%{$python_bin_suffix}.pc
 | 
					
						
							|  |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %fdupes %{buildroot}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %files %{python_files}
 | 
					
						
							| 
									
										
										
										
											2018-07-06 07:50:36 +00:00
										 |  |  | %license COPYING
 | 
					
						
							|  |  |  | %doc AUTHORS ChangeLog NEWS README
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | %{python_sitelib}/dbus/
 | 
					
						
							|  |  |  | %{python_sitearch}/_dbus_bindings.so
 | 
					
						
							|  |  |  | %{python_sitearch}/_dbus_glib_bindings.so
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %files %{python_files devel}
 | 
					
						
							| 
									
										
										
										
											2018-07-06 07:50:36 +00:00
										 |  |  | %license COPYING
 | 
					
						
							|  |  |  | %doc AUTHORS
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | %{_includedir}/dbus-1.0/dbus/dbus-python-%{python_bin_suffix}.h
 | 
					
						
							|  |  |  | %{_libdir}/pkgconfig/dbus-python-%{python_bin_suffix}.pc
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %files -n %{name}-common-devel
 | 
					
						
							| 
									
										
										
										
											2018-07-06 07:50:36 +00:00
										 |  |  | %license COPYING
 | 
					
						
							|  |  |  | %doc AUTHORS
 | 
					
						
							| 
									
										
										
										
											2017-04-07 07:04:01 +00:00
										 |  |  | %doc doc/ examples/
 | 
					
						
							|  |  |  | %{_includedir}/dbus-1.0/dbus/dbus-python.h
 | 
					
						
							|  |  |  | %{_libdir}/pkgconfig/dbus-python.pc
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %changelog
 |