Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 9b33e8883a9ad53c31419e59ac6da0f2 > files > 4

python-enthought-traits-2.0.5-2mdv2009.0.src.rpm

%define name	       python-enthought-traits
%define version        2.0.5
%define release %mkrel 2
%define SOURCE         %(echo "-a`seq -s ' -a' 0 1`")

Summary: Python traits package from Enthought
Name:    %{name}
Version: %{version}
Release: %{release}
Source0: enthought.etsconfig-2.0.2.tar.lzma
Source1: enthought.traits-2.0.5.tar.lzma
Source2: enthought.pth
License: BSD 
Group:   Development/Python
Url: 	 http://code.enthought.com/projects/traits/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: python >= 2.3, python-numpy >= 1.0.2
BuildRequires: python-devel >= 2.3, python-setuptools >= 0.6c6

%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.

This RPM contains the following Enthought components: 
* etsconfig
* traits

%prep
%setup -q -c -T
%setup -q -T -D %SOURCE

%build
for d in enthought.*; do 
    pushd $d 
    %__python setup.py build 
    popd 
done

%install
%__rm -rf %{buildroot}

%__mkdir -p docs
for d in enthought.*; do
    pushd $d
    %__python setup.py install --root=%{buildroot}

    docdir=`echo $d | sed 's/enthought\.\(.*\)\-.*/\1/'`
    %__mkdir -p ../docs/$docdir
    ls *.txt >/dev/null 2>&1 && cp -f *.txt ../docs/$docdir
    [ -d docs ] && cp -rf docs ../docs/$docdir
    [ -d examples ] && cp -rf examples ../docs/$docdir
    [ -d scripts ] && cp -rf scripts ../docs/$docdir
    popd
done

# Needed because parts of ETS assume the existence of an enthought package:
touch %{buildroot}%{py_sitedir}/enthought/__init__.py
pushd %{buildroot}%{py_sitedir}/enthought/
%__python -c "import compileall; compileall.compile_dir('./')"
%__python -O -c "import compileall; compileall.compile_dir('./')"
popd

# Needed because the python setup.py install generates bad pth files:
%__rm -f %{buildroot}%{py_sitedir}/*.pth
%__install -m 644 %SOURCE2 %{buildroot}%{py_sitedir}

%clean
%__rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc docs/*
%py_sitedir/enthought*
%py_platsitedir/enthought*



%changelog
* Wed Jul 16 2008 Lev Givon <lev@mandriva.org> 2.0.5-2mdv2009.0
+ Revision: 236644
- Bump release to placate build system.
- import python-enthought-traits


* Tue Jul 15 2008 Lev Givon <lev@mandriva.org> 2.0.5-1mdv2008.1
- Package for Mandriva.