LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File mysql-connector-cpp.spec of Package mysql-connector-cpp (Project server:database)

#
# spec file for package mysql-connector-cpp
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           mysql-connector-cpp
Version:        1.1.2
Release:        0
Summary:        MySQL Connector/C++: Standardized database driver for C++ development
License:        SUSE-GPL-2.0-with-FLOSS-exception
Group:          Development/Libraries/C and C++
Url:            http://dev.mysql.com/downloads/connector/
#               http://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++-%%{version}.tar.gz
Source:         mysql-connector-c++-%{version}.tar.bz2
# PATCH-SUSE-INTEGRATION - mysql-connector-cpp-1.0.4-beta-cmake-paths-fix.patch [] mhrusecky@suse.cz -- adjust some default paths
Patch0:         mysql-connector-cpp-1.1.0-cmake-paths-fix.patch
# PATCH-UPSTREAM-FIX - mysql-connector-cpp-1.0.4-beta-gcc44.patch [ upstream#44931 ] mhrusecky@suse.cz -- adding missing includes
# http://bugs.mysql.com/44931
Patch1:         mysql-connector-cpp-1.1.0-gcc44.patch
# PATCH-FEATURE-OPENSUSE - mysql-connector-cpp-1.1.0-disable_tests_and_examples.patch adam@mizerski.pl -- disable building tests and examples
Patch2:         mysql-connector-cpp-1.1.0-disable_tests_and_examples.patch
BuildRequires:  boost-devel >= 1.34.0
BuildRequires:  cmake >= 2.6.2
BuildRequires:  gcc-c++
BuildRequires:  libmysqlclient-devel
Obsoletes:      mysql-connector-c++ < %{version}
Provides:       mysql-connector-c++ = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
MySQL Connector/C++ is a MySQL database connector for C++ development. The
MySQL driver for C++ can be used to connect to MySQL from C++ applications. The
driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0.

The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its
full functionality is not available when connecting to MySQL 5.0. You cannot
connect to MySQL 4.1 or earlier.

Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library)
offers the following advantages for C++ users:

    * Convenience of pure C++ - no C function calls
    * Support of a well designed API - JDBC 4.0
    * Support of a commonly known and well documented API - JDBC 4.0
    * Support of the object oriented programming paradigma
    * Shorter development times

%package -n libmysqlcppconn-devel
Summary:        Development files for MySQL Connector/C++
Group:          Development/Libraries/C and C++
Requires:       libmysqlcppconn6 = %{version}
Obsoletes:      mysql-connector-c++-devel < %{version}
Provides:       mysql-connector-c++-devel = %{version}

%description -n libmysqlcppconn-devel
MySQL Connector/C++ is a MySQL database connector for C++ development. The
MySQL driver for C++ can be used to connect to MySQL from C++ applications. The
driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0.

The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its
full functionality is not available when connecting to MySQL 5.0. You cannot
connect to MySQL 4.1 or earlier.

Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library)
offers the following advantages for C++ users:

    * Convenience of pure C++ - no C function calls
    * Support of a well designed API - JDBC 4.0
    * Support of a commonly known and well documented API - JDBC 4.0
    * Support of the object oriented programming paradigma
    * Shorter development times

%package -n libmysqlcppconn6
Summary:        MySQL Connector/C++: Standardized database driver for C++ development
Group:          Development/Libraries/C and C++

%description -n libmysqlcppconn6
MySQL Connector/C++ is a MySQL database connector for C++ development. The
MySQL driver for C++ can be used to connect to MySQL from C++ applications. The
driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0.

The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its
full functionality is not available when connecting to MySQL 5.0. You cannot
connect to MySQL 4.1 or earlier.

Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library)
offers the following advantages for C++ users:

    * Convenience of pure C++ - no C function calls
    * Support of a well designed API - JDBC 4.0
    * Support of a commonly known and well documented API - JDBC 4.0
    * Support of the object oriented programming paradigma
    * Shorter development times

%prep
%setup -q -n mysql-connector-c++-%{version}
%patch0 -p1
%patch1
%patch2 -p1

%build
export CXXFLAGS="%optflags"
cmake \
	-DCMAKE_C_FLAGS:STRING="%{optflags}" \
	-DCMAKE_CXX_FLAGS:STRING="%{optflags}" \
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
	-DCMAKE_SKIP_RPATH=ON \
	-DCMAKE_INSTALL_PREFIX=%{_prefix} \
	-DBUILD_SHARED_LIBS=ON \
%if %{_lib} == lib64
	-DLIB_SUFFIX=64 \
%endif
	-DMYSQLCPPCONN_GCOV_ENABLE=ON \
	-DMYSQLCPPCONN_ICU_ENABLE=OFF \
	-DMYSQLCPPCONN_BUILD_EXAMPLES=OFF \
	-DCMAKE_INSTALL_LIB_DIR=%{_lib} \
	-DMYSQLCLIENT_STATIC_BINDING=0 \
    .
make %{?_smp_mflags} VERBOSE=1
chmod -x examples/*

%install
make install DESTDIR="%{buildroot}"
rm -f %{buildroot}%{_libdir}/libmysqlcppconn-static.a
rm -f %{buildroot}%{_prefix}/[A-Z]*

%post -n libmysqlcppconn6 -p /sbin/ldconfig

%postun -n libmysqlcppconn6 -p /sbin/ldconfig

%files -n libmysqlcppconn-devel
%defattr(-,root,root)
%doc README ANNOUNCEMENT COPYING CHANGES examples
%{_includedir}/*
%{_libdir}/*.so

%files -n libmysqlcppconn6
%defattr(-,root,root)
%{_libdir}/*.so.*

%changelog