--- /dev/null
+--- php-pecl-mdbtools-1.0.0/mdbtools-1.0.0/config.m4~ 2007-11-27 16:13:18.000000000 +0100
++++ php-pecl-mdbtools-1.0.0/mdbtools-1.0.0/config.m4 2009-01-11 15:16:43.231780402 +0100
+@@ -26,24 +26,18 @@
+ LDFLAGS="$CFLAGS $GLIB_LIBS"
+
+
+-
+- if test -r "$PHP_MDBTOOLS/include/mdbtools.h"; then
+- PHP_MDBTOOLS_DIR="$PHP_MDBTOOLS"
+- else
+- AC_MSG_CHECKING(for mdbtools in default path)
+- for i in /usr /usr/local; do
+- if test -r "$i/include/mdbtools.h"; then
+- PHP_MDBTOOLS_DIR=$i
+- AC_MSG_RESULT(found in $i)
+- break
+- fi
+- done
+- if test "x" = "x$PHP_MDBTOOLS_DIR"; then
+- AC_MSG_ERROR(not found)
++ AC_MSG_CHECKING(for mdbtools header files)
++ for dir in $PHP_MDBTOOLS /usr/include /usr/include/mdb /usr/local/include /usr/local/include/mdb; do
++ if test -r "$dir/mdbtools.h"; then
++ AC_MSG_RESULT(found in $dir)
++ PHP_MDBTOOLS_DIR=$dir
+ fi
+- fi
++ done
++ if test "x" = "x$PHP_MDBTOOLS_DIR"; then
++ AC_MSG_ERROR(not found)
++ fi
+
+- PHP_ADD_INCLUDE($PHP_MDBTOOLS_DIR/include)
++ PHP_ADD_INCLUDE($PHP_MDBTOOLS_DIR)
+
+ export OLD_CPPFLAGS="$CPPFLAGS"
+ export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_MDBTOOLS"
+@@ -76,7 +76,7 @@
+ PHP_NEW_EXTENSION(mdbtools, mdbtools.c , $ext_shared)
+ AC_MSG_CHECKING([whether mdb_open() takes one or two parameters])
+ OLD_CFLAGS=$CFLAGS
+- CFLAGS="$CFLAGS -I$PHP_MDBTOOLS_DIR/include"
++ CFLAGS="$CFLAGS -I$PHP_MDBTOOLS_DIR"
+ AC_TRY_COMPILE([#include <mdbtools.h>], [mdb_open("foo", MDB_NOFLAGS);], RESULT="two", RESULT="one")
+ if test "$RESULT" = "two"
+ then
+@@ -87,7 +87,7 @@
+
+ AC_MSG_CHECKING([whether mdb_bind_column() takes three or four parameters])
+ OLD_CFLAGS=$CFLAGS
+- CFLAGS="$CFLAGS -I$PHP_MDBTOOLS_DIR/include"
++ CFLAGS="$CFLAGS -I$PHP_MDBTOOLS_DIR"
+ AC_TRY_COMPILE([#include <mdbtools.h>], [mdb_bind_column(NULL, 1, NULL, NULL);], RESULT="four", RESULT="three")
+ if test "$RESULT" = "four"
+ then
--- /dev/null
+%define _modname mdbtools
+%define _status stable
+Summary: MDB data file access library
+Summary(pl.UTF-8): biblioteka dostępu do plików MDB
+Name: php-pecl-%{_modname}
+Version: 1.0.0
+Release: 1
+License: LGPL
+Group: Development/Languages/PHP
+Source0: http://pecl.php.net/get/%{_modname}-%{version}.tgz
+# Source0-md5: 758f844257c50dbd07c2b9a67a83954b
+Patch0: %{name}-paths.patch
+URL: http://pecl.php.net/package/mdbtools/
+BuildRequires: mdbtools-devel
+BuildRequires: php-devel >= 3:5.0.0
+BuildRequires: rpmbuild(macros) >= 1.344
+%{?requires_php_extension}
+Requires: php-common >= 4:5.0.4
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+mdbtools provides read access to MDB data files as used by Microsoft
+Access and its underlying JetEngine.
+
+In PECL status of this extension is: %{_status}.
+
+%description -l pl.UTF-8
+mdbtools udostępnia możliwość odczytu danych zapisanych w plikach MDB,
+z których korzysta baza danych Microsoft Access oraz zwązany z tą
+aplikacją silnik JetEngine.
+
+To rozszerzenie ma w PECL status: %{_status}.
+
+%prep
+%setup -q -c
+%patch0 -p1
+
+%build
+cd %{_modname}-%{version}
+phpize
+%configure
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
+
+%{__make} install \
+ -C %{_modname}-%{version} \
+ INSTALL_ROOT=$RPM_BUILD_ROOT \
+ EXTENSION_DIR=%{php_extensiondir}
+
+cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{_modname}.ini
+; Enable %{_modname} extension module
+extension=%{_modname}.so
+EOF
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%php_webserver_restart
+
+%postun
+if [ "$1" = 0 ]; then
+ %php_webserver_restart
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc %{_modname}-%{version}/{CREDITS,EXPERIMENTAL}
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{_modname}.ini
+%attr(755,root,root) %{php_extensiondir}/%{_modname}.so