1 |
%define major 7 |
2 |
%define libname %mklibname mysqlcppconn %{major} |
3 |
%define develname %mklibname mysqlcppconn -d |
4 |
|
5 |
Summary: A MySQL database connector for C++ |
6 |
Name: mysql-connector-c++ |
7 |
Version: 1.1.9 |
8 |
Release: %mkrel 3 |
9 |
Group: System/Libraries |
10 |
License: GPLv2 |
11 |
URL: http://dev.mysql.com/downloads/connector/cpp/ |
12 |
Source0: http://cdn.mysql.com/Downloads/Connector-C++/%{name}-%{version}.tar.gz |
13 |
## patches from arch-linux |
14 |
Patch0: mysql_cxx_linkage.patch |
15 |
Patch1: mariadb_api.patch |
16 |
## from opensuse |
17 |
Patch10: mysql-connector-cpp-mariadb.patch |
18 |
Patch11: mysql-connector-cpp-1.1.9-libmysql_dynamic_proxy_typos.patch |
19 |
BuildRequires: cmake |
20 |
BuildRequires: mysql-devel |
21 |
BuildRequires: boost-devel |
22 |
|
23 |
%description |
24 |
MySQL Connector/C++ is a MySQL database connector for C++ development. The |
25 |
MySQL driver for C++ can be used to connect to MySQL from C++ applications. The |
26 |
driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. |
27 |
|
28 |
The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its |
29 |
full functionality is not available when connecting to MySQL 5.0. You cannot |
30 |
connect to MySQL 4.1 or earlier. |
31 |
|
32 |
Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) |
33 |
offers the following advantages for C++ users: |
34 |
|
35 |
* Convenience of pure C++ - no C function calls |
36 |
* Support of a well designed API - JDBC 4.0 |
37 |
* Support of a commonly known and well documented API - JDBC 4.0 |
38 |
* Support of the object oriented programming paradigma |
39 |
* Shorter development times |
40 |
|
41 |
%package -n %{libname} |
42 |
Summary: The shared mysql-connector-cpp library |
43 |
Group: System/Libraries |
44 |
Provides: %{name} = %{version}-%{release} |
45 |
|
46 |
%description -n %{libname} |
47 |
MySQL Connector/C++ is a MySQL database connector for C++ development. The |
48 |
MySQL driver for C++ can be used to connect to MySQL from C++ applications. The |
49 |
driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. |
50 |
|
51 |
The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its |
52 |
full functionality is not available when connecting to MySQL 5.0. You cannot |
53 |
connect to MySQL 4.1 or earlier. |
54 |
|
55 |
Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) |
56 |
offers the following advantages for C++ users: |
57 |
|
58 |
* Convenience of pure C++ - no C function calls |
59 |
* Support of a well designed API - JDBC 4.0 |
60 |
* Support of a commonly known and well documented API - JDBC 4.0 |
61 |
* Support of the object oriented programming paradigma |
62 |
* Shorter development times |
63 |
|
64 |
%package -n %{develname} |
65 |
Summary: Development library and header files for development with mysql-connector-cpp |
66 |
Group: Development/C++ |
67 |
Requires: %{libname} = %{version} |
68 |
Provides: %{name}-devel = %{version}-%{release} |
69 |
|
70 |
%description -n %{develname} |
71 |
MySQL Connector/C++ is a MySQL database connector for C++ development. The |
72 |
MySQL driver for C++ can be used to connect to MySQL from C++ applications. The |
73 |
driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. |
74 |
|
75 |
The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its |
76 |
full functionality is not available when connecting to MySQL 5.0. You cannot |
77 |
connect to MySQL 4.1 or earlier. |
78 |
|
79 |
Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) |
80 |
offers the following advantages for C++ users: |
81 |
|
82 |
* Convenience of pure C++ - no C function calls |
83 |
* Support of a well designed API - JDBC 4.0 |
84 |
* Support of a commonly known and well documented API - JDBC 4.0 |
85 |
* Support of the object oriented programming paradigma |
86 |
* Shorter development times |
87 |
|
88 |
%prep |
89 |
%setup -q |
90 |
%autopatch -p1 |
91 |
|
92 |
%{__chmod} -x examples/*.cpp examples/*.txt |
93 |
|
94 |
# Save examples to keep directory clean (for doc) |
95 |
%{__mkdir} _doc_examples |
96 |
%{__cp} -pr examples _doc_examples |
97 |
|
98 |
%build |
99 |
%{cmake} \ |
100 |
-DMYSQL_INCLUDE_DIR=%{_includedir}/mysql \ |
101 |
-DCMAKE_INSTALL_PREFIX=/usr \ |
102 |
-DCMAKE_BUILD_TYPE=Release \ |
103 |
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \ |
104 |
-DMYSQLCPPCONN_BUILD_EXAMPLES=OFF \ |
105 |
-DMYSQL_LIB=%{_libdir}/libmysqlclient.so |
106 |
%{make} |
107 |
|
108 |
%install |
109 |
cp build/cppconn/config.h cppconn/config.h |
110 |
|
111 |
%makeinstall_std -C build |
112 |
rm -fr %{buildroot}%_prefix/COPYING |
113 |
rm -fr %{buildroot}%_prefix/INSTALL |
114 |
rm -fr %{buildroot}%_prefix/README |
115 |
rm -fr %{buildroot}%_prefix/ANNOUNCEMENT |
116 |
rm -fr %{buildroot}%_prefix/Licenses_for_Third-Party_Components.txt |
117 |
rm -f %{buildroot}%{_libdir}/libmysqlcppconn-static.a |
118 |
|
119 |
%files -n %{libname} |
120 |
%{_libdir}/*.so.%{major}{,.*} |
121 |
|
122 |
%files -n %{develname} |
123 |
%doc README COPYING examples |
124 |
%dir %{_includedir}/cppconn |
125 |
%{_includedir}/*.h |
126 |
%{_includedir}/cppconn/*.h |
127 |
%{_libdir}/*.so |
128 |
|