%define __libtoolize true

Summary: ODBC driver for MySQL
Name: MyODBC
Version: 3.51.11
Release: 1%{?_dist_release}
URL: http://www.mysql.com/downloads/api-myodbc.html
Source: http://www.mysql.com/Downloads/MyODBC/MyODBC-%{version}.tar.gz
License: Public Domain
Group: System Environment/Libraries
Requires: unixODBC
BuildRequires: MySQL-devel unixODBC-devel XOrg-devel qt-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description
An ODBC driver for MySQL, for use with unixODBC.

%prep
%setup -q

%build
%configure \
    --with-unixODBC=%{_prefix} \
    --with-odbc-ini=/etc/odbc.ini \
    --with-mysql-dirs=%{_libdir}/mysql \
    --with-mysql-includes=%{_includedir}/mysql \
    --with-ldflags=-L/usr/X11R6/%{_lib}
make

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%makeinstall

rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING ChangeLog README README.unix
%{_libdir}/lib*so

%changelog
* Sun Sep 14 2008 Shu KONNO <owa@bg.wakwak.com> 3.51.11-1vl5
- applied new versioning policy, spec in utf-8

* Thu Dec 20 2007 Shu KONNO <owa@bg.wakwak.com> 3.51.11-0vl4
- updated lib to %%{_lib} in %%configure

* Sun May 27 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.51.11-0vl3
- rebuilt with new toolchain

* Mon Oct 30 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.51.11-0vl2
- rebuilt with MySQL 5.0.27
- added %post and %postun section

* Sat Sep 10 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.51.11-0vl1
- updated to 3.51.11

* Sat Feb 23 2002 Satoshi MACHINO <machino@vinelinux.org> 2.50.39-0vl1
- first build on VineLinux
