yet another attempt
[pypcilib.git] / pypcilib.spec
index 555496f..29e6a93 100644 (file)
@@ -1,24 +1,39 @@
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%define url $URL$
+
+%define name pypcilib
+%define version 0.2
+%define taglevel 11
+
+%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+
+%define python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
+
+# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation
+# Turn off the brp-python-bytecompile automagic
+%global _python_bytecompile_extra 0
 
 Summary: Python library for doing PCI stuff
-Name: pypcilib
-Version: 0.1
-Release: 1
+Name: %{name}
+Version: %{version}
+Release: %{release}
 License: BSD
-URL: http://svn.planet-lab.org/wiki/pypcilib
 Group: System Environment/Libraries
 
-BuildRequires: pciutils-devel
+Packager: PlanetLab Central <support@planet-lab.org>
+Distribution: PlanetLab %{plrelease}
+#URL: http://svn.planet-lab.org/wiki/pypcilib
+URL: %(echo %{url} | cut -d ' ' -f 2)
 
 Source0: pypcilib-%{version}.tar.bz2
 
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -un)
+Requires: /sbin/lspci
+BuildRequires: python2-devel
 
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -un)
 
 %description
 pypcilib is a Python library to scan PCI devices using
-pciutils' libpci, and to parse the modules.pcimap file.
+libpci from pciutils, and to parse the modules.pcimap file.
 
 
 %prep
@@ -26,13 +41,16 @@ pciutils' libpci, and to parse the modules.pcimap file.
 
 
 %build
-CFLAGS="%{optflags}" %{__python} setup.py build
+%{__python2} setup.py build
 
 
 %install
 rm -fr "%{buildroot}"
-%{__python} setup.py install -O1 --skip-build --root "%{buildroot}"
-touch %{buildroot}%{python_sitearch}/pypcimap.py{c,o}
+%{__python2} setup.py install -O1 --skip-build --root "%{buildroot}"
+%py_byte_compile %{__python2} %{buildroot}%{_datadir}/pypcimap 
+%py_byte_compile %{__python2} %{buildroot}%{_datadir}/pypci
+touch %{buildroot}%{python2_sitelib}/pypcimap.py{c,o}
+touch %{buildroot}%{python2_sitelib}/pypci.py{c,o}
 
 
 %clean
@@ -41,12 +59,47 @@ rm -fr "%{buildroot}"
 
 %files
 %defattr(-,root,root,-)
-%{python_sitearch}/pypciscan.so
-%{python_sitearch}/pypcimap.py
-%ghost %{python_sitearch}/pypcimap.pyc
-%ghost %{python_sitearch}/pypcimap.pyo
+%{python2_sitelib}/pypcimap.py
+%ghost %{python2_sitelib}/pypcimap.pyc
+%ghost %{python2_sitelib}/pypcimap.pyo
+%{python2_sitelib}/pypci.py
+%ghost %{python2_sitelib}/pypci.pyc
+%ghost %{python2_sitelib}/pypci.pyo
+# xxx - quick'n dirty
+%if ("%{distro}" == "Fedora" && %{distrorelease} >= 9) || ("%{distro}" == "SL" && %{distrorelease} >= 6) || ("%{distro}" == "CentOS")
+%{python2_sitelib}/pypciscan*.egg-info
+%endif
 
 
 %changelog
+* Mon Feb 11 2013 Stephen Soltesz <soltesz@opentechinstitute.org> - pypcilib-0.2-11
+
+* Fri Mar 11 2011 S.Çağlar Onur <caglar@verivue.com> - pypcilib-0.2-10
+- Supoprt SL6
+
+* Sun Dec 27 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-9
+- fix build for fedora 12
+
+* Mon Aug 10 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - pypcilib-0.2-8
+- Add e1000e to the greylist
+
+* Tue May 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-7
+- ready for fedora11
+
+* Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-6
+- use 8139too driver over 8139cp for realtek 8139 chipsets
+
+* Thu Jan 08 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-5
+- support for building on fedora 10
+
+* Thu Dec 04 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-4
+- somehow the versions in the specfile are wrong in tag 0.2-3
+
+* Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-2
+- fixes for building on f9/gcc-4.3 - no functional change
+
+* Fri Mar 14 2008 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.2-1
+- Remove pypciscan library, reimplemented in Python
+
 * Mon Nov 19 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.1-1
 - initial release