Build mysql's embedded server library.

This commit is contained in:
Tom Lane 2008-10-01 23:17:59 +00:00 committed by Michal Schorm
parent 67c46965b4
commit 2dceb7c1c5

View File

@ -1,6 +1,6 @@
Name: mysql Name: mysql
Version: 5.0.67 Version: 5.0.67
Release: 1%{?dist} Release: 2%{?dist}
Summary: MySQL client programs and shared libraries Summary: MySQL client programs and shared libraries
Group: Applications/Databases Group: Applications/Databases
URL: http://www.mysql.com URL: http://www.mysql.com
@ -116,6 +116,28 @@ MySQL is a multi-user, multi-threaded SQL database server. This
package contains the libraries and header files that are needed for package contains the libraries and header files that are needed for
developing MySQL client applications. developing MySQL client applications.
%package embedded
Summary: MySQL as an embeddable library
Group: Applications/Databases
%description embedded
MySQL is a multi-user, multi-threaded SQL database server. This
package contains a version of the MySQL server that can be embedded
into a client application instead of running as a separate process.
%package embedded-devel
Summary: Development files for MySQL as an embeddable library
Group: Applications/Databases
Requires: %{name}-embedded = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}
%description embedded-devel
MySQL is a multi-user, multi-threaded SQL database server. This
package contains files needed for developing and testing with
the embedded version of the MySQL server.
%package bench %package bench
Summary: MySQL benchmark scripts and data Summary: MySQL benchmark scripts and data
@ -168,11 +190,8 @@ CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
# MySQL 4.1.10 definitely doesn't work under strict aliasing; also, # MySQL 4.1.10 definitely doesn't work under strict aliasing; also,
# gcc 4.1 breaks MySQL 5.0.16 without -fwrapv # gcc 4.1 breaks MySQL 5.0.16 without -fwrapv
CFLAGS="$CFLAGS -fno-strict-aliasing -fwrapv" CFLAGS="$CFLAGS -fno-strict-aliasing -fwrapv"
%ifarch alpha # force PIC mode so that we can build libmysqld.so
# Can't link C++ objects into an executable without this. Odd!
# -ECL 2002-12-19
CFLAGS="$CFLAGS -fPIC" CFLAGS="$CFLAGS -fPIC"
%endif
CXXFLAGS="$CFLAGS -fno-rtti -fno-exceptions" CXXFLAGS="$CFLAGS -fno-rtti -fno-exceptions"
export CFLAGS CXXFLAGS export CFLAGS CXXFLAGS
@ -182,6 +201,7 @@ export CFLAGS CXXFLAGS
--without-debug \ --without-debug \
--enable-shared \ --enable-shared \
--with-bench \ --with-bench \
--with-embedded-server \
--localstatedir=/var/lib/mysql \ --localstatedir=/var/lib/mysql \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \ --with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-mysqld-user="mysql" \ --with-mysqld-user="mysql" \
@ -200,6 +220,16 @@ gcc $CFLAGS $LDFLAGS -o scriptstub "-DLIBDIR=\"%{_libdir}/mysql\"" %{SOURCE4}
# Not enabling assembler # Not enabling assembler
make %{?_smp_mflags} make %{?_smp_mflags}
# regular build will make libmysqld.a but not libmysqld.so :-(
mkdir libmysqld/work
cd libmysqld/work
ar -x ../libmysqld.a
gcc -shared -Wl,-soname,libmysqld.so.0 -o libmysqld.so.0.0.1 *.o \
../../bdb/build_unix/libdb.a -lpthread -lcrypt -lnsl -lssl -lcrypto -lrt -lstdc++ -lm -lc
cd ../..
%check
make check make check
%if %runselftest %if %runselftest
@ -260,6 +290,11 @@ install -m 0755 scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug
mv ${RPM_BUILD_ROOT}%{_bindir}/mysql_config ${RPM_BUILD_ROOT}%{_libdir}/mysql/mysql_config mv ${RPM_BUILD_ROOT}%{_bindir}/mysql_config ${RPM_BUILD_ROOT}%{_libdir}/mysql/mysql_config
install -m 0755 scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysql_config install -m 0755 scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysql_config
rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.a
install -m 0755 libmysqld/work/libmysqld.so.0.0.1 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.0.0.1
ln -s libmysqld.so.0.0.1 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.0
ln -s libmysqld.so.0 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so
rm -f ${RPM_BUILD_ROOT}%{_bindir}/comp_err rm -f ${RPM_BUILD_ROOT}%{_bindir}/comp_err
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/comp_err.1* rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/comp_err.1*
rm -f ${RPM_BUILD_ROOT}%{_bindir}/make_win_binary_distribution rm -f ${RPM_BUILD_ROOT}%{_bindir}/make_win_binary_distribution
@ -568,6 +603,18 @@ fi
%{_libdir}/mysql/libmysqlclient*.so %{_libdir}/mysql/libmysqlclient*.so
%{_libdir}/mysql/libndbclient.so %{_libdir}/mysql/libndbclient.so
%files embedded
%defattr(-,root,root)
%{_libdir}/mysql/libmysqld.so.*
%files embedded-devel
%defattr(-,root,root)
%{_libdir}/mysql/libmysqld.so
%{_bindir}/mysql_client_test_embedded
%{_bindir}/mysqltest_embedded
%{_mandir}/man1/mysql_client_test_embedded.1*
%{_mandir}/man1/mysqltest_embedded.1*
%files bench %files bench
%defattr(-,root,root) %defattr(-,root,root)
%{_datadir}/sql-bench %{_datadir}/sql-bench
@ -580,6 +627,11 @@ fi
%{_mandir}/man1/mysql_client_test.1* %{_mandir}/man1/mysql_client_test.1*
%changelog %changelog
* Wed Oct 1 2008 Tom Lane <tgl@redhat.com> 5.0.67-2
- Build the "embedded server" library, and package it in a new sub-RPM
mysql-embedded, along with mysql-embedded-devel for devel support files.
Resolves: #149829
* Sat Aug 23 2008 Tom Lane <tgl@redhat.com> 5.0.67-1 * Sat Aug 23 2008 Tom Lane <tgl@redhat.com> 5.0.67-1
- Update to mysql version 5.0.67 - Update to mysql version 5.0.67
- Move mysql_config's man page to base package, again (apparently I synced - Move mysql_config's man page to base package, again (apparently I synced