Added sqlite.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 30 Sep 2008 11:42:04 +0000 (12:42 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 30 Sep 2008 11:42:04 +0000 (12:42 +0100)
.hgignore
sqlite/mingw32-sqlite-3.5.9-no-undefined.patch [new file with mode: 0644]
sqlite/mingw32-sqlite.spec [new file with mode: 0644]
sqlite/sqlite-3.5.8-pkgconfig-version.patch [new file with mode: 0644]

index bc848b2..d53d19a 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -43,6 +43,7 @@ portablexdr/portablexdr-4.0.10.tar.gz
 readline/readline-5.2.tar.gz
 runtime-bootstrap/mingw-runtime-3.14.tar.gz
 runtime/mingw-runtime-3.14-src.tar.gz
+sqlite/sqlite-3.5.9.tar.gz
 termcap/termcap-1.3.1.tar.gz
 w32api-bootstrap/w32api-3.11.tar.gz
 w32api/w32api-3.11-src.tar.gz
diff --git a/sqlite/mingw32-sqlite-3.5.9-no-undefined.patch b/sqlite/mingw32-sqlite-3.5.9-no-undefined.patch
new file mode 100644 (file)
index 0000000..c16bcc2
--- /dev/null
@@ -0,0 +1,19 @@
+--- sqlite-3.5.9/Makefile.in.orig      2008-09-30 12:06:50.000000000 +0100
++++ sqlite-3.5.9/Makefile.in   2008-09-30 12:07:07.000000000 +0100
+@@ -413,13 +413,14 @@
+ libsqlite3.la:        $(LIBOBJ)
+       $(LTLINK) -o $@ $(LIBOBJ) $(TLIBS) \
+-              ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8"
++              ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8" \
++              -no-undefined
+ libtclsqlite3.la:     tclsqlite.lo libsqlite3.la
+       $(LTLINK) -o $@ tclsqlite.lo \
+               $(LIBOBJ) @TCL_STUB_LIB_SPEC@ $(TLIBS) \
+                 -rpath "$(libdir)/sqlite" \
+-              -version-info "8:6:8"
++              -version-info "8:6:8" -no-undefined
+ sqlite3$(TEXE):       $(TOP)/src/shell.c libsqlite3.la sqlite3.h
+       $(LTLINK) $(READLINE_FLAGS) \
diff --git a/sqlite/mingw32-sqlite.spec b/sqlite/mingw32-sqlite.spec
new file mode 100644 (file)
index 0000000..1eed6ef
--- /dev/null
@@ -0,0 +1,100 @@
+%define __strip %{_mingw32_strip}
+%define __objdump %{_mingw32_objdump}
+%define _use_internal_dependency_generator 0
+%define __find_requires %{_mingw32_findrequires}
+%define __find_provides %{_mingw32_findprovides}
+
+Name:           mingw32-sqlite
+Version:        3.5.9
+Release:        1%{?dist}
+Summary:        MinGW Windows port of sqlite embeddable SQL database engine
+
+License:        Public Domain
+Group:          Applications/Databases
+URL:            http://www.sqlite.org/
+Source0:        http://www.sqlite.org/sqlite-%{version}.tar.gz
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildArch:      noarch
+
+Patch1:         sqlite-3.5.8-pkgconfig-version.patch
+Patch10:        mingw32-sqlite-3.5.9-no-undefined.patch
+
+BuildRequires:  mingw32-filesystem >= 26
+BuildRequires:  mingw32-gcc
+BuildRequires:  mingw32-binutils
+
+BuildRequires:  mingw32-pdcurses
+BuildRequires:  mingw32-readline
+
+BuildRequires:  autoconf
+BuildRequires:  libtool
+
+
+%description
+SQLite is a C library that implements an SQL database engine. A large
+subset of SQL92 is supported. A complete database is stored in a
+single disk file. The API is designed for convenience and ease of use.
+Applications that link against SQLite can enjoy the power and
+flexibility of an SQL database without the administrative hassles of
+supporting a separate database server.  Version 2 and version 3 binaries
+are named to permit each to be installed on a single host
+
+This package contains cross-compiled libraries and development tools
+for Windows.
+
+
+%prep
+%setup -q -n sqlite-%{version}
+%patch1 -p1
+%patch10 -p1
+
+# Ships with an old/broken version of libtool which cannot create
+# Windows libraries properly.  So pull in the current version.
+autoreconf
+libtoolize --force
+
+
+%build
+# I think there's a bug in the configure script where, if
+# cross-compiling, it cannot correctly determine the target executable
+# extension (ie. .exe).  As a result it doesn't correctly detect that
+# the target is Windows and so tries to use Unix-specific functions
+# which don't exist.  In any case we can work around this by forcing
+# the extension via this export.
+#   - RWMJ 2008-09-30
+export config_TARGET_EXEEXT=.exe
+
+%{_mingw32_configure} \
+  --with-readline-inc='-I%{_mingw32_includedir}/readline' \
+  --with-readline-lib=%{_mingw32_libdir}/readline.dll.a
+make
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT install
+
+# Remove static libraries but DON'T remove *.dll.a files.
+rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libsqlite3.a
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root)
+%{_mingw32_bindir}/sqlite3.exe
+%{_mingw32_bindir}/libsqlite3-0.dll
+%{_mingw32_libdir}/libsqlite3.dll.a
+%{_mingw32_libdir}/libsqlite3.la
+%{_mingw32_includedir}/sqlite3.h
+%{_mingw32_includedir}/sqlite3ext.h
+%{_mingw32_libdir}/pkgconfig/sqlite3.pc
+# etc.
+
+
+%changelog
+* Thu Sep 25 2008 Richard Jones <rjones@redhat.com> - 3.5.9-1
+- Initial RPM release.
diff --git a/sqlite/sqlite-3.5.8-pkgconfig-version.patch b/sqlite/sqlite-3.5.8-pkgconfig-version.patch
new file mode 100644 (file)
index 0000000..cb5b5ef
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up sqlite-3.5.8/sqlite3.pc.in.release sqlite-3.5.8/sqlite3.pc.in
+--- sqlite-3.5.8/sqlite3.pc.in.release 2008-04-23 09:11:38.000000000 +0300
++++ sqlite-3.5.8/sqlite3.pc.in 2008-04-23 09:11:48.000000000 +0300
+@@ -7,7 +7,7 @@ includedir=@includedir@
+ Name: SQLite
+ Description: SQL database engine
+-Version: @VERSION@
++Version: @RELEASE@
+ Libs: -L${libdir} -lsqlite3
+ Libs.private: @LIBS@
+ Cflags: -I${includedir}