From b6af0ad425d0a2a1fc06fade0631f530fa9dc16b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 27 Nov 2014 22:39:04 +0100 Subject: [PATCH] - initial --- python-mccabe.spec | 96 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 python-mccabe.spec diff --git a/python-mccabe.spec b/python-mccabe.spec new file mode 100644 index 0000000..e6675ef --- /dev/null +++ b/python-mccabe.spec @@ -0,0 +1,96 @@ +# +# Conditional build: +%bcond_without tests # do not perform "make test" +%bcond_without python2 # CPython 2.x module +%bcond_without python3 # CPython 3.x module + +%define module mccabe +Summary: McCabe checker, plugin for flake8 +Name: python-%{module} +Version: 0.2.1 +Release: 1 +License: MIT +Group: Libraries/Python +Source0: https://pypi.python.org/packages/source/m/mccabe/mccabe-%{version}.tar.gz +# Source0-md5: 5a3f3fa6a4bad126c88aaaa7dab682f5 +URL: https://github.com/flintwork/mccabe +BuildRequires: rpm-pythonprov +BuildRequires: rpmbuild(macros) >= 1.219 +%if %{with python2} +BuildRequires: python-devel +BuildRequires: python-distribute +%endif +%if %{with python3} +BuildRequires: python3-devel +BuildRequires: python3-distribute +BuildRequires: python3-modules +%endif +Requires: python-modules +BuildArch: noarch +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +Ned's script to check McCabe complexity. + +%package -n python3-%{module} +Summary: McCabe checker, plugin for flake8 +Group: Libraries/Python +Requires: python3-modules + +%description -n python3-%{module} +Ned's script to check McCabe complexity. + +%prep +%setup -q -n %{module}-%{version} + +%build +%if %{with python2} +%{__python} setup.py build --build-base build-2 %{?with_tests:test} +%endif + +%if %{with python3} +%{__python3} setup.py build --build-base build-3 %{?with_tests:test} +%endif + +%install +rm -rf $RPM_BUILD_ROOT + +%if %{with python2} +%{__python} setup.py \ + build --build-base build-2 \ + install --skip-build \ + --optimize=2 \ + --root=$RPM_BUILD_ROOT + +%py_postclean +%endif + +%if %{with python3} +%{__python3} setup.py \ + build --build-base build-3 \ + install --skip-build \ + --optimize=2 \ + --root=$RPM_BUILD_ROOT +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%if %{with python2} +%files +%defattr(644,root,root,755) +%doc README.rst +%{py_sitescriptdir}/*.py[co] +%if "%{py_ver}" > "2.4" +%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info +%endif +%endif + +%if %{with python3} +%files -n python3-%{module} +%defattr(644,root,root,755) +%doc README.rst +%{py3_sitescriptdir}/%{module}.py +%{py3_sitescriptdir}/__pycache__/%{module}.cpython-*.py[co] +%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info +%endif -- 2.44.0