From 6d0f03689dff5244deec650232af1c625a98a0eb Mon Sep 17 00:00:00 2001
From: Adam Tkac <atkac@fedoraproject.org>
Date: Mon, 30 Mar 2009 13:53:10 +0000
Subject: [PATCH] - update to 1.3.39 - swig-1.3.38-rh485540.patch was merged -
 add Example/ to -doc again (#489077), filter provides correctly

---
 .cvsignore                 |  2 +-
 sources                    |  2 +-
 swig-1.3.38-rh485540.patch | 12 ------------
 swig.spec                  | 33 ++++++++++++++++++++++++++++-----
 4 files changed, 30 insertions(+), 19 deletions(-)
 delete mode 100644 swig-1.3.38-rh485540.patch

diff --git a/.cvsignore b/.cvsignore
index 525de80..d889f28 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +1 @@
-swig-1.3.38.tar.gz
+swig-1.3.39.tar.gz
diff --git a/sources b/sources
index 154e12e..67fed31 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-650c774917be49c526a4f8a3e733c898  swig-1.3.38.tar.gz
+ac201d1b87f8659584534f9540d7ad24  swig-1.3.39.tar.gz
diff --git a/swig-1.3.38-rh485540.patch b/swig-1.3.38-rh485540.patch
deleted file mode 100644
index 0f520c2..0000000
--- a/swig-1.3.38-rh485540.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up swig-1.3.38/Source/Modules/main.cxx.rh485540 swig-1.3.38/Source/Modules/main.cxx
---- swig-1.3.38/Source/Modules/main.cxx.rh485540	2009-02-16 16:27:07.000000000 +0100
-+++ swig-1.3.38/Source/Modules/main.cxx	2009-02-16 16:29:05.000000000 +0100
-@@ -954,7 +954,7 @@ int SWIG_main(int argc, char *argv[], La
-     if (!s) {
-       Printf(stderr, "Unable to locate '%s' in the SWIG library.\n", input_file);
-     } else {
--      FILE *f = Swig_include_open(outfile);
-+      FILE *f = Swig_open(outfile);
-       if (f) {
- 	fclose(f);
- 	Printf(stderr, "File '%s' already exists. Checkout aborted.\n", outfile);
diff --git a/swig.spec b/swig.spec
index f01cf6a..27fb75f 100644
--- a/swig.spec
+++ b/swig.spec
@@ -3,14 +3,13 @@
 
 Summary: Connects C/C++/Objective C to some high-level programming languages.
 Name: swig
-Version: 1.3.38
-Release: 5%{?dist}
+Version: 1.3.39
+Release: 1%{?dist}
 License: BSD
 Group: Development/Tools
 URL: http://swig.sourceforge.net/
 Source: http://download.sourceforge.net/swig/swig-%{version}.tar.gz
 Patch1: swig-1.3.23-pylib.patch
-Patch2: swig-1.3.38-rh485540.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: perl, python-devel
@@ -43,7 +42,26 @@ This package contains documentation for SWIG and useful examples.
 %prep
 %setup -q -n swig-%{version}
 %patch1 -p1 -b .pylib
-%patch2 -p1 -b .rh485540
+
+
+# as written on https://fedoraproject.org/wiki/Packaging_talk:Perl, section 2
+# (specific req/prov filtering). Before you remove this hack make sure you don't
+# reintroduce https://bugzilla.redhat.com/show_bug.cgi?id=489421
+cat << \EOF > %{name}-prov
+#!/bin/sh
+%{__perl_provides} `perl -p -e 's|\S+%{_docdir}/%{name}-doc-%{version}\S+||'`
+EOF
+
+%define __perl_provides %{_builddir}/%{name}-%{version}/%{name}-prov
+chmod +x %{__perl_provides}
+
+cat << \EOF > %{name}-req
+#!/bin/sh
+%{__perl_requires} `perl -p -e 's|\S+%{_docdir}/%{name}-doc-%{version}\S+||'`
+EOF
+
+%define __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req
+chmod +x %{__perl_requires}
 
 %build
 ./autogen.sh
@@ -78,9 +96,14 @@ rm -rf $RPM_BUILD_ROOT
 
 %files doc
 %doc ANNOUNCE CHANGES FUTURE INSTALL LICENSE NEW README TODO
-%doc Doc
+%doc Doc Examples
 
 %changelog
+* Mon Mar 30 2009 Adam Tkac <atkac redhat com> 1.3.39-1
+- update to 1.3.39
+- swig-1.3.38-rh485540.patch was merged
+- add Example/ to -doc again (#489077), filter provides correctly
+
 * Tue Mar 10 2009 Adam Tkac <atkac redhat com> 1.3.38-5
 - revert #489077 enhancement due #489421