%prep
%setup -q -n percona-server-%{version}-%{percona_rel} %{?with_sphinx:-a100} %{!?with_system_boost:-a101}
+# we want to use old, mysql compatible client library name
+find . -name CMakeLists.txt -exec sed -i -e 's#perconaserverclient#mysqlclient#g' "{}" ";"
+sed -i -e 's#perconaserverclient#mysqlclient#g' libmysql/libmysql.{ver.in,map} scripts/mysql_config.*
+
%patch0 -p1
%if %{with sphinx}
%attr(751,root,root) %dir %{_sysconfdir}/%{name}
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/mysql-client.conf
%{_sysconfdir}/%{name}/my.cnf
-%attr(755,root,root) %{_libdir}/libperconaserverclient.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libperconaserverclient.so.20
-#%attr(755,root,root) %{_libdir}/libperconaserverclient_r.so.*.*.*
-#%attr(755,root,root) %ghost %{_libdir}/libperconaserverclient_r.so.18
+%attr(755,root,root) %{_libdir}/libmysqlclient.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libmysqlclient.so.20
+#%attr(755,root,root) %{_libdir}/libmysqlclient_r.so.*.*.*
+#%attr(755,root,root) %ghost %{_libdir}/libmysqlclient_r.so.18
%if %{with ndb}
%attr(755,root,root) %{_libdir}/libndbclient.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libndbclient.so.3
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/mysql_config
-%attr(755,root,root) %{_libdir}/libperconaserverclient.so
-#%attr(755,root,root) %{_libdir}/libperconaserverclient_r.so
-%{_pkgconfigdir}/perconaserverclient.pc
+%attr(755,root,root) %{_libdir}/libmysqlclient.so
+#%attr(755,root,root) %{_libdir}/libmysqlclient_r.so
+%{_pkgconfigdir}/mysqlclient.pc
%if %{with ndb}
%attr(755,root,root) %{_libdir}/libndbclient.so
%endif
%files static
%defattr(644,root,root,755)
-%{_libdir}/libperconaserverclient.a
-#%{_libdir}/libperconaserverclient_r.a
+%{_libdir}/libmysqlclient.a
+#%{_libdir}/libmysqlclient_r.a
%if %{with ndb}
%{_libdir}/libndbclient.a
%endif