LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File yada.spec of Package yada (Project home:crt0solutions:extras)

## Conditional build options.
%bcond_without sqlite3
%bcond_without mysql
%bcond_with pgsql
%bcond_with oracle

################################################################################
################################################################################

Summary: Yet Another Database Abstraction
Name: yada
Version: 1.0.0
Release: 0
License: GPL
URL: http://oss.devit.com/yada/
Group: Development/Libraries
Source: http://oss.devit.com/yada/yada-%{version}.tar.bz2
Patch100: yada-64bit-fix.diff
Prereq: /sbin/install-info grep
Requires: libtool-ltdl
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: doxygen, texinfo
BuildRequires: autoconf automake libtool libtool-ltdl libtool-ltdl-devel

%if %{with sqlite3}
BuildRequires: sqlite-devel 
%endif
%if %{with mysql}
BuildRequires: mysql-devel
%endif
%if %{with oracle}
BuildRequires: oracle-instantclient-devel >= 10.2.0.3 
%endif
%if %{with pgsql}
BuildRequires: postgresql-devel 
%endif

################################################################################

%description
Yada is a C library that abstracts SQL databases aiming at
allowing transparent use of multiple databases. The goal in mind
is to make a common interface to multiple databases, thus
stopping the need for application developers to write different
modules for each SQL backend they want to support.

################################################################################

%package devel
Summary: Development files for yada
Group: Development/Libraries
%description devel
Development headers, man pages and a query compiler for yada.

%if %{with mysql}
%package mysql
Summary: MySQL driver for yada
Group: Development/Libraries
%description mysql
MySQL driver for yada, Yet Another Databse Abstraction.
%endif

%if %{with oracle}
%package oracle
Summary: Oracle driver for yada
Group: Development/Libraries
%description oracle
MySQL driver for yada, Yet Another Databse Abstraction.
%endif

%if %{with pgsql}
%package pgsql
Summary: PostgreSQL driver for yada
Group: Development/Libraries
%description pgsql
PostgreSQL driver for yada, Yet Another Databse Abstraction.
%endif

%if %{with sqlite3}
%package sqlite
Summary: SQLite driver for yada
Group: Development/Libraries
%description sqlite
SQLite driver for yada, Yet Another Databse Abstraction.
%endif

################################################################################

%prep
%setup -q
%patch100 -p1 -b .64bit_fix

################################################################################

%build
rm -rf ./autom4te.cache
rm -rf ./.deps
rm -f ./config.status
rm -f ./config.cache
#./autogen.sh
#autoreconf --force --install --symlink
autoreconf -if

%if %{with mysql}
MYSQLLIBDIR=--with-mysql-libdir=%{_libdir}
%endif
%if %{with sqlite3}
SQLITELIBDIR=--with-sqlite3-libdir=%{_libdir}
%endif

%configure \
	%{?_with_oracle} %{?_with_mysql} %{?_with_pgsql} %{?_with_sqlite3} \
	$MYSQLLIBDIR $SQLITELIBDIR \
;
  
make

################################################################################

%install
rm -rf "$RPM_BUILD_ROOT"
make install \
  DESTDIR="$RPM_BUILD_ROOT"

################################################################################

%clean
rm -rf $RPM_BUILD_ROOT

################################################################################

%files
%defattr(-,root,root)
%doc COPYING README
%{_libdir}/libyada.*

%files devel
%doc docs/yada.html
%{_bindir}/*
%{_mandir}/
%{_includedir}/yada.h

%if %{with mysql}
%files mysql
%{_libdir}/libyada_mysql*
%endif

%if %{with oracle}
%files oracle
%{_libdir}/libyada_oracle*
%endif

%if %{with pgsql}
%files pgsql
%{_libdir}/libyada_pgsql*
%endif

%if %{with sqlite3}
%files sqlite
%{_libdir}/libyada_sqlite*
%endif

################################################################################

%changelog
* Fri Feb 17 2012 Pablo Ruiz GarcĂ­a <pruiz@crt0.net> - 1.0.0
- Adapted to v1.0.0
- Added --with/out options for db support.
* Fri May 11 2007 Matt Griswold <matt@devIT.com> - 0.9.3
- remove oracle configure lines
* Tue May  8 2007 Matt Griswold <matt@devIT.com> - 0.9.3
- remove patch
- make source use %version
* Fri Feb  5 2007 Mike Pomraning <mike.pomraning@tdstelecom.com> - 0.9.3
- first packaging

################################################################################
################################################################################