Enable sqlite database backend in QT

Bernardo Innocenti bernie at develer.com
Wed Dec 21 03:42:17 UTC 2005


Hello,

the sqlite plugin for Qt isn't built on Fedora.  Unless
there's a good reason, I'd like to propose the following
spec change to create the missing package.

Patch by Lorenzo Mancini <lmaninci at develer.com>.


--- SPECS/qt.spec.orig  2005-12-20 23:58:40.000000000 +0100
+++ SPECS/qt.spec       2005-12-21 01:38:20.000000000 +0100
@@ -31,6 +31,9 @@
 # buildodbc: Build ODBC plugins
 %define buildodbc 1

+# buildsqlite: Build SQLite plugins
+%define buildsqlite 1
+
 # buildmt: Build libs with threading support
 %define buildmt 1

@@ -77,7 +80,13 @@
 %define plugin_odbc %{nil}
 %endif

-%define plugins %{plugin_mysql} %{plugin_psql} %{plugin_odbc} %{plugins_style}
+%if %{buildsqlite}
+%define plugin_sqlite -plugin-sql-sqlite
+%else
+%define plugin_sqlite %{nil}
+%endif
+
+%define plugins %{plugin_mysql} %{plugin_psql} %{plugin_odbc} %{plugin_sqlite} %{plugins_style}

 Summary: The shared library for the Qt GUI toolkit.
 Name: qt
@@ -169,6 +178,10 @@
 BuildRequires: unixODBC-devel
 %endif

+%if %{buildsqlite}
+BuildRequires: sqlite2-devel
+%endif
+
 BuildRequires: fontconfig-devel >= 2.0


@@ -224,6 +237,14 @@
 %endif


+%if %{buildsqlite}
+%package SQLite
+Summary: SQLite drivers for Qt's SQL classes.
+Group: System Environment/Libraries
+Requires: %{name} = %{epoch}:%{version}-%{release}
+%endif
+
+
 %package static
 Summary: Version of the Qt GUI toolkit for static linking
 Group: Development/Libraries
@@ -296,6 +317,10 @@
 PostgreSQL driver for Qt's SQL classes (QSQL)
 %endif

+%if %{buildsqlite}
+%description SQLite
+SQLite driver for Qt's SQL classes (QSQL)
+%endif

 %description designer
 The qt-designer package contains an User Interface designer tool
@@ -447,6 +472,13 @@
    popd
 %endif

+# build sqlite plugin
+%if %{buildsqlite}
+   pushd plugins/src/sqldrivers/sqlite
+   qmake -o Makefile "LIBS+=-lsqlite" sqlite.pro
+   popd
+%endif
+
 make $SMP_MFLAGS src-moc
 make $SMP_MFLAGS sub-src
 make $SMP_MFLAGS sub-tools UIC="$QTDIR/bin/uic -nostdlib -L $QTDIR/plugins"
@@ -693,6 +725,11 @@
 %{qtdir}/plugins/sqldrivers/libqsqlmysql*
 %endif

+%if %{buildsqlite}
+%files SQLite
+%defattr(-,root,root,-)
+%{qtdir}/plugins/sqldrivers/libqsqlite*
+%endif

 %files designer
 %defattr(-,root,root,-) 

-- 
  // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/




More information about the fedora-devel-list mailing list