Hi,

I would like to request PyICU (http://pyicu.osafoundation.org/) to be
added to RPMforge.

I successfully compiled latest version 0.8.1 under both CentOS 5 and
CentOS 4 (with a small patch for Python 2.3), using libicu and
libicu-devel from RPMforge. The tests passed (one of the tests had to
be rewritten to work in Python 2.3).

I'm attaching the specfile I used and the patch for Python 2.3 (works
on 2.4 as well with an #ifdef).

Let me know if there is anything else I could do to help get this one
in the repo.

Thanks,
Filipe
%define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")

Summary: PyICU is a python extension wrapping IBM's ICU C++ API
Name: pyicu
Version: 0.8.1
Release: 1
License: GPL
Group: System Environment/Base
URL: http://pyicu.osafoundation.org/

Source: http://pypi.python.org/packages/source/P/PyICU/PyICU-0.8.1.tar.gz
Patch0: pyicu-python23.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

BuildRequires: python-devel >= 2.3, libicu-devel >= 3.6, gcc-c++
Requires: python >= 2.3, libicu >= 3.6, libstdc++

%description
PyICU is a python extension wrapping IBM's ICU C++ API.

%prep
%setup -n PyICU-0.8.1
%patch0 -p0

%build
%{__python} setup.py build

%install
%{__python} setup.py install --root="%{buildroot}" --prefix="%{_prefix}"

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc CHANGES CREDITS LICENSE README
%{python_sitelib}/PyICU.py
%{python_sitelib}/PyICU.pyc
%{python_sitelib}/_PyICU.so


%changelog
* Mon Dec  8 2008 Filipe Brandenburger <[EMAIL PROTECTED]> - 0.8.1-1
- Initial package.

--- macros.h.orig	2007-12-05 20:56:59.000000000 -0500
+++ macros.h	2008-12-08 13:19:10.000000000 -0500
@@ -275,4 +275,18 @@
     Py_INCREF(self);                                    \
     return (PyObject *) self;
 
+
+/* define Py_CLEAR if in Python <= 2.4 */
+#ifndef Py_CLEAR
+#define Py_CLEAR(op)                            \
+        do {                                    \
+                if (op) {                       \
+                        PyObject *tmp = (PyObject *)(op);       \
+                        (op) = NULL;            \
+                        Py_DECREF(tmp);         \
+                }                               \
+        } while (0)
+#endif /* Py_CLEAR */
+
+
 #endif /* _macros_h */
_______________________________________________
users mailing list
[email protected]
http://lists.rpmforge.net/mailman/listinfo/users

Reply via email to