diff -r 7b145ccff1e9 -r 3b08e6396b45 mysql/mysql.spec --- a/mysql/mysql.spec Tue Aug 28 18:28:40 2012 +0200 +++ b/mysql/mysql.spec Tue Aug 28 18:28:45 2012 +0200 @@ -22,8 +22,8 @@ ## # package version -%define V_major 5.1 -%define V_minor 63 +%define V_major 5.5 +%define V_minor 27 %define V_mysql %{V_major}.%{V_minor} %define V_opkg %{V_major}.%{V_minor} %define V_jdbc 5.1.21 @@ -39,7 +39,7 @@ Group: Database License: GPL Version: %{V_opkg} -Release: 20120704 +Release: 20120800 # package options %option with_server yes @@ -49,20 +49,21 @@ %option with_federated no %option with_ndbcluster no %option with_partition no +%option with_perfschema no %option with_ssl no %option with_embedded no %option with_charset utf8 %option with_collation utf8_unicode_ci %option with_jdbc no -# fixing implicit inter-plugin dependencies and correlations +# fixing implicit interplugin dependencies and correlations %if "%{with_ndbcluster}" == "yes" %undefine with_partition %define with_partition yes %endif # list of sources -Source0: http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-%{V_major}/mysql-%{V_mysql}.tar.gz +Source0: http://www.mysql.com/Downloads/MySQL-%{V_major}/mysql-%{V_mysql}.tar.gz Source1: http://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-J/mysql-connector-java-%{V_jdbc}.tar.gz Source2: my.cnf Source3: my.pwd @@ -83,9 +84,9 @@ %endif %description - MySQL is a multi-user Relational Database Management System (RDBMS), + MySQL is a multiuser Relational Database Management System (RDBMS), which is controlled through Structured Query Language (SQL) - operating in full multi-threading mode. The main goals of MySQL are + operating in full multithreading mode. The main goals of MySQL are speed, robustness and ease of use. MySQL was originally developed because of the need for a SQL server that could handle very big databases with magnitude higher speed than what any database vendor @@ -110,7 +111,6 @@ %endif %patch -p0 -%build # patch file search path %{l_shtool} subst %{l_value -s -a} \ mysys/default.c @@ -121,119 +121,135 @@ -e 's;^#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \ scripts/* - # determine additional configure options - case "%{l_platform -t}" in - *-freebsd* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;; - *-linux* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;; - *-sunos* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;; - esac +%build + # create build subdirectory + %{l_shtool} mkdir -p objbld + cd objbld - # configure source tree - CC="%{l_cc}" \ - CXX="%{l_cxx}" \ - CFLAGS="%{l_cflags -O}" \ - CXXFLAGS="%{l_cxxflags -O}" \ - CPPFLAGS="%{l_cppflags ncurses}" \ - LDFLAGS="-L`pwd`/libmysql %{l_ldflags}" \ - LIBS="-lz" \ - ./configure \ - --prefix=%{l_prefix} \ - --mandir=%{l_prefix}/man \ - --infodir=%{l_prefix}/info \ - --sysconfdir=%{l_prefix}/etc/mysql \ - --localstatedir=%{l_prefix}/var/mysql \ - --libexecdir=%{l_prefix}/libexec/mysql \ - --with-unix-socket-path=%{l_prefix}/var/mysql/mysql.sock \ - --with-mysqld-user=%{l_musr} \ - --enable-thread-safe-client \ - --with-comment="%{l_openpkg_release}" \ + # configure environment + export CC="%{l_cc}" + export CXX="%{l_cxx}" + export CFLAGS="%{l_cflags -O}" + export CXXFLAGS="%{l_cxxflags -O} -felide-constructors -fno-exceptions -fno-rtti" + export CPPFLAGS="%{l_cppflags ncurses}" + export LDFLAGS="-L`pwd`/libmysql %{l_ldflags}" + export LIBS="-lz" + + # Configure source tree. + # Tips are in mysql_release.cmake + # or run cmake(1) -L for all opts + # Disable dtrace(1) to avoid 'mysqld_dtrace_all.o: file not recognized: Bad value' + %{l_prefix}/bin/cmake \ + -DCMAKE_INSTALL_PREFIX="%{l_prefix}" \ + -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ + -DINSTALL_DOCDIR="share/mysql/doc" \ + -DINSTALL_DOCREADMEDIR="share/mysql/doc" \ + -DINSTALL_INCLUDEDIR="include/mysql" \ + -DINSTALL_INFODIR:STRING="info" \ + -DINSTALL_MYSQLSHAREDIR="share/mysql" \ + -DINSTALL_SBINDIR="libexec/mysql" \ + -DINSTALL_SHAREDIR="share/mysql" \ + -DINSTALL_SCRIPTDIR="bin" \ + -DINSTALL_SUPPORTFILESDIR="share/mysql" \ + -DMYSQL_UNIX_ADDR="%{l_prefix}/var/mysql/mysql.sock" \ + -DFEATURE_SET="community" \ + -DCOMPILATION_COMMENT="%{l_openpkg_release}" \ + -DMANUFACTURER="Built from OpenPKG sources" \ + -DDEFAULT_CHARSET="%{with_charset}" \ + -DDEFAULT_COLLATION="%{with_collation}" \ + -DMYSQL_USER="%{l_musr}" \ + -DWITH_ZLIB=system \ + -DWITH_READLINE=YES \ + -DWITH_LIBEDIT=NO \ + -DWITH_LIBWRAP=NO \ + -DDISABLE_SHARED=YES \ + -DENABLE_DTRACE=NO \ + -DZLIB_INCLUDE_DIR=%{l_cppflags zlib} \ + -DPKG_CONFIG_EXECUTABLE="PKG_CONFIG_EXECUTABLE-NOTFOUND" \ %if "%{with_server}" != "yes" - --without-server \ + -DWITHOUT_SERVER=YES \ +%endif +%if "%{with_ssl}" == "yes" + -DWITH_SSL=system \ + -DOPENSSL_INCLUDE_DIR="%{l_cppflags openssl}" \ + -DOPENSSL_SSL_LIBRARY="%{l_prefix}/lib/libssl.a" \ + -DOPENSSL_CRYPTO_LIBRARY="%{l_prefix}/lib/libcrypto.a" \ + -DCRYPTO_LIBRARY="%{l_prefix}/lib/libcrypto.a" \ %else - --with-server \ - --with-plugin-csv \ - --with-plugin-heap \ - --with-plugin-myisam \ - --with-plugin-myisammrg \ + -DWITH_SSL=NO \ +%endif %if "%{with_innobase}" == "yes" - --with-plugin-innobase \ + -DWITH_INNOBASE_STORAGE_ENGINE=YES \ %else - --without-plugin-innobase \ + -DWITH_INNOBASE_STORAGE_ENGINE=NO \ %endif %if "%{with_archive}" == "yes" - --with-plugin-archive \ + -DWITH_ARCHIVE_STORAGE_ENGINE=YES \ %else - --without-plugin-archive \ + -DWITH_ARCHIVE_STORAGE_ENGINE=NO \ %endif %if "%{with_blackhole}" == "yes" - --with-plugin-blackhole \ + -DWITH_BLACKHOLE_STORAGE_ENGINE=YES \ %else - --without-plugin-blackhole \ + -DWITH_BLACKHOLE_STORAGE_ENGINE=NO \ %endif %if "%{with_federated}" == "yes" - --with-plugin-federated \ + -DWITH_FEDERATED_STORAGE_ENGINE=YES \ %else - --without-plugin-federated \ + -DWITH_FEDERATED_STORAGE_ENGINE=NO \ %endif %if "%{with_ndbcluster}" == "yes" - --with-plugin-ndbcluster \ + -DWITH_NDBCLUSTER_STORAGE_ENGINE=YES \ %else - --without-plugin-ndbcluster \ + -DWITH_NDBCLUSTER_STORAGE_ENGINE=NO \ %endif %if "%{with_partition}" == "yes" - --with-plugin-partition \ + -DWITH_PARTITION_STORAGE_ENGINE=YES \ %else - --without-plugin-partition \ + -DWITH_PARTITION_STORAGE_ENGINE=NO \ %endif -%endif - --with-zlib-dir=%{l_prefix} \ -%if "%{with_ssl}" == "yes" - --with-ssl=%{l_prefix} \ +%if "%{with_perfschema}" == "yes" + -DWITH_PERFSCHEMA_STORAGE_ENGINE=YES \ +%else + -DWITH_PERFSCHEMA_STORAGE_ENGINE=NO \ %endif %if "%{with_embedded}" == "yes" - --with-embedded-server \ + -DWITH_EMBEDDED_SERVER=YES \ +%else + -DWITH_EMBEDDED_SERVER=NO \ %endif - --with-charset=%{with_charset} \ - --with-collation=%{with_collation} \ - --without-readline \ - --without-libedit \ - --with-big-tables \ - --with-low-memory \ - --disable-shared \ - $opt + .. - # build source tree - %{l_make} %{l_mflags} + # build source tree (VERBOSE=1) + %{l_make} %{l_mflags -O} %install + # install from build subdirectory + cd objbld - # patch init script - %{l_shtool} subst %{l_value -s -a} \ - scripts/mysql_install_db.sh + ## patch init script (this broken) + #%{l_shtool} subst %{l_value -s -a} \ + # bin/mysql_install_db.sh # perform standard installation procedure %{l_make} %{l_mflags} install \ - AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" \ DESTDIR=$RPM_BUILD_ROOT - # cleanup mysql_config script + # cleanup scripts %{l_shtool} subst \ -e 's;^\(ldflags=.\).*\(.\)$;\1%{l_ldflags}\2;' \ $RPM_BUILD_ROOT%{l_prefix}/bin/mysql_config - # move utility 'replace', msql2mysql is patched for new path + # move utilities, patched for new paths mv $RPM_BUILD_ROOT%{l_prefix}/bin/replace \ $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/ # strip installation area + rm -rf $RPM_BUILD_ROOT%{l_prefix}/data rm -rf $RPM_BUILD_ROOT%{l_prefix}/mysql-test rm -rf $RPM_BUILD_ROOT%{l_prefix}/sql-bench - rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir - rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/mysql-%{V_mysql}.spec rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/binary-configure - rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/make_win_src_distribution - rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/make_win_binary_distribution - rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/comp_err + rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/ndb-config-2-node.ini strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true strip $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/* 2>/dev/null || true %if "%{with_ndbcluster}" == "yes" @@ -243,7 +259,6 @@ rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/mysql/storage/ndb rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mysql/libndb* rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/ndb* - rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/ndb-config-2-node.ini %endif # install global configuration @@ -261,11 +276,15 @@ %{SOURCE my.pwd} \ $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/ - # install run-command script + # install runcommand script %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d %{l_shtool} install -c -m 755 %{l_value -s -a} \ %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + # mitigate complex buildconf + %{l_shtool} install -c -m 644 \ + INSTALL-SOURCE $RPM_BUILD_ROOT%{l_prefix}/share/mysql/doc/ + # make sure the database directory exists %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/mysql @@ -305,16 +324,14 @@ # determine the package files %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ %if "%{with_server}" == "yes" - %{l_files_std} \ '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.cnf' \ '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.pwd' \ '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql' \ - '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp' -%else + '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp' \ +%endif %{l_files_std} -%endif -%files -f files +%files -f objbld/files %clean