commit a997ec50dbdb9289b5c97b0149852a5430fe161a Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:04:19 2019 -0400 Package init diff --git a/client.cnf b/client.cnf new file mode 100644 index 0000000..9028505 --- /dev/null +++ b/client.cnf @@ -0,0 +1,13 @@ +# +# These two groups are read by the client library +# Use it for options that affect all clients, but not the server +# + + +[client] + +# This group is not read by mysql client library, +# If you use the same .cnf file for MySQL and MariaDB, +# use it for MariaDB-only client options +[client-mariadb] + diff --git a/mariadb-connector-c-3.0.6-src.tar.gz b/mariadb-connector-c-3.0.6-src.tar.gz new file mode 100644 index 0000000..17d7409 Binary files /dev/null and b/mariadb-connector-c-3.0.6-src.tar.gz differ diff --git a/mariadb-connector-c.spec b/mariadb-connector-c.spec new file mode 100644 index 0000000..e3a4c75 --- /dev/null +++ b/mariadb-connector-c.spec @@ -0,0 +1,102 @@ +Name: mariadb-connector-c +Version: 3.0.6 +Release: 3 +Summary: MariaDB connector library in C +License: LGPLv2+ +Url: https://github.com/MariaDB/mariadb-connector-c +Source: https://downloads.mariadb.org/interstitial/connector-c-%{version}/mariadb-connector-c-%{version}-src.tar.gz +#Source2-3 come from fedora29 +Source2: my.cnf +Source3: client.cnf + +BuildRequires: libcurl-devel zlib-devel openssl-devel +BuildRequires: cmake git +Provides: %{name}-config%{?_isa} %{name}-config +Obsoletes: %{name}-config + +%description +This package is used for connecting C/C++ programs to MariaDB and +MySQL database. + + + +%package devel +Summary: Mariadb-connector-c library and header files +BuildRequires: multilib-rpm-config +Requires: %{name} = %{version}-%{release} +Requires: openssl-devel + +%description devel +This package includes library and header files for development. + +%prep +%autosetup -n %{name}-%{version}-src -p1 -S git + +%build +%cmake . \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_SYSTEM_PROCESSOR="%{_arch}" \ + -DMARIADB_UNIX_ADDR=%{_sharedstatedir}/mysql/mysql.sock \ + -DMARIADB_PORT=3306 \ + -DWITH_EXTERNAL_ZLIB=YES \ + -DWITH_SSL=OPENSSL \ + -DWITH_MYSQLCOMPAT=ON \ + -DINSTALL_LAYOUT=RPM \ + -DCMAKE_INSTALL_PREFIX="%{_prefix}" \ + -DINSTALL_BINDIR="bin" \ + -DINSTALL_LIBDIR="%{_lib}" \ + -DINSTALL_INCLUDEDIR="include/mysql" \ + -DINSTALL_PLUGINDIR="%{_lib}/mariadb/plugin" \ + -DWITH_UNITTEST=ON +%make_build + + + +%install +%make_install +%multilib_fix_c_header --file %{_includedir}/mysql/mariadb_version.h +ln -s mariadb_config %{buildroot}%{_bindir}/mysql_config +ln -s mariadb_version.h %{buildroot}%{_includedir}/mysql/mysql_version.h +mkdir -p %{buildroot}%{_sysconfdir}/ +mkdir -p %{buildroot}%{_sysconfdir}/my.cnf.d +install -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/my.cnf +install -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/my.cnf.d/client.cnf + +%check +%{buildroot}%{_bindir}/mariadb_config +pushd unittest/libmariadb/ +ctest || : +popd + +%pretrans -p +path = "%{_libdir}/mariadb" +st = posix.stat(path) +if st and st.type == "link" then + os.remove(path) +end +path = "%{_libdir}/mysql" +st = posix.stat(path) +if st and st.type == "link" then + os.remove(path) +end + +%files +%doc README +%license COPYING.LIB +%config(noreplace) %{_sysconfdir}/my.cnf +%config(noreplace) %{_sysconfdir}/my.cnf.d/client.cnf +%dir %{_libdir}/mariadb +%{_libdir}/libmariadb.so.* +%{_libdir}/mariadb/plugin/* +%exclude %{_libdir}/*.a + +%files devel +%{_bindir}/mariadb_config +%{_bindir}/mysql_config +%{_includedir}/mysql/* +%{_libdir}/*.so + +%changelog +* Wed Jul 18 2018 openEuler Buildteam - 3.0.6-3 +- Package init + diff --git a/my.cnf b/my.cnf new file mode 100644 index 0000000..913b88f --- /dev/null +++ b/my.cnf @@ -0,0 +1,11 @@ +# +# This group is read both both by the client and the server +# use it for options that affect everything +# +[client-server] + +# +# include all files from the config directory +# +!includedir /etc/my.cnf.d +