]> git.pld-linux.org Git - packages/mariadb-connector-c.git/blob - mariadb-connector-c.spec
- up to 3.1.11
[packages/mariadb-connector-c.git] / mariadb-connector-c.spec
1 #
2 %bcond_with     tests
3 #
4 Summary:        The MariaDB Native Client library (C driver)
5 Name:           mariadb-connector-c
6 Version:        3.1.11
7 Release:        1
8 License:        LGPL v2+
9 Group:          Libraries
10 Source0:        https://downloads.mariadb.org/interstitial/connector-c-%{version}/%{name}-%{version}-src.tar.gz
11 # Source0-md5:  cf9da5f0ac9ec72dd8309bdc1d1c6c2f
12 Source2:        my.cnf
13 Source3:        client.cnf
14 URL:            http://mariadb.org/
15 # More information: https://mariadb.com/kb/en/mariadb/building-connectorc-from-source/
16 Patch1:         testsuite.patch
17 BuildRequires:  cmake
18 BuildRequires:  libstdc++-devel
19 BuildRequires:  openssl-devel
20 BuildRequires:  zlib-devel
21 Requires:       %{_sysconfdir}/my.cnf
22 # Remote-IO plugin
23 BuildRequires:  curl-devel
24 # auth_gssapi_client plugin
25 BuildRequires:  heimdal-devel
26
27 %description
28 The MariaDB Native Client library (C driver) is used to connect
29 applications developed in C/C++ to MariaDB and MySQL databases.
30
31 %package devel
32 Summary:        Development files for mariadb-connector-c
33 Group:          Development/Libraries
34 Requires:       %{name} = %{version}-%{release}
35 Requires:       openssl-devel
36 Requires:       zlib-devel
37
38 %description devel
39 Development files for mariadb-connector-c. Contains everything needed
40 to build against libmariadb.so >=3 client library.
41
42 %package test
43 Summary:        Testsuite files for mariadb-connector-c
44 Group:          Libraries
45 Requires:       %{name} = %{version}-%{release}
46 Requires:       cmake
47 Suggests:       mariadb-server
48
49 %description test
50 Testsuite files for mariadb-connector-c. Contains binaries and a
51 prepared CMake ctest file. Requires running MariaDB / MySQL server
52 with create database "test".
53
54 %package config
55 Summary:        Configuration files for packages that use /etc/my.cnf as a configuration file
56 Group:          Libraries
57 BuildArch:      noarch
58
59 %description config
60 This package delivers /etc/my.cnf that includes other configuration
61 files from the /etc/my.cnf.d directory and ships this directory as
62 well. Other packages should only put their files into /etc/my.cnf.d
63 directory and require this package, so the /etc/my.cnf file is
64 present.
65
66 %prep
67 %setup -q -n %{name}-%{version}-src
68 %patch1 -p1
69
70 # Remove unsused parts
71 rm -r win zlib win-iconv
72
73 %build
74 %cmake \
75         -DCMAKE_SYSTEM_PROCESSOR="%{_arch}" \
76         -DMARIADB_UNIX_ADDR=%{_sharedstatedir}/mysql/mysql.sock \
77         -DMARIADB_PORT=3306 \
78         -DWITH_EXTERNAL_ZLIB=YES \
79         -DWITH_SSL=OPENSSL \
80         -DWITH_MYSQLCOMPAT=ON \
81         -DPLUGIN_CLIENT_ED25519=DYNAMIC \
82         -DINSTALL_LAYOUT=RPM \
83         -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
84         -DINSTALL_BINDIR="bin" \
85         -DINSTALL_LIBDIR="%{_lib}" \
86         -DINSTALL_INCLUDEDIR="include/mysql" \
87         -DINSTALL_PLUGINDIR="%{_lib}/mariadb/plugin" \
88         -DINSTALL_PCDIR="%{_lib}/pkgconfig" \
89         %{?with_tests:-DWITH_UNITTEST=ON} \
90         .
91
92 %{__make}
93
94 %if %{with tests}
95 # Check the generated configuration on the actual machine
96 $RPM_BUILD_ROOT%{_bindir}/mariadb_config
97
98 # Run the unit tests
99 # - don't run mytap tests
100 # - ignore the testsuite result for now. Enable tests now, fix them later.
101 # Note: there must be a database called 'test' created for the testcases to be run
102 cd unittest/libmariadb/
103 ctest || :
104 cd ../..
105 %endif
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109
110 %{__make} install \
111         DESTDIR=$RPM_BUILD_ROOT
112
113 # Remove static linked libraries and symlinks to them
114 rm $RPM_BUILD_ROOT%{_libdir}/lib*.a
115
116 # Add a compatibility symlinks
117 ln -s mariadb_config $RPM_BUILD_ROOT%{_bindir}/mysql_config
118 ln -s mariadb_version.h $RPM_BUILD_ROOT%{_includedir}/mysql/mysql_version.h
119
120 # Install config files
121 install -D -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/my.cnf
122 install -D -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/my.cnf.d/client.cnf
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127 %files
128 %defattr(644,root,root,755)
129 %doc README
130 %attr(755,root,root) %{_libdir}/libmariadb.so.3
131 %dir %{_libdir}/mariadb
132 %dir %{_libdir}/mariadb/plugin
133 %attr(755,root,root) %{_libdir}/mariadb/plugin/*.so
134
135 %files devel
136 %defattr(644,root,root,755)
137 # Binary which provides compiler info for software compiling against this library
138 %attr(755,root,root) %{_bindir}/mariadb_config
139 %attr(755,root,root) %{_bindir}/mysql_config
140
141 # Symlinks to the versioned library
142 %attr(755,root,root) %{_libdir}/libmariadb.so
143 %attr(755,root,root) %{_libdir}/libmysqlclient.so
144 %attr(755,root,root) %{_libdir}/libmysqlclient_r.so
145
146 # Pkgconfig
147 %{_pkgconfigdir}/libmariadb.pc
148
149 %{_includedir}/mysql
150
151 %files config
152 %defattr(644,root,root,755)
153 %dir %{_sysconfdir}/my.cnf.d
154 %config(noreplace) %{_sysconfdir}/my.cnf
155 %config(noreplace) %{_sysconfdir}/my.cnf.d/client.cnf
156
157 %files test
158 %defattr(644,root,root,755)
159 %dir %{_datadir}/%{name}
160 %{_datadir}/%{name}/*
161 %attr(755,root,root) %{_libdir}/libcctap.so
This page took 0.080594 seconds and 3 git commands to generate.