2 |
%define libname %mklibname mysqlcppconn %{major} |
%define libname %mklibname mysqlcppconn %{major} |
3 |
%define develname %mklibname mysqlcppconn -d |
%define develname %mklibname mysqlcppconn -d |
4 |
|
|
|
%global bzr 916 |
|
|
|
|
5 |
Summary: A MySQL database connector for C++ |
Summary: A MySQL database connector for C++ |
6 |
Name: mysql-connector-c++ |
Name: mysql-connector-c++ |
7 |
Version: 1.1.0 |
Version: 1.1.1 |
|
%if 0%{?bzr} |
|
|
Release: %mkrel 0.7.bzr%{?bzr} |
|
|
%else |
|
8 |
Release: %mkrel 1 |
Release: %mkrel 1 |
|
%endif |
|
9 |
Group: System/Libraries |
Group: System/Libraries |
10 |
License: GPL |
License: GPL |
11 |
URL: http://dev.mysql.com/downloads/connector/cpp/ |
URL: http://dev.mysql.com/downloads/connector/cpp/ |
12 |
%if 0%{?bzr} |
Source0: http://cdn.mysql.com/Downloads/Connector-C++/%{name}-%{version}.tar.gz |
|
# bzr branch -r 916 lp:~mysql/mysql-connector-cpp/trunk mysql-connector-c++-1.1.0 |
|
|
# less mysql-connector-c++-1.1.0/driver/mysql_metadata.cpp |
|
|
# check getDriverMajorVersion / getDriverMinorVersion / getDriverPatchVersion |
|
|
# tar czf mysql-connector-c++-bzr895.tgz --exclude .bzr mysql-connector-c++-1.1.0 |
|
|
# rm -rf mysql-connector-c++-1.1.0 |
|
|
Source0: %{name}-bzr%{bzr}.tgz |
|
|
%else |
|
|
# Upstream has a mirror redirector for downloads, so the URL is hard to |
|
|
# represent statically. You can get the tarball by following a link from |
|
|
# http://dev.mysql.com/downloads/connector/cpp |
|
|
Source0: http://mirrors.dotsrc.org/mysql/Downloads/Connector-C++/%{name}-%{version}.tar.gz |
|
|
%endif |
|
13 |
BuildRequires: cmake |
BuildRequires: cmake |
14 |
BuildRequires: mysql-devel |
BuildRequires: mysql-devel |
15 |
BuildRequires: boost-devel |
BuildRequires: boost-devel |
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
|
16 |
|
|
17 |
%description |
%description |
18 |
Connector/C++ is a tool that enables easy deployment and management of MySQL |
Connector/C++ is a tool that enables easy deployment and management of MySQL |
28 |
|
|
29 |
This package provides the shared mysql-connector-cpp library. |
This package provides the shared mysql-connector-cpp library. |
30 |
|
|
|
|
|
31 |
%package -n %{develname} |
%package -n %{develname} |
32 |
Summary: Development library and header files for development with mysql-connector-cpp |
Summary: Development library and header files for development with mysql-connector-cpp |
33 |
Group: Development/C++ |
Group: Development/C++ |
43 |
|
|
44 |
%prep |
%prep |
45 |
%setup -q |
%setup -q |
|
|
|
46 |
%{__sed} -i -e 's/lib$/%{_lib}/' driver/CMakeLists.txt |
%{__sed} -i -e 's/lib$/%{_lib}/' driver/CMakeLists.txt |
47 |
%{__chmod} -x examples/*.cpp examples/*.txt |
%{__chmod} -x examples/*.cpp examples/*.txt |
48 |
|
|
50 |
%{__mkdir} _doc_examples |
%{__mkdir} _doc_examples |
51 |
%{__cp} -pr examples _doc_examples |
%{__cp} -pr examples _doc_examples |
52 |
|
|
|
|
|
53 |
%build |
%build |
54 |
%{cmake} -DMYSQLCPPCONN_BUILD_EXAMPLES:BOOL=0 |
%{cmake} -DMYSQLCPPCONN_BUILD_EXAMPLES:BOOL=OFF |
55 |
|
%{make} |
|
%{__make} |
|
|
|
|
56 |
|
|
57 |
%install |
%install |
|
%{__rm} -rf %{buildroot} |
|
58 |
cp build/cppconn/config.h cppconn/config.h |
cp build/cppconn/config.h cppconn/config.h |
59 |
%{__make} install DESTDIR=%{buildroot} -C build |
%makeinstall_std -C build |
60 |
rm -fr %{buildroot}%_prefix/COPYING |
rm -fr %{buildroot}%_prefix/COPYING |
61 |
rm -fr %{buildroot}%_prefix/INSTALL |
rm -fr %{buildroot}%_prefix/INSTALL |
62 |
rm -fr %{buildroot}%_prefix/README |
rm -fr %{buildroot}%_prefix/README |
63 |
|
|
|
%check |
|
|
# for documentation purpose only (A MySQL server is required) |
|
|
# cd test |
|
|
# ./static_test tcp://127.0.0.1 user password test_database |
|
|
# Should output : Loops= 2 Tests= 592 Failures= 0 |
|
|
# ./driver_test tcp://127.0.0.1 user password test_database |
|
|
# Should output : Loops= 2 Tests= 592 Failures= 0 |
|
|
|
|
|
|
|
|
%clean |
|
|
rm -rf %{buildroot} |
|
|
|
|
64 |
%files -n %{libname} |
%files -n %{libname} |
65 |
%defattr(-,root,root) |
%{_libdir}/*.so.%{major}* |
|
%attr(0755,root,root) %{_libdir}/*.so.%{major}* |
|
66 |
|
|
67 |
%files -n %{develname} |
%files -n %{develname} |
|
%defattr(-,root,root) |
|
68 |
%dir %{_includedir}/cppconn |
%dir %{_includedir}/cppconn |
69 |
%attr(0644,root,root) %{_includedir}/*.h |
%{_includedir}/*.h |
70 |
%attr(0644,root,root) %{_includedir}/cppconn/*.h |
%{_includedir}/cppconn/*.h |
71 |
%attr(0644,root,root) %{_libdir}/*.so |
%{_libdir}/*.so |
|
%exclude %{_libdir}/libmysqlcppconn-static.a |
|
|
|
|
|
|
|