Blob Blame Raw
%bcond_without python3

%global module_name vulture
%global common_desc \
Vulture finds unused classes, functions and variables in your code. \
This helps you cleanup and find errors in your programs. If you run it \
on both your library and test suite you can find untested code. \
Due to Python’s dynamic nature, static code analyzers like vulture \
are likely to miss some dead code. Also, code that is only called \
implicitly may be reported as unused. Nonetheless, vulture can be a \
very helpful tool for higher code quality.

Name:		python-%{module_name}
Version:	0.14
Release:	1%{?dist}
Summary:	Find Dead Code

License:	MIT

BuildArch:	noarch


%package -n	python2-%{module_name}
Summary:	Find Dead Code
%{?python_provide:%python_provide python2-%{module_name}}

BuildRequires:	python2-devel
BuildRequires:	python-setuptools
# Required by tests
BuildRequires:	python2-pytest
BuildRequires:	python2-pytest-cov

Requires:	python-setuptools

%description -n	python2-%{module_name}

%if %{with python3}
%package -n	python3-%{module_name}
Summary:	Find Dead Code
%{?python_provide:%python_provide python3-%{module_name}}

BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
# Required by tests
BuildRequires:	python3-pytest
BuildRequires:	python3-pytest-cov

Requires:	python3-setuptools
%description -n	python3-%{module_name}

%autosetup -n	%{module_name}-%{version}
# Remove shebang
sed -i '1{/^#!/d}'

%if %{with python3}

%if %{with python3}
mv %{buildroot}%{_bindir}/%{module_name} %{buildroot}%{_bindir}/%{module_name}-%{python3_version}
mv %{buildroot}%{_bindir}/%{module_name} %{buildroot}%{_bindir}/%{module_name}-%{python2_version}

ln -s %{_bindir}/vulture-%{python3_version} %{buildroot}/%{_bindir}/vulture-3
ln -s %{_bindir}/vulture-%{python2_version} %{buildroot}/%{_bindir}/vulture-2
ln -s %{_bindir}/vulture-%{python2_version} %{buildroot}/%{_bindir}/vulture

%if %{with python3}

%files -n	python2-%{module_name}
%doc README.rst
%license LICENSE.txt

%if %{with python3}
%files -n	python3-%{module_name}
%doc README.rst
%license LICENSE.txt

* Tue Jun 20 2017 Yatin Karel <> - 0.14-1
- Initial package import