File ocqt5125-sqlite3.spec of Package ocqt5125-sqlite3

#
# spec file for package sqlite3
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%_oc_package_header

%define _oc_mandir %{_oc_datadir}/man

%define oname sqlite
%define tarversion 3290000
Name:           ocqt5125-sqlite3
Version:        3.29.0
Release:        0
Summary:        Embeddable SQL Database Engine
License:        SUSE-Public-Domain
Group:          Productivity/Databases/Servers
URL:            http://www.sqlite.org/
Source0:        http://www.sqlite.org/2019/sqlite-src-%{tarversion}.zip
Source1:        baselibs.conf
Source2:        http://www.sqlite.org/2019/sqlite-doc-%{tarversion}.zip
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  readline-devel
BuildRequires:  tcl-devel
BuildRequires:  unzip
BuildRequires:  pkgconfig(zlib)
# _oc_package_header is defined here:
BuildRequires:  ocqt5125-filesystem
%if 0%{?centos_version} == 800
# Prevent ERROR: GDB index requested, but no gdb-add-index installed
BuildRequires:  gdb
%endif

BuildRequires:  pkgconfig(zlib)
# for openSUSE, CentOS
Provides:       %{oname}3 = %{version}
# Obsoletes:      % {oname}3 < % {version}

%description
SQLite is a C library that implements an embeddable SQL database
engine. Programs that link with the SQLite library can have SQL
database access without running a separate RDBMS process.

SQLite is not a client library used to connect to a big database
server. SQLite is a server and the SQLite library reads and writes
directly to and from the database files on disk.

SQLite can be used via the sqlite command line tool or via any
application that supports the Qt database plug-ins.

%package -n ocqt5125-libsqlite3-0
Summary:        Shared libraries for the Embeddable SQL Database Engine
Group:          Development/Libraries/C and C++

%description -n ocqt5125-libsqlite3-0
This package contains the shared libraries for the Embeddable SQL
Database Engine.

SQLite is a C library that implements an embeddable SQL database
engine. Programs that link with the SQLite library can have SQL
database access without running a separate RDBMS process.

SQLite is not a client library used to connect to a big database
server. SQLite is a server and the SQLite library reads and writes
directly to and from the database files on disk.

SQLite can be used via the sqlite command line tool or via any
application that supports the Qt database plug-ins.

%package devel
Summary:        Embeddable SQL Database Engine
Group:          Development/Libraries/C and C++
Requires:       glibc-devel
Requires:       ocqt5125-libsqlite3-0 = %{version}

%description devel
SQLite is a C library that implements an embeddable SQL database
engine. Programs that link with the SQLite library can have SQL
database access without running a separate RDBMS process.

SQLite is not a client library used to connect to a big database
server; SQLite is the server. The SQLite library reads and writes
directly to and from the database files on disk.

SQLite can be used via the sqlite command-line tool or via any
application which supports the Qt database plug-ins.

%package doc
Summary:        Documentation for %{name}
Group:          Documentation/Other
BuildArch:      noarch

%description doc

Contains HTML documentation for SQLite: SQL Syntax, C/C++ API and
other documentation found on sqlite.org. The files can be found in
%{_docdir}/%{name}-doc.

%prep
%setup -q -n sqlite-src-%{tarversion} -a2
rm -v sqlite-doc-%{tarversion}/releaselog/current.html
ln -sv `echo %{version} | sed "s/\./_/g"`.html sqlite-doc-%{tarversion}/releaselog/current.html
find -type f -name sqlite.css~ -delete

%build
export LIBS="$LIBS -lm "
export CFLAGS="%{optflags} \
	-DSQLITE_ENABLE_API_ARMOR \
	-DSQLITE_ENABLE_COLUMN_METADATA \
	-DSQLITE_ENABLE_DBSTAT_VTAB \
	-DSQLITE_ENABLE_HIDDEN_COLUMNS \
	-DSQLITE_ENABLE_FTS3 \
	-DSQLITE_ENABLE_FTS4 \
	-DSQLITE_ENABLE_FTS5 \
	-DSQLITE_ENABLE_JSON1 \
	-DSQLITE_ENABLE_RBU \
	-DSQLITE_ENABLE_RTREE \
	-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
	-DSQLITE_SOUNDEX \
	-DSQLITE_ENABLE_UNLOCK_NOTIFY \
	-DSQLITE_SECURE_DELETE \
	"
%configure \
  --disable-static \
  --disable-static-shell \
  --enable-readline \
  --enable-fts3 \
  --enable-fts4 \
  --enable-fts5 \
  --enable-json1 \
  --enable-update-limit \
  --enable-rtree \
  --libdir=%{_oc_libdir} --includedir=%{_oc_includedir} --datadir=%{_oc_datadir} --mandir=%{_oc_mandir} --bindir=%{_oc_bindir}
make %{?_smp_mflags} sqlite3.c
%if 0%{?is_opensuse} 
# && (0%{?suse_version} == 1315 || 
sed -i -e 's/^LIBTCL = *$/LIBTCL = -ltcl8.6/' Makefile
%endif
make %{?_smp_mflags}

%ifnarch %{ix86}
# Tests fail due to slight precision variation caused by FPU being 80-bit internally.
# see https://bugs.gentoo.org/628242
%check
# ./testfixture: version conflict for package "Tcl": have 8.5.7, need 8.6
find ext test -name \*.test | xargs grep -l 'package require Tcl 8.6' | xargs rm -f
# Failures on these tests: fts3corrupt4-1.2 fts3corrupt4-1.3 fts3corrupt4-2.3.1 ...
rm -f test/fts3corrupt4.test
%if 0%{?centos_version} < 700
# [  380s] ! e_expr-32.1.8 expected: [real 9223372036000000.0]
# [  380s] ! e_expr-32.1.8 got:      [real 9.223372036e+15]
# [  380s] ! e_expr-32.1.9 expected: [real -9223372036000000.0]
# [  380s] ! e_expr-32.1.9 got:      [real -9.223372036e+15]
rm -f test/e_expr.test
# [  406s] ! func-4.39 expected: [Inf -Inf]
# [  406s] ! func-4.39 got:      [inf -inf]
rm -f test/func.test
# [  690s] # WARNING: This next test takes around 12 seconds
# [  700s] make: *** [tcltest] Segmentation fault
rm -f test/walvfs.test
%endif
%if 0%{?centos_version} >= 700
# [  725s] 1 errors out of 292162 tests on  Linux 64-bit little-endian
# [  725s] !Failures on these tests: like-14.2
rm -f test/like.test
%endif


make %{?_smp_mflags} test
%endif

%install
%make_install
mkdir -p %{buildroot}/%{_oc_mandir}/man1/
install -Dpm 0644 sqlite3.1 %{buildroot}/%{_oc_mandir}/man1/sqlite3.1
gzip %{buildroot}/%{_oc_mandir}/man1/sqlite3.1 || true
# rm -f % {buildroot}/%{_mandir}/man1/*
# toss unpackaged /usr/share/tcl8.5/sqlite3/libtclsqlite3.so */pkgIndex.tcl
rm -rf %{buildroot}/%{_datadir}/tcl*/sqlite3

# tcl bindings are provided by tcl itself
rm -rf %{buildroot}%{_oc_libdir}/tcl/tcl8.?/sqlite3*
find %{buildroot} -type f -name "*.la" -delete -print

%post   -n ocqt5125-libsqlite3-0 -p /sbin/ldconfig
%postun -n ocqt5125-libsqlite3-0 -p /sbin/ldconfig

%files
%{_oc_bindir}/sqlite3
%dir %{_oc_datadir}
%dir %{_oc_mandir}
%dir %{_oc_mandir}/man1
%{_oc_mandir}/man1/sqlite3.1*

%files -n ocqt5125-libsqlite3-0
%{_oc_libdir}/libsqlite3.so.*

%files devel
%{_oc_includedir}/sqlite3.h
%{_oc_includedir}/sqlite3ext.h
%{_oc_libdir}/libsqlite3.so
%{_oc_libdir}/pkgconfig/sqlite3.pc

%files doc
%doc sqlite-doc-%{tarversion}/*

%changelog
openSUSE Build Service is sponsored by