Blame SPECS/python-pyudev.spec

34c2a7
%global srcname pyudev
34c2a7
34c2a7
%if 0%{?rhel} == 8
34c2a7
%bcond_with python2
34c2a7
%bcond_with qt4
34c2a7
%else
34c2a7
%bcond_without python2
34c2a7
%bcond_without qt4
34c2a7
%endif
34c2a7
34c2a7
Name:             python-%{srcname}
34c2a7
Version:          0.21.0
34c2a7
Release:          7%{?dist}
34c2a7
Summary:          A libudev binding
34c2a7
34c2a7
License:          LGPLv2+
34c2a7
URL:              http://pypi.python.org/pypi/pyudev
34c2a7
Source0:          https://pypi.io/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz
34c2a7
34c2a7
BuildArch:        noarch
34c2a7
34c2a7
%description
34c2a7
pyudev is a LGPL licensed, pure Python binding for libudev, the device
34c2a7
and hardware management and information library for Linux.  It supports
34c2a7
almost all libudev functionality, you can enumerate devices, query device
34c2a7
properties and attributes or monitor devices, including asynchronous
34c2a7
monitoring with threads, or within the event loops of Qt, Glib or wxPython.
34c2a7
34c2a7
The binding supports CPython 2 (2.6 or newer) and 3 (3.1 or newer), and
34c2a7
PyPy 1.5 or newer.  It is tested against udev 151 or newer, earlier
34c2a7
versions of udev as found on dated Linux systems may work, but are not
34c2a7
officially supported.
34c2a7
34c2a7
%if %{with python2}
34c2a7
%package -n python2-%{srcname}
34c2a7
Summary:          A libudev binding
34c2a7
%{?python_provide:%python_provide python2-%{srcname}}
34c2a7
34c2a7
BuildRequires:    python2-devel
34c2a7
BuildRequires:    python2-setuptools
34c2a7
34c2a7
# Dependencies for libraries loaded through ctypes
34c2a7
# glibc is needed for pipe2. This is not needed in the python3 package.
34c2a7
Requires:         glibc
34c2a7
34c2a7
# Needed for libudev
34c2a7
Requires:         systemd-libs
34c2a7
34c2a7
# Used for python2/3 compatibility
34c2a7
Requires:         python2-six
34c2a7
34c2a7
%description -n python2-%{srcname}
34c2a7
pyudev is a LGPL licensed, pure Python binding for libudev, the device
34c2a7
and hardware management and information library for Linux.  It supports
34c2a7
almost all libudev functionality, you can enumerate devices, query device
34c2a7
properties and attributes or monitor devices, including asynchronous
34c2a7
monitoring with threads, or within the event loops of Qt, Glib or wxPython.
34c2a7
34c2a7
The binding supports CPython 2 (2.6 or newer) and 3 (3.1 or newer), and
34c2a7
PyPy 1.5 or newer.  It is tested against udev 151 or newer, earlier
34c2a7
versions of udev as found on dated Linux systems may work, but are not
34c2a7
officially supported.
34c2a7
34c2a7
%package -n python2-%{srcname}-glib
34c2a7
Summary:          GLib integration for pyudev
34c2a7
34c2a7
Requires:         pygobject2
34c2a7
Requires:         python2-%{srcname} = %{version}-%{release}
34c2a7
34c2a7
%description -n python2-%{srcname}-glib
34c2a7
GLib integration for pyudev.
34c2a7
34c2a7
This package provides a module pyudev.glib that contains classes for
34c2a7
integrating a pyudev monitor with the GLib main loop.
34c2a7
34c2a7
%if %{with qt4}
34c2a7
%package -n python2-%{srcname}-qt4
34c2a7
Summary:          Qt4 integration for pyudev
34c2a7
34c2a7
Requires:         PyQt4
34c2a7
Requires:         python2-%{srcname} = %{version}-%{release}
34c2a7
34c2a7
%description -n python2-%{srcname}-qt4
34c2a7
Qt4 integration for pyudev.
34c2a7
34c2a7
This package provides a module pyudev.pyqt4 that contains classes for
34c2a7
integrating a pyudev monitor with the Qt4 main loop.
34c2a7
%endif
34c2a7
34c2a7
%package -n python2-%{srcname}-qt5
34c2a7
Summary:          Qt5 integration for pyudev
34c2a7
34c2a7
Requires:         python-qt5
34c2a7
Requires:         python2-%{srcname} = %{version}-%{release}
34c2a7
34c2a7
%description -n python2-%{srcname}-qt5
34c2a7
Qt5 integration for pyudev.
34c2a7
34c2a7
This package provides a module pyudev.pyqt5 that contains classes for
34c2a7
integrating a pyudev monitor with the Qt4 main loop.
34c2a7
34c2a7
%package -n python2-%{srcname}-pyside
34c2a7
Summary:           PySide integration for pyudev
34c2a7
34c2a7
Requires:          python-pyside
34c2a7
Requires:          python2-%{srcname} = %{version}-%{release}
34c2a7
34c2a7
%description -n python2-%{srcname}-pyside
34c2a7
PySide integration for pyudev.
34c2a7
34c2a7
This package provides a module pyudev.pyside that contains classes for
34c2a7
integrating a pyudev monitor with the PySide main loop.
34c2a7
34c2a7
%package -n python2-%{srcname}-wx
34c2a7
Summary:            wxPython integration for pyudev
34c2a7
34c2a7
Requires:           wxPython
34c2a7
Requires:           python2-%{srcname} = %{version}-%{release}
34c2a7
34c2a7
%description -n python2-%{srcname}-wx
34c2a7
wxPython integration for pyudev.
34c2a7
34c2a7
This package provides a module pyudev.wx that contains classes for
34c2a7
integrating a pyudev montior with the wxPython main loop.
34c2a7
%endif
34c2a7
34c2a7
%package -n python3-%{srcname}
34c2a7
Summary:          A libudev binding
34c2a7
%{?python_provide:%python_provide python3-%{srcname}}
34c2a7
34c2a7
BuildRequires:    python3-devel
34c2a7
BuildRequires:    python3-setuptools
34c2a7
34c2a7
# Needed for libudev, loaded through ctypes
34c2a7
Requires:         systemd-libs
34c2a7
34c2a7
# Used for python2/3 compatibility
34c2a7
Requires:         python3-six
34c2a7
34c2a7
%description -n python3-%{srcname}
34c2a7
pyudev is a LGPL licensed, pure Python binding for libudev, the device
34c2a7
and hardware management and information library for Linux.  It supports
34c2a7
almost all libudev functionality, you can enumerate devices, query device
34c2a7
properties and attributes or monitor devices, including asynchronous
34c2a7
monitoring with threads, or within the event loops of Qt, Glib or wxPython.
34c2a7
34c2a7
The binding supports CPython 2 (2.6 or newer) and 3 (3.1 or newer), and
34c2a7
PyPy 1.5 or newer.  It is tested against udev 151 or newer, earlier
34c2a7
versions of udev as found on dated Linux systems may work, but are not
34c2a7
officially supported.
34c2a7
34c2a7
%if %{with qt4}
34c2a7
%package -n python3-%{srcname}-qt4
34c2a7
Summary:          Qt4 integration for pyudev
34c2a7
34c2a7
Requires:         python3-PyQt4
34c2a7
Requires:         python3-%{srcname} = %{version}-%{release}
34c2a7
34c2a7
%description -n python3-%{srcname}-qt4
34c2a7
Qt4 integration for pyudev.
34c2a7
34c2a7
This package provides a module pyudev.pyqt4 that contains classes for
34c2a7
integrating a pyudev monitor with the Qt4 main loop.
34c2a7
%endif
34c2a7
34c2a7
%package -n python3-%{srcname}-qt5
34c2a7
Summary:          Qt5 integration for pyudev
34c2a7
34c2a7
Requires:         python3-qt5
34c2a7
Requires:         python3-%{srcname} = %{version}-%{release}
34c2a7
34c2a7
%description -n python3-%{srcname}-qt5
34c2a7
Qt5 integration for pyudev.
34c2a7
34c2a7
This package provides a module pyudev.pyqt5 that contains classes for
34c2a7
integrating a pyudev monitor with the Qt5 main loop.
34c2a7
34c2a7
%prep
34c2a7
%autosetup -n %{srcname}-%{version}
34c2a7
rm -rf pyudev.egg-info
34c2a7
34c2a7
%build
34c2a7
%if %{with python2}
34c2a7
%py2_build
34c2a7
%endif
34c2a7
34c2a7
%py3_build
34c2a7
34c2a7
%install
34c2a7
%if %{with python2}
34c2a7
%py2_install
34c2a7
%endif
34c2a7
34c2a7
%py3_install
34c2a7
34c2a7
%if %{with python2}
34c2a7
%files -n python2-%{srcname}
34c2a7
%license COPYING
34c2a7
%doc README.rst CHANGES.rst
34c2a7
%{python2_sitelib}/pyudev/
34c2a7
%{python2_sitelib}/pyudev-%{version}-*.egg-info
34c2a7
%exclude %{python2_sitelib}/pyudev/glib.py*
34c2a7
%exclude %{python2_sitelib}/pyudev/pyqt4.py*
34c2a7
%exclude %{python2_sitelib}/pyudev/pyqt5.py*
34c2a7
%exclude %{python2_sitelib}/pyudev/pyside.py*
34c2a7
%exclude %{python2_sitelib}/pyudev/wx.py*
34c2a7
34c2a7
%files -n python2-%{srcname}-glib
34c2a7
%license COPYING
34c2a7
%{python2_sitelib}/pyudev/glib.py*
34c2a7
34c2a7
%if %{with qt4}
34c2a7
%files -n python2-%{srcname}-qt4
34c2a7
%license COPYING
34c2a7
%{python2_sitelib}/pyudev/pyqt4.py*
34c2a7
%endif
34c2a7
34c2a7
%files -n python2-%{srcname}-qt5
34c2a7
%license COPYING
34c2a7
%{python2_sitelib}/pyudev/pyqt5.py*
34c2a7
34c2a7
%files -n python2-%{srcname}-pyside
34c2a7
%license COPYING
34c2a7
%{python2_sitelib}/pyudev/pyside.py*
34c2a7
34c2a7
%files -n python2-%{srcname}-wx
34c2a7
%license COPYING
34c2a7
%{python2_sitelib}/pyudev/wx.py*
34c2a7
%endif
34c2a7
34c2a7
%files -n python3-%{srcname}
34c2a7
%license COPYING
34c2a7
%doc README.rst CHANGES.rst
34c2a7
%{python3_sitelib}/pyudev
34c2a7
%{python3_sitelib}/pyudev-%{version}-*.egg-info
34c2a7
%exclude %{python3_sitelib}/pyudev/glib.py
34c2a7
%exclude %{python3_sitelib}/pyudev/__pycache__/glib.*
34c2a7
%exclude %{python3_sitelib}/pyudev/pyqt4.py
34c2a7
%exclude %{python3_sitelib}/pyudev/__pycache__/pyqt4.*
34c2a7
%exclude %{python3_sitelib}/pyudev/pyqt5.py
34c2a7
%exclude %{python3_sitelib}/pyudev/__pycache__/pyqt5.*
34c2a7
%exclude %{python3_sitelib}/pyudev/pyside.py
34c2a7
%exclude %{python3_sitelib}/pyudev/__pycache__/pyside.*
34c2a7
%exclude %{python3_sitelib}/pyudev/wx.py
34c2a7
%exclude %{python3_sitelib}/pyudev/__pycache__/wx.*
34c2a7
34c2a7
%if %{with qt4}
34c2a7
%files -n python3-%{srcname}-qt4
34c2a7
%license COPYING
34c2a7
%{python3_sitelib}/pyudev/pyqt4.py
34c2a7
%{python3_sitelib}/pyudev/__pycache__/pyqt4.*
34c2a7
%endif
34c2a7
34c2a7
%files -n python3-%{srcname}-qt5
34c2a7
%license COPYING
34c2a7
%{python3_sitelib}/pyudev/pyqt5.py
34c2a7
%{python3_sitelib}/pyudev/__pycache__/pyqt5.*
34c2a7
34c2a7
%changelog
34c2a7
* Thu Jun 14 2018 Yaakov Selkowitz <yselkowi@redhat.com> - 0.21.0-7
34c2a7
- Dropped qt4 from RHEL-8 (#1591123)
34c2a7
34c2a7
* Thu May 17 2018 Jaroslav Å karvada <jskarvad@redhat.com> - 0.21.0-6
34c2a7
- Bumped release to fix conflict caused by automerge
34c2a7
34c2a7
* Mon Apr 30 2018 Jaroslav Å karvada <jskarvad@redhat.com> - 0.21.0-5
34c2a7
- Dropped python2 from RHEL-8
34c2a7
34c2a7
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.21.0-4
34c2a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
34c2a7
34c2a7
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.21.0-3
34c2a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
34c2a7
34c2a7
* Wed Dec 21 2016 Kevin Fenzi <kevin@scrye.com> - 0.21.0-2
34c2a7
- Rebuild for Python 3.6
34c2a7
34c2a7
* Fri Jul 29 2016 mulhern <amulhern@redhat.com> - 0.21.1
34c2a7
- Deprecate use of Device object as mapping from udev property names to values
34c2a7
- Add a Properties class and a Device.properties() method for udev properties
34c2a7
- Fix places where Device object was incorrectly used in a boolean context
34c2a7
- Return an empty string, not None, if the property value is an empty string
34c2a7
- Exceptions re-raised from libudev calls now have a message string
34c2a7
- Insert a warning about using a Device in a boolean context in docs
34c2a7
- Infrastructure for vagrant tests is removed
34c2a7
- Various internal refactorings
34c2a7
- Extensive test improvements
34c2a7
- Numerous documentation fixes
34c2a7
34c2a7
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.20.0-3
34c2a7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
34c2a7
34c2a7
* Mon May 2 2016 mulhern <amulhern@redhat.com> - 0.20.0
34c2a7
- Remove parsing code added in previous release
34c2a7
- No longer do CI for Python 2.6
34c2a7
- Eliminate all wildcard imports and __all__ statements
34c2a7
- No longer use deprecated Device.from_sys_path() method
34c2a7
- Minor pylint induced changes
34c2a7
- Documentation fixes
34c2a7
34c2a7
* Mon Feb 08 2016 mulhern <amulhern@redhat.com> - 0.19.0
34c2a7
- Never raise a DeviceNotFoundError when iterating over a device enumeration
34c2a7
- Device.subsystem() now returns None if device has no subsystem
34c2a7
- Add DeprecationWarnings to deprecated Device methods
34c2a7
- Replace "/" with "!" in Device.from_name() sys_name parameter
34c2a7
- Add some unstable classes for parsing some kinds of values
34c2a7
- Make version info more like Python's including micro numbers and levels
34c2a7
- Refactor some internal modules into subdirectories
34c2a7
- Work on tests and reproducers
34c2a7
34c2a7
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.1-5
34c2a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
34c2a7
34c2a7
* Mon Dec 21 2015 mulhern <amulhern@redhat.com> - 0.18.1
34c2a7
- Restore raising KeyError in astring, asint, asbool methods in Attributes
34c2a7
- Add dependency on six package
34c2a7
- pyudev sources now in src directory
34c2a7
- Added support for pyqt5 monitor observer
34c2a7
- Added discover module, which looks up a device on limited information
34c2a7
- DeviceNotFoundError is no longer a subtype of LookupError
34c2a7
- Attributes class no longer extends Mapping class
34c2a7
- Attributes class no longer inherits [] operator and other Mapping methods
34c2a7
- Attributes class object are no longer iterable or indexable and have no length
34c2a7
- Attributes.available_attributes property added
34c2a7
- Attributes.get() method, with usual semantics explicitly defined
34c2a7
- Device.from_* methods are deprecated, use Devices.from_* methods instead
34c2a7
- Device.from_device_number() now raises DeviceNotFoundByNumberError
34c2a7
- Devices.from_interface_index() method added
34c2a7
- Devices.from_kernel_device() method added
34c2a7
34c2a7
* Thu Dec  3 2015 David Shea <dshea@redhat.com> - 0.17-4
34c2a7
- Add requires for things that are required
34c2a7
- Split the main-loop integration modules into separate packages
34c2a7
34c2a7
* Wed Nov 04 2015 Robert Kuska <rkuska@redhat.com> - 0.17-3
34c2a7
- Rebuilt for Python3.5 rebuild
34c2a7
34c2a7
* Wed Sep 15 2015 David Shea <dshea@redhat.com> - 0.17.1-2
34c2a7
- Fix a typo in the python3-pyudev Provides
34c2a7
34c2a7
* Mon Sep 14 2015 David Shea <dshea@redhat.com> - 0.17.1-1
34c2a7
- Really start the monitor on pyudev.Monitor.poll()
34c2a7
- Force non-blocking IO in pyudev.Monitor to avoid blocking on receiving the device
34c2a7
- Set proper flags on pipe fs
34c2a7
- Handle irregular polling events properly
34c2a7
- Rename MonitorObserver GUI classes and deprecate the old ones
34c2a7
- Remove patches for #1170337 and #1230773 that are now part of upstream
34c2a7
- Switch to new packaging guidelines which renames python-pyudev to python2-pyudev
34c2a7
34c2a7
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16.1-4
34c2a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
34c2a7
34c2a7
* Fri Jun 12 2015 David Shea <dshea@redhat.com> - 0.16.1-3
34c2a7
- Retry interrupted system calls (#1230773)
34c2a7
- Rearrange the build process to match current packaging recommendations
34c2a7
34c2a7
* Wed Jan 28 2015 David Shea <dshea@redhat.com> - 0.16.1-2
34c2a7
- Use %%license for the license file
34c2a7
34c2a7
* Wed Dec 10 2014 David Shea <dshea@redhat.com> - 0.16.1-1
34c2a7
- Update to pyudev-0.16.1 (#880644)
34c2a7
- Apply a patch from upstream to remove a global reference to libudev (#1170337)
34c2a7
34c2a7
* Wed Dec 10 2014 David Shea <dshea@redhat.com> - 0.15-7
34c2a7
- Fix license tag (LGPL -> LGPLv2+) (#990579)
34c2a7
- Remove rst tags from description
34c2a7
- Remove unnecessary requires and buildrequires (#1095459)
34c2a7
- Avoid packaging upstream egg-info files
34c2a7
- Add a python3 package
34c2a7
- Drop the Group tag which wasn't even the right group
34c2a7
34c2a7
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.15-6
34c2a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
34c2a7
34c2a7
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.15-5
34c2a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
34c2a7
34c2a7
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.15-4
34c2a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
34c2a7
34c2a7
* Mon Jul 23 2012 Chris Lockfort <clockfort@redhat.com> 0.15-3
34c2a7
- Reflect rawhide merging udev into systemd
34c2a7
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.15-2
34c2a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
34c2a7
* Mon Jun 18 2012 Chris Lockfort <clockfort@redhat.com> 0.15-1
34c2a7
- initial package