[mingw-libsqlite3x: 2/16] import from review

epienbro epienbro at fedoraproject.org
Wed Mar 7 20:05:40 UTC 2012


commit cb22462c3a091ffd520216b121a03d8077e87541
Author: sailer <sailer at fedoraproject.org>
Date:   Thu Apr 30 05:56:49 2009 +0000

    import from review

 .cvsignore                 |    2 +
 libsqlite3x-includes.patch |   20 ++++++++
 libsqlite3x-prep.patch     |   39 ++++++++++++++++
 mingw32-libsqlite3x.spec   |  107 ++++++++++++++++++++++++++++++++++++++++++++
 sources                    |    2 +
 5 files changed, 170 insertions(+), 0 deletions(-)
---
diff --git a/.cvsignore b/.cvsignore
index e69de29..64539b0 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -0,0 +1,2 @@
+libsqlite3x-2007.10.18.tar.gz
+libsqlite3x-autotools.tar.gz
diff --git a/libsqlite3x-includes.patch b/libsqlite3x-includes.patch
new file mode 100644
index 0000000..6e0e7c0
--- /dev/null
+++ b/libsqlite3x-includes.patch
@@ -0,0 +1,20 @@
+--- sq3.cpp.orig	2008-05-16 23:54:39.000000000 +0200
++++ sq3.cpp	2008-05-16 23:55:18.000000000 +0200
+@@ -8,6 +8,7 @@
+ #include "sq3.hpp"
+ #include <vector>
+ #include <sstream>
++#include <cstring>
+ 
+ #if SQ3_USE_WCHAR
+ #include <cwchar>
+--- sq3_log_db.cpp.orig	2008-05-16 23:55:36.000000000 +0200
++++ sq3_log_db.cpp	2008-05-16 23:55:50.000000000 +0200
+@@ -4,6 +4,7 @@
+ #include <sstream>
+ #include <vector>
+ #include <cstdio> // vsnprint()
++#include <cstring>
+ namespace sq3 {
+ 
+ 	log_db::log_db( std::string const & filename )
diff --git a/libsqlite3x-prep.patch b/libsqlite3x-prep.patch
new file mode 100644
index 0000000..b831252
--- /dev/null
+++ b/libsqlite3x-prep.patch
@@ -0,0 +1,39 @@
+--- sqlite3x_command.cpp.prep	2007-12-24 15:43:58.000000000 +0100
++++ sqlite3x_command.cpp	2007-12-24 15:47:31.000000000 +0100
+@@ -47,9 +47,18 @@
+ #if SQLITE3X_USE_WCHAR
+ 	sqlite3_command::sqlite3_command(sqlite3_connection &con, const std::wstring &sql) : con(con),stmt(0),refs(0),argc(0) {
+ 		const void *tail=NULL;
+-		if(sqlite3_prepare16(con.db(), sql.data(), (int)sql.length()*2, &this->stmt, &tail)!=SQLITE_OK)
+-			throw database_error(con);
+-
++		int rc =
++#if (SQLITE_VERSION_NUMBER >= 3003009)
++                        sqlite3_prepare16_v2
++#else
++                        sqlite3_prepare16
++#endif
++			(con.db(), sql.data(), (int)sql.length()*2, &this->stmt, &tail);
++		if( SQLITE_OK != rc )
++		{
++			throw database_error("sqlite3_command::prepare failed. Reason=[%s]",
++					     sqlite3_errmsg( this->con.db() ) );
++		}
+ 		this->argc=sqlite3_column_count(this->stmt);
+ 	}
+ #endif
+@@ -58,7 +67,13 @@
+ 	{
+ 		if( this->stmt ) this->finalize();
+ 		const char *tail=NULL;
+-		int rc = sqlite3_prepare( this->con.db(), sql, len, &(this->stmt), &tail );
++		int rc =
++#if (SQLITE_VERSION_NUMBER >= 3003009)
++                        sqlite3_prepare_v2
++#else
++                        sqlite3_prepare
++#endif
++			( this->con.db(), sql, len, &(this->stmt), &tail );
+ 		if( SQLITE_OK != rc )
+ 		{
+ 			throw database_error("sqlite3_command::prepare([%s]) failed. Reason=[%s]",
diff --git a/mingw32-libsqlite3x.spec b/mingw32-libsqlite3x.spec
new file mode 100644
index 0000000..5987971
--- /dev/null
+++ b/mingw32-libsqlite3x.spec
@@ -0,0 +1,107 @@
+%global __strip %{_mingw32_strip}
+%global __objdump %{_mingw32_objdump}
+%global _use_internal_dependency_generator 0
+%global __find_requires %{_mingw32_findrequires}
+%global __find_provides %{_mingw32_findprovides}
+
+%global veryear 2007
+%global vermon  10
+%global verday  18
+%global namesq3 libsq3
+%global name1   libsqlite3x
+Name:           mingw32-%{name1}
+Version:        %{veryear}%{vermon}%{verday}
+Release:        7%{?dist}
+Summary:        MinGW Windows C++ Wrapper for the SQLite3 embeddable SQL database engine
+
+Group:          System Environment/Libraries
+License:        zlib
+URL:            http://www.wanderinghorse.net/computing/sqlite/
+Source0:        http://www.wanderinghorse.net/computing/sqlite/%{name1}-%{veryear}.%{vermon}.%{verday}.tar.gz
+Source1:        libsqlite3x-autotools.tar.gz
+Patch1:         libsqlite3x-prep.patch
+Patch2:         libsqlite3x-includes.patch
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildArch:      noarch
+
+BuildRequires:  mingw32-sqlite dos2unix automake libtool
+BuildRequires:  mingw32-filesystem >= 23
+BuildRequires:  mingw32-gcc
+BuildRequires:  mingw32-gcc-c++
+BuildRequires:  mingw32-binutils
+
+%description
+sqlite3 is a slick embedded SQL server written in C. It's easy to use,
+powerful, and quite fast. sqlite3x is a C++ wrapper API for working
+with sqlite3 databases that uses exceptions.
+
+
+%package -n     mingw32-%{namesq3}
+Summary:        MinGW Windows C++ Wrapper for the SQLite3 embeddable SQL database engine
+Group:          Development/Libraries
+Requires:       mingw32-%{namesq3} = %{version}-%{release}
+
+%description -n mingw32-%{namesq3}
+sqlite3 is a slick embedded SQL server written in C. It's easy to use,
+powerful, and quite fast. sq3 is a C++ wrapper API for working
+with sqlite3 databases that does not use exceptions.
+
+
+%prep
+%setup -q -n %{name1}-%{veryear}.%{vermon}.%{verday} -a 1
+dos2unix *.hpp *.cpp
+%patch1 -p0 -b .prep
+%patch2 -p0 -b .incl
+aclocal
+libtoolize -f
+autoheader
+autoconf
+automake -a -c
+%{_mingw32_configure} --disable-static
+iconv -f iso8859-1 -t utf-8  < README > R
+mv R README
+
+%build
+make
+
+%install
+%{__rm} -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+#find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc AUTHORS README
+%{_mingw32_bindir}/libsqlite3x-1.dll
+%{_mingw32_includedir}/sqlite3x
+%{_mingw32_libdir}/libsqlite3x.dll.a
+%{_mingw32_libdir}/libsqlite3x.la
+%{_mingw32_libdir}/pkgconfig/libsqlite3x.pc
+
+%files -n mingw32-%{namesq3}
+%defattr(-,root,root,-)
+%doc AUTHORS README
+%{_mingw32_bindir}/libsq3-1.dll
+%{_mingw32_includedir}/sq3
+%{_mingw32_libdir}/libsq3.dll.a
+%{_mingw32_libdir}/libsq3.la
+%{_mingw32_libdir}/pkgconfig/libsq3.pc
+
+%changelog
+* Tue Apr 28 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 20071018-7
+- reorder BR/BA
+- remove (duplicate) docs
+- change License tag
+
+* Mon Apr 27 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 20071018-6
+- add missing BR
+
+* Mon Mar 23 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 20071018-5
+- unify main and devel subpackage
+
+* Mon Mar 23 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 20071018-4
+- copy from native package
diff --git a/sources b/sources
index e69de29..7920b4d 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+f5015c83030236205aec1494b13ee334  libsqlite3x-2007.10.18.tar.gz
+f8a0ce0a7ef474197b3341620eddd3b3  libsqlite3x-autotools.tar.gz


More information about the scm-commits mailing list