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