File python-dmidecode.spec of Package python-dmidecode

#
# spec file for package python-dmidecode
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?python_ver: %global python_ver %(%{__python} -c "import sys ; print sys.version[:3]")}

Summary:        Python module to access DMI data
License:        GPL-2.0
Group:          System Environment/Libraries

Name:           python-dmidecode
Version:        3.12.1
Release:        0
Url:            http://projects.autonomy.net.au/python-dmidecode/
Source0:        http://src.autonomy.net.au/python-dmidecode/%{name}-%{version}.tar.gz
Patch0:         huge-memory.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       libxml2-python
BuildRequires:  libxml2-devel
BuildRequires:  libxml2-python
BuildRequires:  python-devel

%description
python-dmidecode is a python extension module that uses the code-base
of the 'dmidecode' utility, and presents the data as python data
structures or as XML data using libxml2.



%prep
%setup -q
%patch0 -p1

# copyright update, upstream commit d86d22c89cda5f8d2

%build
make build
cd unit-tests
make
cd ..

%install
rm -rf $RPM_BUILD_ROOT
python src/setup.py install --prefix=%{_prefix} --root $RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc README doc/README.upstream doc/LICENSE doc/AUTHORS doc/AUTHORS.upstream
%{python_sitearch}/dmidecodemod.so
%{python_sitearch}/dmidecode.py
%{python_sitearch}/dmidecode.py[co]
%if "%{python_ver}" >= "2.5"
%{python_sitearch}/*.egg-info
%endif
%{_datadir}/python-dmidecode/

%changelog
openSUSE Build Service is sponsored by