Accepting request 84038 from home:kwk:branches:devel:tools:building

- Update to swig 2.0.4
  (see CHANGES.current for complete list)
  * [Perl] Patch #3260265 fixing overloading of non-primitive types and integers in 
    Perl 5.12 and later.
  * [Ruby] Fix %import where one of the imported files %include one of the STL include
    files such as std_vector.i.
  * [python] Additional fixes for python3.2 support.
  * [python] Fixed PyGetSetDescr for python3.2.
  * Bug 2635919: Convenience method to convert std::map to a python dict.
  * Fixed bug 1163440: vararg typemaps.
  * [Python] Applied patch #1932484: migrate PyCObject to PyCapsule.
  * [Python] Merged in the szager-python-builtin branch, adding the -builtin feature
    for python.  The -builtin option may provide a significant performance gain
    in python wrappers.  For full details and limitations, refer to Doc/Manual/Python.html.
    A small test suite designed to demonstrate the performance gain is in
    Examples/python/performance.

- Fix RHEL/Fedora build

OBS-URL: https://build.opensuse.org/request/show/84038
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/swig?expand=0&rev=23
This commit is contained in:
Ismail Dönmez 2011-09-21 07:57:50 +00:00 committed by Git OBS Bridge
parent c75d90868a
commit bd2b7fea26
13 changed files with 250 additions and 224 deletions

View File

@ -1,22 +0,0 @@
--- Examples/test-suite/python/Makefile.in 2010-07-22 18:59:08.000000000 +0200
+++ Examples/test-suite/python/Makefile.in 2011-05-03 12:29:40.193936593 +0200
@@ -53,9 +53,7 @@
li_std_pair_extra \
li_std_set \
li_std_stream \
- li_std_string_extra \
li_std_wstream \
- li_std_wstring \
primitive_types \
python_abstractbase \
python_kwargs \
--- Examples/test-suite/common.mk 2011-03-09 23:31:08.000000000 +0100
+++ Examples/test-suite/common.mk 2011-05-03 12:31:23.644936552 +0200
@@ -393,7 +393,6 @@
template_virtual \
template_whitespace \
threads \
- threads_exception \
throw_exception \
typedef_array_member \
typedef_class \

View File

@ -1,19 +0,0 @@
--- trunk/Lib/perl5/perlrun.swg 2011/05/19 18:48:57 12690
+++ trunk/Lib/perl5/perlrun.swg 2011/05/19 19:31:39 12691
@@ -274,8 +274,14 @@
return SWIG_OK;
} else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
if (!SvROK(sv)) {
- *(ptr) = (void *) 0;
- return SWIG_OK;
+ /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */
+ if (SvIOK(sv)) {
+ return SWIG_ERROR;
+ } else {
+ /* NULL pointer (reference to undef). */
+ *(ptr) = (void *) 0;
+ return SWIG_OK;
+ }
} else {
return SWIG_ERROR;
}

View File

@ -1,46 +0,0 @@
--- swig-2.0.3/Examples/test-suite/perl5/li_std_string_runme.pl 2008-06-24 22:11:46.000000000 +0200
+++ swig-2.0.3/Examples/test-suite/perl5/li_std_string_runme.pl 2011-05-19 10:29:07.285003422 +0200
@@ -48,7 +48,7 @@
# Check throw exception specification
eval { li_std_string::test_throw() };
-is($@, "test_throw message", "Test 5");
+like($@, qr/^test_throw message/, "Test 5");
{ local $TODO = "why is the error not a Perl string?";
eval { li_std_string::test_const_reference_throw() };
is($@, "<some kind of string>", "Test 6");
--- swig-2.0.3/Examples/test-suite/perl5/default_args_runme.pl 2008-04-30 23:02:46.000000000 +0200
+++ swig-2.0.3/Examples/test-suite/perl5/default_args_runme.pl 2011-05-19 10:42:21.205003460 +0200
@@ -41,11 +41,11 @@
# exception specifications
eval { default_args::exceptionspec() };
-is($@, "ciao", "exceptionspec 1");
+like($@, qr/^ciao/, "exceptionspec 1");
eval { default_args::exceptionspec(-1) };
-is($@, "ciao", "exceptionspec 2");
+like($@, qr/^ciao/, "exceptionspec 2");
eval { default_args::exceptionspec(100) };
-is($@, '100', "exceptionspec 3");
+like($@, qr/^100/, "exceptionspec 3");
my $ex = new default_args::Except($false);
@@ -54,13 +54,13 @@
# a zero was thrown, an exception occured, but $@ is false
is($hit, 0, "exspec 1");
eval { $ex->exspec(-1) };
-is($@, "ciao", "exspec 2");
+like($@, qr/^ciao/, "exspec 2");
eval { $ex->exspec(100) };
-is($@, 100, "exspec 3");
+like($@, qr/^100/, "exspec 3");
eval { $ex = default_args::Except->new($true) };
-is($@, -1, "Except constructor 1");
+like($@, qr/^-1/, "Except constructor 1");
eval { $ex = default_args::Except->new($true, -2) };
-is($@, -2, "Except constructor 2");
+like($@, qr/^-2/, "Except constructor 2");
#Default parameters in static class methods
is(default_args::Statics::staticmethod(), 60, "staticmethod 1");

View File

@ -1,92 +0,0 @@
diff -up swig-2.0.0/Lib/python/pyrun.swg.rh623854 swig-2.0.0/Lib/python/pyrun.swg
--- swig-2.0.0/Lib/python/pyrun.swg.rh623854 2010-02-28 00:26:02.000000000 +0100
+++ swig-2.0.0/Lib/python/pyrun.swg 2010-08-17 16:32:16.581604656 +0200
@@ -45,8 +45,18 @@
#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
-#define SWIG_fail goto fail
+#define SWIG_fail goto fail
+/*
+ * Python 2.7 and newer and Python 3.1 and newer should use Capsules API instead of
+ * CObjects API.
+ */
+#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
+ (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0))
+#define USE_CAPSULES
+#define TYPE_POINTER_NAME \
+ ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
+#endif
/* Runtime API implementation */
@@ -1356,8 +1366,12 @@ SWIG_Python_GetModule(void) {
#ifdef SWIG_LINK_RUNTIME
type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
#else
+#ifdef USE_CAPSULES
+ type_pointer = PyCapsule_Import(TYPE_POINTER_NAME, 0);
+#else
type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
(char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
+#endif
if (PyErr_Occurred()) {
PyErr_Clear();
type_pointer = (void *)0;
@@ -1402,9 +1416,14 @@ PyModule_AddObject(PyObject *m, char *na
SWIGRUNTIME void
SWIG_Python_DestroyModule(void *vptr)
{
+ size_t i;
+#ifdef USE_CAPSULES
+ swig_module_info *swig_module =
+ (swig_module_info *) PyCapsule_GetPointer((PyObject *)vptr, TYPE_POINTER_NAME);
+#else
swig_module_info *swig_module = (swig_module_info *) vptr;
+#endif
swig_type_info **types = swig_module->types;
- size_t i;
for (i =0; i < swig_module->size; ++i) {
swig_type_info *ty = types[i];
if (ty->owndata) {
@@ -1426,9 +1445,18 @@ SWIG_Python_SetModule(swig_module_info *
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
swig_empty_runtime_method_table);
#endif
+#ifdef USE_CAPSULES
+ PyObject *pointer = PyCapsule_New((void *)swig_module, TYPE_POINTER_NAME,
+ (PyCapsule_Destructor)SWIG_Python_DestroyModule);
+#else
PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
+#endif
if (pointer && module) {
+#ifdef USE_CAPSULES
+ PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
+#else
PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+#endif
} else {
Py_XDECREF(pointer);
}
@@ -1449,12 +1477,20 @@ SWIG_Python_TypeQuery(const char *type)
PyObject *obj = PyDict_GetItem(cache, key);
swig_type_info *descriptor;
if (obj) {
+#ifdef USE_CAPSULES
+ descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, type);
+#else
descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
+#endif
} else {
swig_module_info *swig_module = SWIG_Python_GetModule();
descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
if (descriptor) {
+#ifdef USE_CAPSULES
+ obj = PyCapsule_New(descriptor, type, NULL);
+#else
obj = PyCObject_FromVoidPtr(descriptor, NULL);
+#endif
PyDict_SetItem(cache, key, obj);
Py_DECREF(obj);
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:71590424045ea0e3e0a08c6882c1522c9fde821aba63f7cf0780b8c1c8e76a6f
size 4120117

View File

@ -0,0 +1,11 @@
diff -wruN -x '*~' ../orig-swig-2.0.4/Examples/test-suite/common.mk ./Examples/test-suite/common.mk
--- ../orig-swig-2.0.4/Examples/test-suite/common.mk 2011-05-02 23:11:15.000000000 +0200
+++ ./Examples/test-suite/common.mk 2011-09-20 15:35:39.000000000 +0200
@@ -394,7 +394,6 @@
template_virtual \
template_whitespace \
threads \
- threads_exception \
throw_exception \
typedef_array_member \
typedef_class \

View File

@ -0,0 +1,19 @@
diff -wruN -x '*~' ../orig-swig-2.0.4/Examples/test-suite/common.mk ./Examples/test-suite/common.mk
--- ../orig-swig-2.0.4/Examples/test-suite/common.mk 2011-05-02 23:11:15.000000000 +0200
+++ ./Examples/test-suite/common.mk 2011-09-20 21:20:03.000000000 +0200
@@ -113,7 +113,6 @@
argout \
array_member \
array_typedef_memberin \
- arrayref \
arrays_dimensionless \
arrays_global \
arrays_global_twodim \
@@ -240,7 +239,6 @@
member_template \
minherit \
minherit2 \
- mixed_types \
multiple_inheritance \
name_cxx \
name_warnings \

143
swig-2.0.4-ptrdiff_t.patch Normal file
View File

@ -0,0 +1,143 @@
diff -wruN -x '*~' ../orig-swig-2.0.4/Lib/python/pycontainer.swg ./Lib/python/pycontainer.swg
--- ../orig-swig-2.0.4/Lib/python/pycontainer.swg 2011-09-20 12:14:29.000000000 +0200
+++ ./Lib/python/pycontainer.swg 2011-09-20 12:13:22.000000000 +0200
@@ -189,7 +189,7 @@
namespace swig {
inline size_t
- check_index(ptrdiff_t i, size_t size, bool insert = false) {
+ check_index(std::ptrdiff_t i, size_t size, bool insert = false) {
if ( i < 0 ) {
if ((size_t) (-i) <= size)
return (size_t) (i + size);
@@ -203,7 +203,7 @@
}
inline size_t
- slice_index(ptrdiff_t i, size_t size) {
+ slice_index(std::ptrdiff_t i, size_t size) {
if ( i < 0 ) {
if ((size_t) (-i) <= size) {
return (size_t) (i + size);
diff -wruN -x '*~' ../orig-swig-2.0.4/Lib/python/pyiterators.swg ./Lib/python/pyiterators.swg
--- ../orig-swig-2.0.4/Lib/python/pyiterators.swg 2011-04-29 20:25:16.000000000 +0200
+++ ./Lib/python/pyiterators.swg 2011-09-20 12:14:10.000000000 +0200
@@ -41,7 +41,7 @@
}
// Random access iterator methods, but not required in Python
- virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const
+ virtual std::ptrdiff_t distance(const SwigPyIterator &/*x*/) const
{
throw std::invalid_argument("operation not supported");
}
@@ -78,7 +78,7 @@
return obj;
}
- SwigPyIterator *advance(ptrdiff_t n)
+ SwigPyIterator *advance(std::ptrdiff_t n)
{
return (n > 0) ? incr(n) : decr(-n);
}
@@ -93,27 +93,27 @@
return ! operator==(x);
}
- SwigPyIterator& operator += (ptrdiff_t n)
+ SwigPyIterator& operator += (std::ptrdiff_t n)
{
return *advance(n);
}
- SwigPyIterator& operator -= (ptrdiff_t n)
+ SwigPyIterator& operator -= (std::ptrdiff_t n)
{
return *advance(-n);
}
- SwigPyIterator* operator + (ptrdiff_t n) const
+ SwigPyIterator* operator + (std::ptrdiff_t n) const
{
return copy()->advance(n);
}
- SwigPyIterator* operator - (ptrdiff_t n) const
+ SwigPyIterator* operator - (std::ptrdiff_t n) const
{
return copy()->advance(-n);
}
- ptrdiff_t operator - (const SwigPyIterator& x) const
+ std::ptrdiff_t operator - (const SwigPyIterator& x) const
{
return x.distance(*this);
}
@@ -170,7 +170,7 @@
}
}
- ptrdiff_t distance(const SwigPyIterator &iter) const
+ std::ptrdiff_t distance(const SwigPyIterator &iter) const
{
const self_type *iters = dynamic_cast<const self_type *>(&iter);
if (iters) {
@@ -334,8 +334,8 @@
Mark methods that return new objects
*/
%newobject SwigPyIterator::copy;
- %newobject SwigPyIterator::operator + (ptrdiff_t n) const;
- %newobject SwigPyIterator::operator - (ptrdiff_t n) const;
+ %newobject SwigPyIterator::operator + (std::ptrdiff_t n) const;
+ %newobject SwigPyIterator::operator - (std::ptrdiff_t n) const;
%nodirector SwigPyIterator;
@@ -356,11 +356,11 @@
%catches(swig::stop_iteration) SwigPyIterator::__next__();
%catches(swig::stop_iteration) SwigPyIterator::next();
%catches(swig::stop_iteration) SwigPyIterator::previous();
- %catches(swig::stop_iteration) SwigPyIterator::advance(ptrdiff_t n);
- %catches(swig::stop_iteration) SwigPyIterator::operator += (ptrdiff_t n);
- %catches(swig::stop_iteration) SwigPyIterator::operator -= (ptrdiff_t n);
- %catches(swig::stop_iteration) SwigPyIterator::operator + (ptrdiff_t n) const;
- %catches(swig::stop_iteration) SwigPyIterator::operator - (ptrdiff_t n) const;
+ %catches(swig::stop_iteration) SwigPyIterator::advance(std::ptrdiff_t n);
+ %catches(swig::stop_iteration) SwigPyIterator::operator += (std::ptrdiff_t n);
+ %catches(swig::stop_iteration) SwigPyIterator::operator -= (std::ptrdiff_t n);
+ %catches(swig::stop_iteration) SwigPyIterator::operator + (std::ptrdiff_t n) const;
+ %catches(swig::stop_iteration) SwigPyIterator::operator - (std::ptrdiff_t n) const;
struct SwigPyIterator
{
@@ -380,7 +380,7 @@
virtual SwigPyIterator *decr(size_t n = 1);
// Random access iterator methods, but not required in Python
- virtual ptrdiff_t distance(const SwigPyIterator &x) const;
+ virtual std::ptrdiff_t distance(const SwigPyIterator &x) const;
virtual bool equal (const SwigPyIterator &x) const;
@@ -390,15 +390,15 @@
PyObject *next();
PyObject *__next__();
PyObject *previous();
- SwigPyIterator *advance(ptrdiff_t n);
+ SwigPyIterator *advance(std::ptrdiff_t n);
bool operator == (const SwigPyIterator& x) const;
bool operator != (const SwigPyIterator& x) const;
- SwigPyIterator& operator += (ptrdiff_t n);
- SwigPyIterator& operator -= (ptrdiff_t n);
- SwigPyIterator* operator + (ptrdiff_t n) const;
- SwigPyIterator* operator - (ptrdiff_t n) const;
- ptrdiff_t operator - (const SwigPyIterator& x) const;
+ SwigPyIterator& operator += (std::ptrdiff_t n);
+ SwigPyIterator& operator -= (std::ptrdiff_t n);
+ SwigPyIterator* operator + (std::ptrdiff_t n) const;
+ SwigPyIterator* operator - (std::ptrdiff_t n) const;
+ std::ptrdiff_t operator - (const SwigPyIterator& x) const;
};
}

View File

@ -1,15 +1,15 @@
diff -up swig-2.0.3/Lib/python/pycontainer.swg.rh666429 swig-2.0.3/Lib/python/pycontainer.swg
--- swig-2.0.3/Lib/python/pycontainer.swg.rh666429 2010-10-19 08:31:31.000000000 +0200
+++ swig-2.0.3/Lib/python/pycontainer.swg 2011-04-22 15:42:42.185982189 +0200
@@ -630,6 +630,7 @@ namespace swig
diff -wruN -x '*~' ../orig-swig-2.0.4/Lib/python/pycontainer.swg ./Lib/python/pycontainer.swg
--- ../orig-swig-2.0.4/Lib/python/pycontainer.swg 2011-04-10 00:07:22.000000000 +0200
+++ ./Lib/python/pycontainer.swg 2011-09-20 11:27:19.000000000 +0200
@@ -657,6 +657,7 @@
return x;
}
+#if !NO_PYSLICE
/* typemap for slice object support */
%typemap(in) PySliceObject* {
$1 = (PySliceObject *) $input;
@@ -637,6 +638,7 @@ namespace swig
if (!PySlice_Check($input)) {
@@ -667,6 +668,7 @@
%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) PySliceObject* {
$1 = PySlice_Check($input);
}
@ -17,7 +17,7 @@ diff -up swig-2.0.3/Lib/python/pycontainer.swg.rh666429 swig-2.0.3/Lib/python/py
Sequence* __getslice__(difference_type i, difference_type j) throw (std::out_of_range) {
return swig::getslice(self, i, j);
@@ -659,7 +661,11 @@ namespace swig
@@ -689,7 +691,11 @@
/* Overloaded methods for Python 3 compatibility
* (Also useful in Python 2.x)
*/
@ -29,8 +29,8 @@ diff -up swig-2.0.3/Lib/python/pycontainer.swg.rh666429 swig-2.0.3/Lib/python/py
Py_ssize_t i, j, step;
if( !PySlice_Check(slice) ) {
SWIG_Error(SWIG_TypeError, "Slice object expected.");
@@ -668,8 +674,11 @@ namespace swig
PySlice_GetIndices(slice, self->size(), &i, &j, &step);
@@ -698,8 +704,11 @@
PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
return swig::getslice(self, i, j);
}
-
@ -42,8 +42,8 @@ diff -up swig-2.0.3/Lib/python/pycontainer.swg.rh666429 swig-2.0.3/Lib/python/py
throw (std::out_of_range, std::invalid_argument) {
Py_ssize_t i, j, step;
if( !PySlice_Check(slice) ) {
@@ -680,7 +689,11 @@ namespace swig
swig::setslice(self, i, j, v);
@@ -721,7 +730,11 @@
swig::delslice(self, i,j);
}
+#if NO_PYSLICE
@ -54,10 +54,10 @@ diff -up swig-2.0.3/Lib/python/pycontainer.swg.rh666429 swig-2.0.3/Lib/python/py
throw (std::out_of_range) {
Py_ssize_t i, j, step;
if( !PySlice_Check(slice) ) {
diff -up swig-2.0.3/Source/Modules/python.cxx.rh666429 swig-2.0.3/Source/Modules/python.cxx
--- swig-2.0.3/Source/Modules/python.cxx.rh666429 2011-03-14 08:22:08.000000000 +0100
+++ swig-2.0.3/Source/Modules/python.cxx 2011-04-22 15:43:45.122661120 +0200
@@ -438,6 +438,7 @@ public:
diff -wruN -x '*~' ../orig-swig-2.0.4/Source/Modules/python.cxx ./Source/Modules/python.cxx
--- ../orig-swig-2.0.4/Source/Modules/python.cxx 2011-05-20 07:58:05.000000000 +0200
+++ ./Source/Modules/python.cxx 2011-09-20 11:27:19.000000000 +0200
@@ -527,6 +527,7 @@
if (py3) {
/* force disable features that not compatible with Python 3.x */
classic = 0;

3
swig-2.0.4.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bc44427d8a89539053a703a9237cf7ca313236b363676df23f07814c01030dda
size 4145216

View File

@ -1,3 +1,28 @@
-------------------------------------------------------------------
Tue Sep 20 09:31:28 UTC 2011 - kkaempf@suse.com
- Update to swig 2.0.4
(see CHANGES.current for complete list)
* [Perl] Patch #3260265 fixing overloading of non-primitive types and integers in
Perl 5.12 and later.
* [Ruby] Fix %import where one of the imported files %include one of the STL include
files such as std_vector.i.
* [python] Additional fixes for python3.2 support.
* [python] Fixed PyGetSetDescr for python3.2.
* Bug 2635919: Convenience method to convert std::map to a python dict.
* Fixed bug 1163440: vararg typemaps.
* [Python] Applied patch #1932484: migrate PyCObject to PyCapsule.
* [Python] Merged in the szager-python-builtin branch, adding the -builtin feature
for python. The -builtin option may provide a significant performance gain
in python wrappers. For full details and limitations, refer to Doc/Manual/Python.html.
A small test suite designed to demonstrate the performance gain is in
Examples/python/performance.
-------------------------------------------------------------------
Tue Sep 20 08:46:19 UTC 2011 - kkaempf@suse.com
- Fix RHEL/Fedora build
-------------------------------------------------------------------
Thu May 19 19:50:42 UTC 2011 - idoenmez@novell.com

1
swig.rpmlintrc Normal file
View File

@ -0,0 +1 @@
addFilter("devel-file-in-non-devel-package .*/usr/share/swig/.*/.*/.*")

View File

@ -26,15 +26,17 @@ BuildRequires: python-devel
%if 0%{?rhel_version} > 0
BuildRequires: -vim
%endif
%if 0%{?fedora} + 0%{?rhel_version} > 0
%if 0%{?fedora} + 0%{?rhel_version} + 0%{?centos_version} > 0
%define docpath %{_docdir}/%{name}-%{version}
BuildRequires: pkgconfig
BuildRequires: ruby-devel
%if 0%{?rhel_version} == 0
%if 0%{?rhel_version} + 0%{?centos_version} == 0
BuildRequires: perl-devel
%endif
%endif
%if 0%{?suse_version} > 0
%if 0%{?suse_version} > 1020
%define docpath %{_docdir}/%{name}
%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
# SLE9
@ -47,23 +49,22 @@ BuildRequires: pkg-config
BuildRequires: ruby-devel
%endif
%endif
Version: 2.0.3
Version: 2.0.4
Release: 5
License: GPLv3+ and BSD
Summary: Simplified Wrapper and Interface Generator
Url: http://www.swig.org
Group: Development/Languages/C and C++
Source: swig-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM swig-2.0.3-perl512.patch idoenmez@suse.de -- Upstream bug #3260265
Patch1: swig-2.0.3-perl512.patch
# PATCH-FIX-UPSTREAM swig-2.0.3-disable-broken-tests.patch idoenmez@suse.de -- Disable broken tests
Patch2: swig-2.0.3-disable-broken-tests.patch
# PATCH-FIX-UPSTREAM swig-2.0.3-use-python-capsule-api.patch idoenmez@suse.de -- Use Python capsule api
Patch3: swig-2.0.3-use-python-capsule-api.patch
# PATCH-FIX-UPSTREAM swig-2.0.3-support-python32.patch idoenmez@suse.de -- Support Python 3.2
Patch4: swig-2.0.3-support-python32.patch
# PATCH-FIX-UPSTREAM swig-2.0.3-perl514.patch idoenmez@suse.de -- Fix Perl 5.14 test failure
Patch5: swig-2.0.3-perl514.patch
Source: %{name}-%{version}.tar.bz2
Source1: %{name}.rpmlintrc
# PATCH-FIX-UPSTREAM swig-2.0.4-support-python32.patch idoenmez@suse.de -- Support Python 3.2
Patch1: swig-2.0.4-support-python32.patch
# swig-2.0.4-ptrdiff_t.patch kkaempf@suse.com -- import_stl fails under Python
Patch2: swig-2.0.4-ptrdiff_t.patch
# PATCH-FIX-UPSTREAM swig-2.0.4-disable-broken-tests.patch idoenmez@suse.de -- Disable broken tests
Patch3: swig-2.0.4-disable-broken-tests.patch
# swig-2.0.4-disable-broken-tests_rhel4.patch kkaempf@suse.com -- disable tests failing on RHEL4
Patch4: swig-2.0.4-disable-broken-tests_rhel4.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -119,10 +120,11 @@ understandig SWIG usage.
%prep
%setup -q
%patch1 -p1
%patch2
%patch3 -p1
%patch2 -p1
%patch3
%if 0%{?rhel_version} >= 400 && 0%{?rhel_version} < 500
%patch4 -p1
%patch5 -p1
%endif
%build
%configure --disable-ccache
@ -139,9 +141,9 @@ make check
%install
make install DESTDIR=%{buildroot}
install -d %{buildroot}%{_docdir}/%{name}
install -d %{buildroot}%{docpath}
cp -a TODO ANNOUNCE CHANGES* LICENSE README Doc/{Devel,Manual} \
%{buildroot}%{_docdir}/%{name}/
%{buildroot}%{docpath}
install -d %{buildroot}%{_libdir}/swig
cp -a Examples %{buildroot}%{_libdir}/swig/examples
@ -151,29 +153,33 @@ find %{buildroot}%{_libdir}/swig \
-name '*.o' -o -name '*_wrap.c' | xargs rm
# fix perms
chmod -x %{buildroot}%_docdir/%{name}/Manual/*
chmod -x %{buildroot}%{docpath}/Manual/*
find %{buildroot}%{_libdir}/swig -name '*.h' -perm +111 | \
xargs --no-run-if-empty chmod -x
ln -s %{_libdir}/swig/examples %{buildroot}%_docdir/%{name}/Examples
ln -s %{_libdir}/swig/examples %{buildroot}%{docpath}/Examples
%if 0%{?suse_version} > 1010
%fdupes $RPM_BUILD_ROOT
%endif
%clean
rm -rf %{buildroot}
%files
%defattr(644,root,root,755)
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/[A-Z][A-Z]*
%dir %{docpath}
%{docpath}/[A-Z][A-Z]*
%{_datadir}/swig
%attr(755,root,root) %{_bindir}/swig
%files doc
%defattr(-,root,root)
%{_docdir}/%{name}/Devel
%{_docdir}/%{name}/Manual
%{docpath}/Devel
%{docpath}/Manual
%files examples
%defattr(-,root,root)
%{_docdir}/%{name}/Examples
%{docpath}/Examples
%{_libdir}/swig
%changelog