This commit is contained in:
fengtao 2020-02-20 19:25:49 +08:00
parent b3073f3360
commit b185e66cc2
2 changed files with 51 additions and 36 deletions

Binary file not shown.

View File

@ -1,70 +1,85 @@
Name: python-hwdata
Version: 2.3.7
Release: 4
Summary: Binding python to hwdata package
BuildArch: noarch
License: GPLv2
URL: https://github.com/xsuchy/python-hwdata
Source0: %{name}-%{version}.tar.gz
%bcond_without python2
Name: python-hwdata
Version: 2.3.7
Release: 1
Summary: Python bindings to hwdata package
License: GPLv2
URL: https://github.com/xsuchy/python-hwdata
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
%description
Supply python interface for stored database in hwdata package.
This can make you get human readable description about PCI devices and USB.
Provide python interface to database stored in hwdata package.
It allows you to get human readable description of USB and PCI devices.
%if %{with python2}
%package -n python2-hwdata
Summary: Binding python to hwdata package
BuildRequires: python2-devel
Requires: hwdata
Summary: Python bindings to hwdata package
BuildRequires: python2-devel
Requires: hwdata
%{?python_provide:%python_provide python2-hwdata}
%description -n python2-hwdata
Supply python interface for stored database in hwdata package.
This can make you get human readable description about PCI devices and USB.
This is the Python 2 build of the module.
Provide python interface to database stored in hwdata package.
It allows you to get human readable description of USB and PCI devices.
%endif
%package -n python3-hwdata
Summary: Binding python to hwdata package
BuildRequires: python3-devel python3-pylint
Requires: hwdata
Summary: Python bindings to hwdata package
BuildRequires: python3-devel
Requires: hwdata
%{?python_provide:%python_provide python3-hwdata}
%description -n python3-hwdata
Supply python interface for stored database in hwdata package.
This can make you get human readable description about PCI devices and USB.
This is the Python 3 build of the module.
Provide python interface to database stored in hwdata package.
It allows you to get human readable description of USB and PCI devices.
%package_help
%prep
%autosetup -n %{name}-%{version} -p1
%setup -q
rm -rf %{py3dir}
cp -a . %{py3dir}
%build
%py2_build
%if %{with python2}
%_bindir/python2 setup.py build '--executable=%_bindir/python2 -s'
%endif # with python2
cd %{py3dir}
%py3_build
pushd %{py3dir}
%_bindir/python3 setup.py build '--executable=%_bindir/python3 -s'
popd
%install
%py2_install
%if %{with python2}
%_bindir/python2 setup.py install -O1 --skip-build --root %buildroot
%endif
cd %{py3dir}
%py3_install
pushd %{py3dir}
%_bindir/python3 setup.py install -O1 --skip-build --root %buildroot
popd
%check
pylint-3 hwdata.py example.py || :
%if %{with python2}
%files -n python2-hwdata
%defattr(-,root,root)
%license LICENSE
%doc README.md example.py html
%{python2_sitelib}/*
%_prefix/lib/python2.7/site-packages/*
%endif # with python2
%files -n python3-hwdata
%defattr(-,root,root)
%license LICENSE
%doc README.md example.py html
%{python3_sitelib}/*
%_prefix/lib/python3.7/site-packages/*
%files help
%defattr(-,root,root)
%doc example.py README.md html
%changelog
* Fri Dec 20 2019 wutao <wutao61@huawei.com> - 2.3.7-4
* Tue Feb 11 2020 huzunhao<huzunhao2@huawei.com> - 2.3.7-8
- Package init