summaryrefslogtreecommitdiffstats
path: root/python-ExtensionClass/F-13/python-ExtensionClass.spec
blob: 55a7d96da553958dad9d69fb05b737ccbb527f9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
%include %{_rpmconfigdir}/macros.python
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
%global modname ExtensionClass
%global version 2.13.2
%global release 1

Summary: Metaclass for subclassable extension types
Name: python-%{modname}
Version: %{version}
Release: %{release}%{?dist}
Source0: http://pypi.python.org/packages/source/E/%{modname}/%{modname}-%{version}.zip
# lp587760, patch provided by Artur Zaprzała <https://launchpad.net/~arturz>
#Patch0:  ExtensionClass-2.13.1-tp_basicsize.patch
License: ZPLv2.1
Group: Development/Libraries
URL: http://pypi.python.org/pypi/ExtensionClass

BuildRequires: python2-devel
BuildRequires: python-setuptools

%description
ExtensionClass and ExtensionClass-related packages
==================================================

ExtensionClass
--------------

This package provides a metaclass that allows classes implemented in
extension modules to be subclassed in Python.  Unless you need
ExtensionClasses for legacy applications (e.g. Zope 2), you probably
want to use Python's new-style classes (available since Python 2.2).

ComputedAttribute
-----------------

This package provides a way to attach attributes to an
ExtensionClass or instance that are computed by calling a
callable.  This works very much like property known from new-style
classes, except that a ComputedAttribute can also be attached to
an instance and that it honors ExtensionClass semantics (which is
useful for retaining Acquisition wrappers, for example).

MethodObject
------------

This package lets you attach additional "methods" to ExtensionClasses.
These "methods" are actually implemented by subclassing the
MethodObject.Method class and implementing the __call__ method
there.  Instances of those classes will be bound to the instances
they're attached to and will receive that instance object as a first
parameter (after self).

%package devel
Summary:  Developer files for %{name}
Group:    Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: python2-devel
BuildArch: noarch
%description devel
Files for developing applications using %{name}.

%prep
%setup -q -n %{modname}-%{version}
#%patch0 -p1 -b .tp_basicsize

%build
env CFLAGS="$RPM_OPT_FLAGS" python setup.py build

%install
rm -rf $RPM_BUILD_ROOT
python setup.py install --root=$RPM_BUILD_ROOT
# remove contained source file(s)
find $RPM_BUILD_ROOT -name '*.c' -type f -print0 | xargs -0 rm -fv
# deal with header file(s)
mkdir -p $RPM_BUILD_ROOT%{_includedir}/python%{py_ver}/%{modname}/
mv $RPM_BUILD_ROOT%{python_sitearch}/%{modname}/%{modname}.h \
   $RPM_BUILD_ROOT%{_includedir}/python%{py_ver}/%{modname}/

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc CHANGES.txt  COPYRIGHT.txt  LICENSE.txt README.txt
%{python_sitearch}/%{modname}/
%{python_sitearch}/%{modname}-*.egg-info
%{python_sitearch}/ComputedAttribute/
%{python_sitearch}/MethodObject/

%files devel
%defattr(-,root,root,-)
%{_includedir}/python%{py_ver}/%{modname}/

%changelog
* Thu Jun 17 2010 Robin Lee <robinlee.sysu@gmail.com> - 2.13.2-1
- Initial packaging