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