Blob Blame Raw
Summary: The MariaDB Native Client library (C driver)
Name: mariadb-connector-c
Version: 2.0.0
Release: 2%{?dist}

License: LGPLv2+
Group: Applications/Databases
Source: https://downloads.mariadb.org/f/client-native-2.0.0/src/mariadb_client-%{version}-src.tar.gz
Url: https://mariadb.org/en/
BuildRequires: zlib-devel cmake

#Patch0: fixes libdir paths on 64 bit systems
Patch0: mariadb-connector-c-2.0.0-libdirectories.patch

%description
The MariaDB Native Client library (C driver) is used to connect applications
developed in C/C++ to MariaDB and MySQL databases.

%package devel
Summary: Development files for mariadb-connector-c.
Group: Development/Libraries 
Requires: mariadb-connector-c = %{version}-%{release}
BuildRequires: xmlto

%description devel
Development files for mariadb-connector-c.

%prep
%setup -q -n mariadb_client-%{version}-src
%patch0 -p2 -b .libdirectories

%build
%cmake . -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DWITH_EXTERNAL_ZLIB=ON 

make %{?_smp_mflags}

pushd docs
%cmake .
make %{?_smp_mflags}
sed -ri "s/#idm[0-9]+//g" html/*
popd

%install
make install DESTDIR=$RPM_BUILD_ROOT

rm /$RPM_BUILD_ROOT%{_libdir}/mariadb/libmariadbclient.a 
rm /$RPM_BUILD_ROOT%{_libdir}/mariadb/libmysqlclient.a

rm /$RPM_BUILD_ROOT%{_includedir}/mariadb/Makefile.am 
rm -r /$RPM_BUILD_ROOT%{_includedir}/mariadb/CMakeFiles 
rm /$RPM_BUILD_ROOT%{_includedir}/mariadb/mysql_version.h.in 
rm /$RPM_BUILD_ROOT%{_includedir}/mariadb/Makefile 
rm /$RPM_BUILD_ROOT%{_includedir}/mariadb/CMakeLists.txt 
rm /$RPM_BUILD_ROOT%{_includedir}/mariadb/my_config.h.in 
rm /$RPM_BUILD_ROOT%{_includedir}/mariadb/cmake_install.cmake

%files
%defattr(-,root,root,-)
%{_libdir}/mariadb/libmariadb.so.2
%doc README COPYING.LIB

%files  devel
%defattr(-,root,root,-)
%{_bindir}/*
%{_libdir}/mariadb/libmariadb.so
%{_libdir}/mariadb/libmysqlclient_r.so
%{_libdir}/mariadb/libmysqlclient.so
%{_libdir}/mariadb/libmysql.so

%{_includedir}/mariadb
%doc docs/html

%changelog
* Wed Sep 24 2014 Matej Mužila <mmuzila@redhat.com> - 2.0.0-2
- Fixed html IDs in documentation

* Tue Aug 26 2014 Matej Mužila <mmuzila@redhat.com> - 2.0.0-2
- Initial version for 2.0.0