an attempt to reinstate byte-compilation
[pypcilib.git] / pypcilib.spec
1 %define url $URL$
2
3 %define name pypcilib
4 %define version 0.2
5 %define taglevel 11
6
7 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
8
9 %{!?python_sitelib: %define python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
10 %{!?python_sitearch: %define python_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
11
12 # https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation
13 # Turn off the brp-python-bytecompile automagic
14 %global _python_bytecompile_extra 0
15
16 Summary: Python library for doing PCI stuff
17 Name: %{name}
18 Version: %{version}
19 Release: %{release}
20 License: BSD
21 Group: System Environment/Libraries
22
23 Packager: PlanetLab Central <support@planet-lab.org>
24 Distribution: PlanetLab %{plrelease}
25 #URL: http://svn.planet-lab.org/wiki/pypcilib
26 URL: %(echo %{url} | cut -d ' ' -f 2)
27
28 Source0: pypcilib-%{version}.tar.bz2
29
30 Requires: /sbin/lspci
31 BuildRequires: python2-devel
32
33 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -un)
34
35 %description
36 pypcilib is a Python library to scan PCI devices using
37 libpci from pciutils, and to parse the modules.pcimap file.
38
39
40 %prep
41 %setup -q
42
43
44 %build
45 %{__python2} setup.py build
46
47
48 %install
49 rm -fr "%{buildroot}"
50 %{__python2} setup.py install -O1 --skip-build --root "%{buildroot}"
51 %py_byte_compile %{__python2} %{buildroot}%{_datadir}/pypcimap 
52 %py_byte_compile %{__python2} %{buildroot}%{_datadir}/pypci
53 touch %{buildroot}%{python_sitelib}/pypcimap.py{c,o}
54 touch %{buildroot}%{python_sitelib}/pypci.py{c,o}
55
56
57 %clean
58 rm -fr "%{buildroot}"
59
60
61 %files
62 %defattr(-,root,root,-)
63 %{python_sitelib}/pypcimap.py
64 %ghost %{python_sitelib}/pypcimap.pyc
65 %ghost %{python_sitelib}/pypcimap.pyo
66 %{python_sitelib}/pypci.py
67 %ghost %{python_sitelib}/pypci.pyc
68 %ghost %{python_sitelib}/pypci.pyo
69 # xxx - quick'n dirty
70 %if ("%{distro}" == "Fedora" && %{distrorelease} >= 9) || ("%{distro}" == "SL" && %{distrorelease} >= 6) || ("%{distro}" == "CentOS")
71 %{python_sitelib}/pypciscan*.egg-info
72 %endif
73
74
75 %changelog
76 * Mon Feb 11 2013 Stephen Soltesz <soltesz@opentechinstitute.org> - pypcilib-0.2-11
77
78 * Fri Mar 11 2011 S.Çağlar Onur <caglar@verivue.com> - pypcilib-0.2-10
79 - Supoprt SL6
80
81 * Sun Dec 27 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-9
82 - fix build for fedora 12
83
84 * Mon Aug 10 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - pypcilib-0.2-8
85 - Add e1000e to the greylist
86
87 * Tue May 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-7
88 - ready for fedora11
89
90 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-6
91 - use 8139too driver over 8139cp for realtek 8139 chipsets
92
93 * Thu Jan 08 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-5
94 - support for building on fedora 10
95
96 * Thu Dec 04 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-4
97 - somehow the versions in the specfile are wrong in tag 0.2-3
98
99 * Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - pypcilib-0.2-2
100 - fixes for building on f9/gcc-4.3 - no functional change
101
102 * Fri Mar 14 2008 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.2-1
103 - Remove pypciscan library, reimplemented in Python
104
105 * Mon Nov 19 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.1-1
106 - initial release