%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')} Name: pychecker Version: 0.8.16.1 Release: 2%{?dist} Summary: A python source code checking tool Group: Development/Tools License: BSDish URL: http://pychecker.sourceforge.net Source0: http://dl.sf.net/pychecker/PyChecker-%{version}.tar.gz Patch: pychecker.moduleattrs.patch Patch1: pychecker.setup.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python BuildRequires: python-devel BuildRequires: Distutils Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]") BuildArch: noarch %description PyChecker is a python source code checking tool to help you find common bugs. It is meant to find problems that are typically caught by a compiler. %prep %setup -q -n PyChecker-%{version} %patch -p0 %patch1 -p1 %build %install rm -rf $RPM_BUILD_ROOT # --skip-build does not properly regenerate the previously empty # "pychecker" script, so we can't use it %{__python} setup.py install -O1 --root $RPM_BUILD_ROOT # don't install docs in the python dirs for f in CHANGELOG COPYRIGHT KNOWN_BUGS MAINTAINERS README TODO VERSION do rm $RPM_BUILD_ROOT%{python_sitearch}/pychecker/$f done %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc CHANGELOG COPYRIGHT KNOWN_BUGS MAINTAINERS README TODO VERSION %{_bindir}/pychecker %dir %{python_sitearch}/pychecker %{python_sitearch}/pychecker/*.py %{python_sitearch}/pychecker/*.pyc %ghost %{python_sitearch}/pychecker/*.pyo %changelog * Thu Jan 12 2006 Thomas Vander Stichele - add a patch for setup.py; fix bug were /usr/bin/pychecker was empty (!) * Fri Sep 16 2005 Thomas Vander Stichele - 0.8.16.1-1: rewrite spec and package CVS snapshot plus additional patch