[mysql-workbench] remove bundled non gpl documentation

Remi Collet remi at fedoraproject.org
Sat Aug 11 16:55:04 UTC 2012


commit 10fb596d158b14a4dd7e5e40afd7a3f9e72ebead
Author: remi <fedora at famillecollet.com>
Date:   Sat Aug 11 18:54:49 2012 +0200

    remove bundled non gpl documentation

 .gitignore                          |    2 +
 mysql-workbench-5.2.41-nodocs.patch |   67 +++++++++++++++++++++++++++++++++++
 mysql-workbench.spec                |   21 ++++++++---
 sources                             |    2 +-
 stripdocs.sh                        |   33 +++++++++++++++++
 5 files changed, 119 insertions(+), 6 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 70fb6b9..3a15024 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
 *spec~
 /mysql-workbench-gpl-5.2.40-src.tar.gz
 /mysql-workbench-gpl-5.2.41-src.tar.gz
+/mysql-workbench-nodocs-5.2.41.tar.gz
+/mysql-workbench-nodocs-5.2.41.tar.xz
diff --git a/mysql-workbench-5.2.41-nodocs.patch b/mysql-workbench-5.2.41-nodocs.patch
new file mode 100644
index 0000000..ce1db8e
--- /dev/null
+++ b/mysql-workbench-5.2.41-nodocs.patch
@@ -0,0 +1,67 @@
+diff -up mysql-workbench-gpl-5.2.41-src/plugins/wb.doclib/Makefile.am.nodocs mysql-workbench-gpl-5.2.41-src/plugins/wb.doclib/Makefile.am
+--- mysql-workbench-gpl-5.2.41-src/plugins/wb.doclib/Makefile.am.nodocs	2012-08-11 17:57:08.216320706 +0200
++++ mysql-workbench-gpl-5.2.41-src/plugins/wb.doclib/Makefile.am	2012-08-11 18:01:21.206082661 +0200
+@@ -2,11 +2,5 @@
+ pylibdir=$(libdir)/@PACKAGE@/modules
+ 
+ pylib_DATA=\
+-  mysqldoclib.py\
+   wb_doclib_grt.py
+ 
+-docdatadir=$(datadir)/mysql-workbench/modules/data/DocLibrary
+-docdata_DATA=\
+-res/DocLibrary/mysqldoclib.sqlite\
+-res/DocLibrary/mysqldoclib_webui.sqlite
+-
+diff -up mysql-workbench-gpl-5.2.41-src/plugins/wb.doclib/wb_doclib_grt.py.nodocs mysql-workbench-gpl-5.2.41-src/plugins/wb.doclib/wb_doclib_grt.py
+--- mysql-workbench-gpl-5.2.41-src/plugins/wb.doclib/wb_doclib_grt.py.nodocs	2012-08-11 17:56:09.271140967 +0200
++++ mysql-workbench-gpl-5.2.41-src/plugins/wb.doclib/wb_doclib_grt.py	2012-08-11 17:56:18.259168247 +0200
+@@ -91,47 +91,7 @@ server_port = None
+ def openDocLib():
+     global docLibTab
+     global server_port
+-    if docLibTab:
+-      if docLibTab is True: # this will be True if an external browser is used
+-          Utilities.open_url("http://localhost:%i"%server_port)
+-          return 1
+-      App.get().select_view("wb.doclib")
+-      return 1
+-
+-    app = App.get()
+-
+-    try:
+-        import mysqldoclib
+-    except ImportError:
+-        Utilities.show_error("Cannot Open Documentation Library", 
+-                    '''pysqlite2 is not installed, please install python-sqlite2 or pysqlite2 to be able to use this feature.
+-Try running "easy_install pysqlite" with superuser privileges in the command line shell or, if using
+-Ubuntu, enable the Universe repository and install the python-pysqlite2 package from there.''',
+-                    "OK", "", "")
+-        return 0
+-    
+-    if server_port is None:
+-        ready_event = Event()
+-
+-        #datadir = "./modules/data/DocLibrary/"
+-        datadir = os.path.join(app.get_resource_path(""), "modules/data/DocLibrary")
+-
+-        thread.start_new_thread(run_server, (datadir, ready_event))    
+-
+-        # wait up to 1s for the doclib server to start
+-        ready_event.wait(1)
+-
+-    if platform.system() == "Linux":
+-        docLibTab = True
+-        Utilities.open_url("http://localhost:%i"%server_port)
+-        return 1
+-    docLibTab = DocLibTab(server_port)
+-    docLibTab.set_identifier("wb.doclib")
+-    
+-    app.dock_view(docLibTab, "maintab")
+-    app.set_view_title(docLibTab, "Doc Library (loading)")
+-
+-    app.set_status_text("Opening Doc Library...")
+ 
++    Utilities.open_url("http://dev.mysql.com/doc/index-gui.html")
+     return 1
+ 
diff --git a/mysql-workbench.spec b/mysql-workbench.spec
index 07532ac..2d367c8 100644
--- a/mysql-workbench.spec
+++ b/mysql-workbench.spec
@@ -11,15 +11,18 @@
 Summary:   A MySQL visual database modeling, administration and querying tool
 Name:      mysql-workbench
 Version:   5.2.41
-Release:   1%{?dist}
+Release:   2%{?dist}
 Group:     Applications/Databases
 License:   GPLv2 with exceptions
 
 URL:       http://wb.mysql.com
-# Upstream has a mirror redirector for downloads, so the URL is hard to
-# represent statically.  You can get the tarball by following a link from
-# http://dev.mysql.com/downloads/workbench/
-Source:    http://gd.tuwien.ac.at/db/mysql/Downloads/MySQLGUITools/%{name}-%{tarversion}.tar.gz
+
+# The upstream tarball includes non-free documentation that we cannot ship.
+# To remove the non-free documentation, run this script after downloading
+# the tarball into the current directory:
+# ./stripdocs.sh $VERSION
+Source0:   %{name}-nodocs-%{version}.tar.xz
+Source1:   stripdocs.sh
 
 # don't build extension, use system one
 # !!! This patch use versioned soname (libmysqlcppconn.so.6) !!!
@@ -31,6 +34,9 @@ Patch4:    %{name}-5.2.41-antlr.patch
 # http://bugs.mysql.com/63705
 Patch5:    %{name}-5.2.41-glib.patch
 
+# don't use bundled documentation, redirect to online doc
+Patch9:    %{name}-5.2.41-nodocs.patch
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: pcre-devel >= 3.9
 BuildRequires: libglade2-devel >= 2.0.0
@@ -133,6 +139,7 @@ rm -rf ext/antlr-runtime
 %endif
 
 %patch5 -p1 -b .glib
+%patch9 -p1 -b .nodocs
 
 touch -r COPYING .timestamp4rpm
 sed -i -e 's/\r//g' COPYING
@@ -222,6 +229,10 @@ fi
 
 
 %changelog
+* Sat Aug 11 2012 Remi Collet <remi at fedoraproject.org> 5.2.41-2
+- remove bundled documentation, redirect to online
+  This documentation is NOT distributed under a GPL license
+
 * Sat Aug 11 2012 Remi Collet <remi at fedoraproject.org> 5.2.41-1
 - update to 5.2.41 Community (OSS) Edition (GPL)
   http://dev.mysql.com/doc/workbench/en/wb-news-5-2-41.html
diff --git a/sources b/sources
index a6593a8..5d696d8 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-747d75a443797bb96acb66db68a980b0  mysql-workbench-gpl-5.2.41-src.tar.gz
+3226964f293f346de70ba14916947bd6  mysql-workbench-nodocs-5.2.41.tar.xz
diff --git a/stripdocs.sh b/stripdocs.sh
new file mode 100755
index 0000000..d37a850
--- /dev/null
+++ b/stripdocs.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+if [ "$1" = "" ]; then
+	echo usage $0  version
+	exit 1
+fi
+
+if [ ! -f mysql-workbench-gpl-$1-src.tar.gz ]; then
+	echo please download mysql-workbench-gpl-$1-src.tar.gz
+	echo from http://www.mysql.com/downloads/workbench/
+	exit 1
+fi
+
+tdir=`mktemp -d tmpXXXXXX`
+pushd $tdir
+
+echo -n "unpacking..."
+tar xzf ../mysql-workbench-gpl-$1-src.tar.gz && echo " done"
+rm -rf mysql-workbench-gpl-$1-src/plugins/wb.doclib/res/DocLibrary
+echo -n "packing..."
+tar cJf ../mysql-workbench-nodocs-$1.tar.xz mysql-workbench-gpl-$1-src && echo " done"
+
+echo -n "diffing..."
+tar tzf ../mysql-workbench-gpl-$1-src.tar.gz | sort >before
+echo -n "..."
+tar tJf ../mysql-workbench-nodocs-$1.tar.xz  | sort >after
+
+diff before after
+
+popd
+echo "cleaning..."
+rm -rf $tdir
+


More information about the scm-commits mailing list