//По мотивам /usr/share/doc/rpm-build-python-*/ %define version 1.0 %define release alt1 %setup_python_module supermodule Summary: ... Name: %packagename Version: %version Release: %release Source: %modulename-%version.tar.bz2 License: GPL Group: Development/Python Prefix: %_prefix Url: http://supermodule.sf.net %description ... %prep %setup %build mkdir -p buildroot # Unfortunately build and install steps should be done at once # because otherwise .pyo files won't get into INSTALLED_FILES # record CFLAGS="%optflags" %__python setup.py \ install --optimize=2 \ --root=`pwd`/buildroot \ --record=INSTALLED_FILES %install cp -pr buildroot %buildroot/ unset RPM_PYTHON %files -f INSTALLED_FILES