File dba-sqlite-383.spec of Package dba-sqlite-383

%define real_name       sqlite
%define version         3.8.3
%define vers            383
%define tarversion	3080300
%define prefix          /DBA/%{real_name}/%{version}

Name:           dba-%{real_name}-%{vers}
Summary:        Embeddable SQL Database Engine version 3.8.3
Version:        %{version}
Release:        1
License:        MIT
Group:          Productivity/Databases/Servers
Url:            http://www.sqlite.org/
Source0:        http://www.sqlite.org/2014/sqlite-autoconf-%tarversion.tar.gz
Source1:        baselibs.conf
Source2:	filter-provides-sqlite.sh
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%if 0%{?suse_version} >= 1100
BuildRequires:          -post-build-checks
%endif

%define _use_internal_dependency_generator 0
%define __find_provides %{SOURCE2}

BuildRequires:  pkg-config glibc-devel
BuildRequires:  readline-devel


%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.


%prep
%setup -q -n %{real_name}-autoconf-%{tarversion}

%{__chmod} +x %{SOURCE2}


%build
export CFLAGS="%optflags -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS4"

./configure \
  --prefix=%{prefix} \
  --enable-shared --disable-static --with-pic --disable-rpath

%{__make} %{?_smp_mflags}



%install
# prevent rpath problem on suse
export NO_BRP_CHECK_RPATH=true

%{__make} install DESTDIR=%{buildroot}

find %{buildroot}%{prefix} -name "*.a" -o -name "*.la" |xargs -i rm -vf {}


%post
# add pc file to pkgconfig directory
if [ -d %{_libdir}/pkgconfig ]; then
  cd %{_libdir}/pkgconfig
  if [ -e sqlite3.pc ]; then
    %{__rm} -f sqlite3.pc
  fi
  %{__ln_s} -f %{prefix}/lib/pkgconfig/sqlite3.pc .
fi
cd %{prefix}/lib


%clean
%{__rm} -rf %{buildroot}


%files
%defattr(-,root,root)
%dir %{prefix}
%{prefix}/bin
%{prefix}/include
%{prefix}/lib
%{prefix}/share


%changelog
* Wed Dec  3 2014 Holger Manthey <holger.manthey@bertelsmann.de>
- initial package
openSUSE Build Service is sponsored by