rpms/abiword/devel abiword-plugins-2.6.0-no-libboost-thread.patch, NONE, 1.1 abiword.spec, 1.53, 1.54

Marc Maurer (uwog) fedora-extras-commits at redhat.com
Sat Mar 29 00:58:31 UTC 2008


Author: uwog

Update of /cvs/pkgs/rpms/abiword/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16281

Modified Files:
	abiword.spec 
Added Files:
	abiword-plugins-2.6.0-no-libboost-thread.patch 
Log Message:
Fix 439395: Explosive growth in abiword package



abiword-plugins-2.6.0-no-libboost-thread.patch:

--- NEW FILE abiword-plugins-2.6.0-no-libboost-thread.patch ---
diff -N -u -r abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/IOClientHandler.h abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/IOClientHandler.h
--- abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/IOClientHandler.h	2008-03-18 23:18:08.000000000 +0100
+++ abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/IOClientHandler.h	2008-03-29 01:53:52.000000000 +0100
@@ -20,7 +20,6 @@
 #define __IO_CLIENT_HANDLER__
 
 #include <boost/bind.hpp>
-#include <boost/thread.hpp>
 #include <boost/utility.hpp>
 #include <asio.hpp>
 
@@ -69,7 +68,7 @@
 		UT_return_if_fail(work == NULL);
 		
 		work = new asio::io_service::work(io_service);
-		thread = new boost::thread(IOServiceThread(io_service));
+		thread = new asio::thread(IOServiceThread(io_service));
 		
 		// TODO: catch exceptions
 		asio::ip::tcp::resolver::iterator iterator(resolver.resolve(query));
@@ -79,7 +78,7 @@
 
 private:
 	asio::io_service					io_service;
-	boost::thread*						thread;
+	asio::thread*						thread;
 	asio::io_service::work*				work;
 	asio::ip::tcp::resolver				resolver;
 	asio::ip::tcp::resolver::query		query;
diff -N -u -r abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/IOServerHandler.h abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/IOServerHandler.h
--- abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/IOServerHandler.h	2008-03-18 23:18:08.000000000 +0100
+++ abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/IOServerHandler.h	2008-03-29 01:53:52.000000000 +0100
@@ -22,7 +22,6 @@
 #include "ut_debugmsg.h"
 
 #include <boost/bind.hpp>
-#include <boost/thread.hpp>
 #include <boost/utility.hpp>
 #include <asio.hpp>
 
@@ -47,7 +46,7 @@
 	{
 		work = new asio::io_service::work(io_service);
 		m_pAcceptor = new asio::ip::tcp::acceptor(io_service, endpoint);
-		boost::thread thread(iot);
+		asio::thread thread(iot);
 	}
 	
 	virtual ~IOServerHandler()
diff -N -u -r abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/Session.h abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/Session.h
--- abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/Session.h	2008-03-18 23:18:08.000000000 +0100
+++ abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/Session.h	2008-03-29 01:53:52.000000000 +0100
@@ -20,6 +20,7 @@
 #define __SESSION__
 
 #include <deque>
+#include <backends/xp/lock.h>
 
 class TCPAccountHandler;
 
@@ -48,7 +49,7 @@
 	void push(int size, char* data)
 	{
 		{
-			boost::mutex::scoped_lock lock(queue_protector); 
+			abicollab::scoped_lock lock(queue_protector); 
 			incoming.push_back( std::pair<int, char*>(size, data) );
 		}
 		signal();
@@ -62,7 +63,7 @@
 		if (incoming.size() == 0)
 			return false;
 		{
-			boost::mutex::scoped_lock lock(queue_protector); 
+			abicollab::scoped_lock lock(queue_protector); 
 			std::pair<int, char*> p = incoming.front();
 			size = p.first;
 			*data = p.second;
@@ -218,7 +219,7 @@
 	}
 
 	asio::ip::tcp::socket					socket;
-	boost::mutex 							queue_protector;
+	abicollab::mutex 							queue_protector;
 	std::deque< std::pair<int, char*> >		incoming;
 	std::deque< std::pair<int, char*> >		outgoing;
 
diff -N -u -r abiword-plugins-2.6.0.orig/tools/abicollab/backends/xp/lock.h abiword-plugins-2.6.0/tools/abicollab/backends/xp/lock.h
--- abiword-plugins-2.6.0.orig/tools/abicollab/backends/xp/lock.h	1970-01-01 01:00:00.000000000 +0100
+++ abiword-plugins-2.6.0/tools/abicollab/backends/xp/lock.h	2008-03-29 01:53:52.000000000 +0100
@@ -0,0 +1,94 @@
+/* Copyright (C) 2008 by Marc Maurer <uwog at uwog.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef WIN32
+#include <pthread.h>
+#endif
+
+namespace abicollab
+{
+
+class scoped_lock;
+
+class mutex
+{
+friend class scoped_lock;
+
+public:
+	mutex()
+	{
+#ifdef WIN32
+		repr = CreateMutex(0, FALSE, 0);
+#else
+		pthread_mutex_init(&repr, NULL);
+#endif
+	}
+
+	~mutex()
+	{
+#ifdef WIN32
+		CloseHandle(repr);
+#else
+		pthread_mutex_destroy(&repr);
+#endif
+	}
+
+private:
+	// we are noncopyable
+	mutex( const mutex& );
+	const mutex& operator=( const mutex& );
+
+#ifdef WIN32
+	HANDLE repr;
+#else
+	pthread_mutex_t repr;
+#endif
+};
+
+class scoped_lock
+{
+public:
+	scoped_lock(mutex& mutex)
+		: m_mutex(mutex)
+	{
+#ifdef WIN32
+		WaitForSingleObject(m_mutex.repr, INFINITE);
+#else
+		pthread_mutex_lock(&m_mutex.repr);
+#endif
+	}
+
+	~scoped_lock()
+	{
+#ifdef WIN32
+		ReleaseMutex(m_mutex.repr);
+#else
+		pthread_mutex_unlock(&m_mutex.repr);
+#endif
+	}
+
+private:
+	// we are noncopyable
+	scoped_lock( const scoped_lock& );
+	const scoped_lock& operator=( const scoped_lock& );
+
+	mutex& m_mutex;
+};
+
+}
+
diff -N -u -r abiword-plugins-2.6.0.orig/tools/abicollab/plugin.m4 abiword-plugins-2.6.0/tools/abicollab/plugin.m4
--- abiword-plugins-2.6.0.orig/tools/abicollab/plugin.m4	2008-03-18 23:18:08.000000000 +0100
+++ abiword-plugins-2.6.0/tools/abicollab/plugin.m4	2008-03-29 01:53:52.000000000 +0100
@@ -75,7 +75,6 @@
 
 # check for various boost libs
 AX_BOOST_BASE([1.33.1])
-AX_BOOST_THREAD
 
 # check for asio
 AC_LANG_PUSH(C++)
@@ -134,7 +133,7 @@
 ])
 if test "x$abicollab_handler_tcp" = "xyes" ; then
 	ABICOLLAB_TCP_CPPFLAGS="-DABICOLLAB_HANDLER_TCP $ABICOLLAB_ASIO_CPPFLAGS"
-	ABICOLLAB_TCP_LIBS="$BOOST_THREAD_LIB"
+	ABICOLLAB_TCP_LIBS="-lpthread"
 fi
 CPPFLAGS="$_abi_cppflags_save"
 LDFLAGS="$_abi_ldflags_save"
@@ -193,7 +192,7 @@
 ])
 if test "x$abicollab_handler_service" = "xyes" ; then
 	ABICOLLAB_SERVICE_CPPFLAGS="-DABICOLLAB_HANDLER_SERVICE $ABICOLLAB_ASIO_CPPFLAGS"
-	ABICOLLAB_SERVICE_LIBS="$BOOST_THREAD_LIB"
+	ABICOLLAB_SERVICE_LIBS="-lpthread"
 fi
 AC_SUBST(ABICOLLAB_SERVICE_CPPFLAGS)
 AC_SUBST(ABICOLLAB_SERVICE_LIBS)


Index: abiword.spec
===================================================================
RCS file: /cvs/pkgs/rpms/abiword/devel/abiword.spec,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- abiword.spec	27 Mar 2008 23:40:34 -0000	1.53
+++ abiword.spec	29 Mar 2008 00:57:55 -0000	1.54
@@ -5,7 +5,7 @@
 Summary: The AbiWord word processor
 Name: abiword
 Version: 2.6.0
-Release: 2%{?dist}
+Release: 3%{?dist}
 Epoch: 1
 Group: Applications/Editors
 License: GPLv2+
@@ -56,6 +56,7 @@
 Patch7: abiword-extras-2.6.0-destdir.patch
 Patch8: abiword-2.6.0-textbox.patch
 Patch9: abiword-extras-2.6.0-hash.patch
+Patch10: abiword-plugins-2.6.0-no-libboost-thread.patch
 
 %description
 AbiWord is a cross-platform Open Source word processor. It is full-featured,
@@ -85,6 +86,7 @@
 %patch3 -p1 -b .boolean
 %patch5 -p1 -b .xmpp
 %patch6 -p1 -b .regression
+%patch10 -p1 -b .no-libboost-thread
 
 # setup abiword extras
 %setup -q -T -b 2 -n abiword-extras-%{version}
@@ -199,6 +201,9 @@
 %{_libdir}/pkgconfig/abiword-%{majorversion}.%{minorversion}.pc
 
 %changelog
+* Mar 29 2008 Marc Maurer <uwog at abisource.com> - 1:2.6.0-3
+- Fix 439395: apply patch to remove any runtime dependency on boost
+
 * Fri Mar 28 2008 Marc Maurer <uwog at abisource.com> - 1:2.6.0-2
 - Add BigEndian32.american.hash that was missing from the disted
   abiword-extras tarball




More information about the fedora-extras-commits mailing list