%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: python-Traits Version: 3.0.2 Release: 2%{?dist} Summary: Explicitly typed attributes for Python Group: Development/Languages # Images have different licenses. For image license breakdown check # image_LICENSE.txt file. Except enthought/traits/ui/editors_gen.py # which is GPLv2+ all remaining source or image files are in BSD # 3-clause license. Confirmed from upstream. License: BSD and EPL and LGPLv2 and GPLv2+ URL: http://code.enthought.com/projects/traits/ #md5=78622c7651113bbac544da2e63215f19 Source0: http://pypi.python.org/packages/source/T/Traits/Traits-3.0.2.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-setuptools, numpy, python-devel %description The traits package developed by Enthought provides a special type definition called a trait. Although they can be used as normal Python object attributes, traits also have several additional characteristics: * Initialization: A trait can be assigned a default value. * Validation: A trait attribute's type can be explicitly declared. * Delegation: The value of a trait attribute can be contained either in another object. * Notification: Setting the value of a trait attribute can trigger notification of other parts of the program. * Visualization: User interfaces that permit the interactive modification of a trait's value can be automatically constructed using the trait's definition. %prep %setup -q -n Traits-%{version} # fix wrong-file-end-of-line-encoding find examples \( -type f -o -name '*py' \ -o -name '*desc' -o -name '*txt' \) -print \ | sed 's/\ /\\ /g' | xargs sed -i 's/\r//' ls *txt | sed 's/\ /\\ /g' | xargs sed -i 's/\r//' sed -i 's/\r//' enthought/traits/protocols/unused_setup # scripts having 644 permission chmod 755 enthought/traits/protocols/unused_setup chmod 755 enthought/traits/ui/unused_setup # file not utf-8 iconv -f iso8859-1 -t utf-8 image_LICENSE_Eclipse.txt \ > image_LICENSE_Eclipse.txt.conv && mv -f \ image_LICENSE_Eclipse.txt.conv image_LICENSE_Eclipse.txt %build CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build %install rm -rf $RPM_BUILD_ROOT python setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT rm $RPM_BUILD_ROOT/%{python_sitearch}/enthought/traits/protocols/_speedups.c rm $RPM_BUILD_ROOT/%{python_sitearch}/enthought/traits/ctraits.c # Prevents non standard permissions chmod 755 $RPM_BUILD_ROOT/%{python_sitearch}/enthought/traits/protocols/_speedups.so chmod 755 $RPM_BUILD_ROOT/%{python_sitearch}/enthought/traits/ctraits.so %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc *.txt examples/ docs/*.pdf %{python_sitearch}/* %changelog * Tue Jan 27 2009 Rakesh Pandit 3.0.2-2 - Fixed permissions for ctraits.so and _speedups.so - Fixed license after confirming from upstream * Sun Dec 07 2008 Rakesh Pandit 3.0.2-1 - Initial package