1 | %{!?__python3:%global __python3 /usr/bin/python3} |
---|
2 | %{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")} |
---|
3 | %{!?python3_sitearch: %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")} |
---|
4 | %{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} |
---|
5 | %{!?python3_version: %global python3_version %(python3 -c "import sys; sys.stdout.write(sys.version[:3])")} |
---|
6 | %{!?__python2: %global __python2 /usr/bin/python2} |
---|
7 | %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} |
---|
8 | %define py2_setup setup.py |
---|
9 | %define py2_shbang_opts -s |
---|
10 | %define py2_build() %{expand:\ |
---|
11 | CFLAGS="%{optflags}" %{__python2} %{py2_setup} %{?py2_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?1}\ |
---|
12 | } |
---|
13 | %define py2_install() %{expand:\ |
---|
14 | CFLAGS="%{optflags}" %{__python2} %{py2_setup} %{?py2_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\ |
---|
15 | } |
---|
16 | %define py3_setup setup.py |
---|
17 | %define py3_shbang_opts -s |
---|
18 | %define py3_build() %{expand:\ |
---|
19 | CFLAGS="%{optflags}" %{__python3} %{py3_setup} %{?py3_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?1}\ |
---|
20 | } |
---|
21 | %define py3_install() %{expand:\ |
---|
22 | CFLAGS="%{optflags}" %{__python3} %{py3_setup} %{?py3_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\ |
---|
23 | } |
---|
24 | %define py3dir %{_builddir}/python3-%{name}-%{version}-%{release} |
---|
25 | |
---|
26 | |
---|
27 | %global with_python3 1 |
---|
28 | |
---|
29 | %global pypi_name netifaces |
---|
30 | |
---|
31 | Name: python-netifaces |
---|
32 | Version: 0.10.4 |
---|
33 | Release: 5%{?_dist_release} |
---|
34 | Summary: Python library to retrieve information about network interfaces |
---|
35 | |
---|
36 | Group: Development/Libraries |
---|
37 | License: MIT |
---|
38 | URL: https://pypi.python.org/pypi/netifaces |
---|
39 | |
---|
40 | Vendor: Project Vine |
---|
41 | Distribution: Vine Linux |
---|
42 | |
---|
43 | Source0: https://pypi.python.org/packages/source/n/%{pypi_name}/%{pypi_name}-%{version}.tar.gz |
---|
44 | |
---|
45 | BuildRequires: python-devel |
---|
46 | BuildRequires: python-setuptools |
---|
47 | |
---|
48 | |
---|
49 | %description |
---|
50 | This package provides a cross platform API for getting address information |
---|
51 | from network interfaces. |
---|
52 | |
---|
53 | %if 0%{?with_python3} |
---|
54 | %package -n python3-%{pypi_name} |
---|
55 | Summary: Python library to retrieve information about network interfaces |
---|
56 | BuildRequires: python3-devel |
---|
57 | BuildRequires: python3-setuptools |
---|
58 | |
---|
59 | %description -n python3-%{pypi_name} |
---|
60 | This package provides a cross platform API for getting address information |
---|
61 | from network interfaces. |
---|
62 | %endif |
---|
63 | |
---|
64 | |
---|
65 | %prep |
---|
66 | %setup -q -n %{pypi_name}-%{version} |
---|
67 | |
---|
68 | %if 0%{?with_python3} |
---|
69 | rm -rf %{py3dir} |
---|
70 | cp -a . %{py3dir} |
---|
71 | %endif |
---|
72 | |
---|
73 | |
---|
74 | %build |
---|
75 | %{__python2} setup.py build |
---|
76 | |
---|
77 | %if 0%{?with_python3} |
---|
78 | pushd %{py3dir} |
---|
79 | %{__python3} setup.py build |
---|
80 | popd |
---|
81 | %endif |
---|
82 | |
---|
83 | |
---|
84 | %install |
---|
85 | %{__python2} setup.py install --root $RPM_BUILD_ROOT |
---|
86 | |
---|
87 | %if 0%{?with_python3} |
---|
88 | pushd %{py3dir} |
---|
89 | %{__python3} setup.py install --root $RPM_BUILD_ROOT |
---|
90 | popd |
---|
91 | %endif |
---|
92 | |
---|
93 | %clean |
---|
94 | %if 0%{?with_python3} |
---|
95 | rm -rf %{py3dir} |
---|
96 | %endif |
---|
97 | rm -rf %{buildroot} |
---|
98 | |
---|
99 | |
---|
100 | %files |
---|
101 | %doc README.rst |
---|
102 | %{python2_sitearch}/%{pypi_name}-%{version}-*.egg-info/ |
---|
103 | %{python2_sitearch}/%{pypi_name}.so |
---|
104 | |
---|
105 | %if 0%{?with_python3} |
---|
106 | %files -n python3-%{pypi_name} |
---|
107 | %doc README.rst |
---|
108 | %{python3_sitearch}/%{pypi_name}-%{version}-*.egg-info/ |
---|
109 | %{python3_sitearch}/%{pypi_name}*.so |
---|
110 | %endif |
---|
111 | |
---|
112 | %changelog |
---|
113 | * Tue Jul 12 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 0.10.4-5 |
---|
114 | - initial build for Vine Linux. |
---|
115 | |
---|
116 | * Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.4-4 |
---|
117 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild |
---|
118 | |
---|
119 | * Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.4-3 |
---|
120 | - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 |
---|
121 | |
---|
122 | * Tue Jun 16 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 0.10.4-2 |
---|
123 | - Add python3 subpackage |
---|
124 | |
---|
125 | * Mon Feb 23 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 0.10.4-1 |
---|
126 | - Upstream 0.10.4 |
---|
127 | - Packaging cleanups |
---|
128 | |
---|
129 | * Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-8 |
---|
130 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild |
---|
131 | |
---|
132 | * Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 0.5-7 |
---|
133 | - Replace python-setuptools-devel BR with python-setuptools |
---|
134 | |
---|
135 | * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-6 |
---|
136 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild |
---|
137 | |
---|
138 | * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-5 |
---|
139 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild |
---|
140 | |
---|
141 | * Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-4 |
---|
142 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild |
---|
143 | |
---|
144 | * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-3 |
---|
145 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild |
---|
146 | |
---|
147 | * Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-2 |
---|
148 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild |
---|
149 | |
---|
150 | * Wed Jun 1 2011 Ryan Rix <ry@n.rix.si> 0.5-1 |
---|
151 | - Initial packaging effort |
---|