# # Conditional build: %bcond_without mysql # don't build mysql driver %bcond_without pgsql # don't build postgresql driver %bcond_without sqlite # don't build sqlite driver # %define dbiver 0.7.2 Summary: Database Independent Abstraction Layer for C Summary(pl): Warstwa DBI dla C Name: libdbi-drivers Version: 0.7.1 Release: 1 License: LGPL Group: Libraries Source0: http://dl.sourceforge.net/libdbi-drivers/libdbi-drivers-%{version}.tar.gz # Source0-md5: f11020119ceb7a6dee3969cb0589d4bc Patch0: %{name}-opt.patch URL: http://libdbi-drivers.sourceforge.net/ BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: libdbi-devel >= %{dbiver} %{?with_mysql:BuildRequires: mysql-devel} %{?with_pgsql:BuildRequires: postgresql-devel} %{?with_sqlite:BuildRequires: sqlite-devel} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description libdbi implements a database-independent abstraction layer in C, similar to the DBI/DBD layer in Perl. Writing one generic set of code, programmers can leverage the power of multiple databases and multiple simultaneous database connections by using this framework. %description -l pl libdbi jest implementacją w C warstwy abstrakcyjnej niezależnej od bazy danych, podobnej do warstwy DBI/DBD w Perlu. Używając tego środowiska programista może za pomocą jednego, wspólnego kodu odwoływać się do wielu różnych baz danych, także jednocześnie. %package mysql Summary: MySQL plugin for libdbi Summary(pl): Wtyczka MySQL dla libdbi Group: Libraries Requires: libdbi >= %{dbiver} Provides: libdbi-dbd = %{version}-%{release} Obsoletes: libdbi-dbd-mysql %description mysql This plugin provides connectivity to MySQL database servers through the libdbi database independent abstraction layer. Switching a program's plugin does not require recompilation or rewriting source code. %description mysql -l pl Ta wtyczka daje możliwość łączenia się z serwerami MySQL poprzez bibliotekę libdbi. Zmiana używanej wtyczki nie wymaga rekompilacji ani zmiany źródeł programu. %package pgsql Summary: PostgreSQL plugin for libdbi Summary(pl): Wtyczka PostgreSQL dla libdbi Group: Libraries Requires: libdbi >= %{dbiver} Provides: libdbi-dbd = %{version}-%{release} Obsoletes: libdbi-dbd-pgsql %description pgsql This plugin provides connectivity to PostgreSQL database servers through the libdbi database independent abstraction layer. Switching a program's plugin does not require recompilation or rewriting source code. %description pgsql -l pl Ta wtyczka daje możliwość łączenia się z serwerami PostgreSQL poprzez bibliotekę libdbi. Zmiana używanej wtyczki nie wymaga rekompilacji ani zmiany źródeł programu. %package sqlite Summary: SQLite plugin for libdbi Summary(pl): Wtyczka SQLite dla libdbi Group: Libraries Requires: libdbi >= %{dbiver} Provides: libdbi-dbd = %{version}-%{release} %description sqlite This plugin provides connectivity to SQLite engine through the libdbi database independent abstraction layer. Switching a program's plugin does not require recompilation or rewriting source code. %description sqlite -l pl Ta wtyczka daje możliwość łączenia się z silnikiem SQLite poprzez bibliotekę libdbi. Zmiana używanej wtyczki nie wymaga rekompilacji ani zmiany źródeł programu. %prep %setup -q %patch0 -p1 %build %{__libtoolize} %{__aclocal} %{__automake} %{__autoconf} %configure \ --disable-static \ --with-dbi-incdir=%{_includedir} \ %{?with_sqlite:--with-sqlite} \ %{?with_mysql:--with-mysql} \ %{?with_pgsql:--with-pgsql} %{__make} %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_libdir}/dbd %{__make} install \ DESTDIR=$RPM_BUILD_ROOT rm -f $RPM_BUILD_ROOT%{_libdir}/dbd/lib*.la %clean rm -rf $RPM_BUILD_ROOT %if %{with mysql} %files mysql %defattr(644,root,root,755) %doc drivers/mysql/*.pdf drivers/mysql/dbd_mysql %attr(755,root,root) %{_libdir}/dbd/libmysql.so %endif %if %{with pgsql} %files pgsql %defattr(644,root,root,755) %doc drivers/pgsql/*.pdf drivers/pgsql/dbd_pgsql %attr(755,root,root) %{_libdir}/dbd/libpgsql.so %endif %if %{with sqlite} %files sqlite %defattr(644,root,root,755) %doc drivers/sqlite/*.pdf drivers/sqlite/dbd_sqlite %{_libdir}/dbd/libsqlite.so %endif