python-netifaces-vl.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. %global with_python3 1
  26. %global pypi_name netifaces
  27. Name: python-netifaces
  28. Version: 0.10.4
  29. Release: 5%{?_dist_release}
  30. Summary: Python library to retrieve information about network interfaces
  31. Group: Development/Libraries
  32. License: MIT
  33. URL: https://pypi.python.org/pypi/netifaces
  34. Vendor: Project Vine
  35. Distribution: Vine Linux
  36. Source0: https://pypi.python.org/packages/source/n/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
  37. BuildRequires: python-devel
  38. BuildRequires: python-setuptools
  39. %description
  40. This package provides a cross platform API for getting address information
  41. from network interfaces.
  42. %if 0%{?with_python3}
  43. %package -n python3-%{pypi_name}
  44. Summary: Python library to retrieve information about network interfaces
  45. BuildRequires: python3-devel
  46. BuildRequires: python3-setuptools
  47. %description -n python3-%{pypi_name}
  48. This package provides a cross platform API for getting address information
  49. from network interfaces.
  50. %endif
  51. %prep
  52. %setup -q -n %{pypi_name}-%{version}
  53. %if 0%{?with_python3}
  54. rm -rf %{py3dir}
  55. cp -a . %{py3dir}
  56. %endif
  57. %build
  58. %{__python2} setup.py build
  59. %if 0%{?with_python3}
  60. pushd %{py3dir}
  61. %{__python3} setup.py build
  62. popd
  63. %endif
  64. %install
  65. %{__python2} setup.py install --root $RPM_BUILD_ROOT
  66. %if 0%{?with_python3}
  67. pushd %{py3dir}
  68. %{__python3} setup.py install --root $RPM_BUILD_ROOT
  69. popd
  70. %endif
  71. %clean
  72. %if 0%{?with_python3}
  73. rm -rf %{py3dir}
  74. %endif
  75. rm -rf %{buildroot}
  76. %files
  77. %doc README.rst
  78. %{python2_sitearch}/%{pypi_name}-%{version}-*.egg-info/
  79. %{python2_sitearch}/%{pypi_name}.so
  80. %if 0%{?with_python3}
  81. %files -n python3-%{pypi_name}
  82. %doc README.rst
  83. %{python3_sitearch}/%{pypi_name}-%{version}-*.egg-info/
  84. %{python3_sitearch}/%{pypi_name}*.so
  85. %endif
  86. %changelog
  87. * Tue Jul 12 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 0.10.4-5
  88. - initial build for Vine Linux.
  89. * Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.4-4
  90. - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
  91. * Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.4-3
  92. - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
  93. * Tue Jun 16 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 0.10.4-2
  94. - Add python3 subpackage
  95. * Mon Feb 23 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 0.10.4-1
  96. - Upstream 0.10.4
  97. - Packaging cleanups
  98. * Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-8
  99. - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
  100. * Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 0.5-7
  101. - Replace python-setuptools-devel BR with python-setuptools
  102. * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-6
  103. - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
  104. * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-5
  105. - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
  106. * Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-4
  107. - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
  108. * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-3
  109. - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
  110. * Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-2
  111. - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
  112. * Wed Jun 1 2011 Ryan Rix <ry@n.rix.si> 0.5-1
  113. - Initial packaging effort