# bcond default logic is nicely backwards... %bcond_without tcl %bcond_with static %bcond_with check %define realver 3290000 %define docver 3290000 %define rpmver 3.29.0 Summary: Library that implements an embeddable SQL database engine Name: sqlite Version: %{rpmver} Release: 1%{?dist} License: Public Domain Group: Applications/Databases URL: http://www.sqlite.org/ Source0: http://www.sqlite.org/sqlite-src-%{realver}.zip Source1: http://www.sqlite.org/sqlite-doc-%{docver}.zip BuildRequires: ncurses-devel readline-devel glibc-devel BuildRequires: autoconf %if %{with tcl} BuildRequires: /usr/bin/tclsh BuildRequires: tcl-devel %{!?tcl_version: %global tcl_version 8.5} %{!?tcl_sitearch: %global tcl_sitearch %{_libdir}/tcl%{tcl_version}} %endif BuildRoot: %{_tmppath}/%{name}-root %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 %package devel Summary: Development tools for the sqlite3 embeddable SQL database engine Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkgconfig %description devel This package contains the header files and development documentation for %{name}. If you like to develop programs using %{name}, you will need to install %{name}-devel. %package doc Summary: Documentation for sqlite Group: Documentation BuildArch: noarch %description doc This package contains most of the static HTML files that comprise the www.sqlite.org website, including all of the SQL Syntax and the C/C++ interface specs and other miscellaneous documentation. %package -n lemon Summary: A parser generator Group: Development/Tools %description -n lemon Lemon is an LALR(1) parser generator for C or C++. It does the same job as bison and yacc. But lemon is not another bison or yacc clone. It uses a different grammar syntax which is designed to reduce the number of coding errors. Lemon also uses a more sophisticated parsing engine that is faster than yacc and bison and which is both reentrant and thread-safe. Furthermore, Lemon implements features that can be used to eliminate resource leaks, making is suitable for use in long-running programs such as graphical user interfaces or embedded controllers. %if %{with tcl} %package tcl Summary: Tcl module for the sqlite3 embeddable SQL database engine Group: Development/Languages Requires: %{name} = %{version}-%{release} Requires: tcl(abi) = %{tcl_version} %description tcl This package contains the tcl modules for %{name}. %endif %prep %setup -q -a1 -n %{name}-src-%{realver} # Remove cgi-script erroneously included in sqlite-doc-3070500 rm -f %{name}-doc-%{realver}/search autoconf # Rerun with new autoconf to add support for aarm64 %build export CFLAGS="$RPM_OPT_FLAGS -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -Wall -fno-strict-aliasing" %configure %{!?with_tcl:--disable-tcl} \ --enable-threadsafe \ --enable-threads-override-locks \ --enable-load-extension \ %{?with_tcl:TCLLIBDIR=%{tcl_sitearch}/sqlite3} # rpath removal sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make DESTDIR=${RPM_BUILD_ROOT} install install -D -m0644 sqlite3.1 $RPM_BUILD_ROOT/%{_mandir}/man1/sqlite3.1 install -D -m0755 lemon $RPM_BUILD_ROOT/%{_bindir}/lemon install -D -m0644 tool/lempar.c $RPM_BUILD_ROOT/%{_datadir}/lemon/lempar.c %if %{with tcl} # fix up permissions to enable dep extraction chmod 0755 ${RPM_BUILD_ROOT}/%{tcl_sitearch}/sqlite3/*.so %endif %if ! %{with static} rm -f $RPM_BUILD_ROOT/%{_libdir}/*.{la,a} %endif %if %{with check} %check # XXX shell tests are broken due to loading system libsqlite3, work around... export LD_LIBRARY_PATH=`pwd`/.libs export MALLOC_CHECK_=3 %ifarch s390 s390x ppc ppc64 %{sparc} %{arm} make test || : %else make test %endif %endif %clean rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-, root, root) %doc README.md %{_bindir}/sqlite3 %{_libdir}/*.so.* %{_mandir}/man?/* %files devel %defattr(-, root, root) %{_includedir}/*.h %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %if %{with static} %{_libdir}/*.a %exclude %{_libdir}/*.la %endif %files doc %defattr(-, root, root) %doc %{name}-doc-%{docver}/* %files -n lemon %defattr(-, root, root) %{_bindir}/lemon %{_datadir}/lemon %if %{with tcl} %files tcl %defattr(-, root, root) %{tcl_sitearch}/sqlite3 %endif %changelog * Tue Jul 16 2019 Martin Juhl 3.29.0-1 - Initial Release