mysql/mysql.spec

changeset 528
3b08e6396b45
parent 527
7b145ccff1e9
child 698
31b10e374497
     1.1 --- a/mysql/mysql.spec	Tue Aug 28 18:28:40 2012 +0200
     1.2 +++ b/mysql/mysql.spec	Tue Aug 28 18:28:45 2012 +0200
     1.3 @@ -22,8 +22,8 @@
     1.4  ##
     1.5  
     1.6  #   package version
     1.7 -%define       V_major   5.1
     1.8 -%define       V_minor   63
     1.9 +%define       V_major   5.5
    1.10 +%define       V_minor   27
    1.11  %define       V_mysql   %{V_major}.%{V_minor}
    1.12  %define       V_opkg    %{V_major}.%{V_minor}
    1.13  %define       V_jdbc    5.1.21
    1.14 @@ -39,7 +39,7 @@
    1.15  Group:        Database
    1.16  License:      GPL
    1.17  Version:      %{V_opkg}
    1.18 -Release:      20120704
    1.19 +Release:      20120800
    1.20  
    1.21  #   package options
    1.22  %option       with_server      yes
    1.23 @@ -49,20 +49,21 @@
    1.24  %option       with_federated   no
    1.25  %option       with_ndbcluster  no
    1.26  %option       with_partition   no
    1.27 +%option       with_perfschema  no
    1.28  %option       with_ssl         no
    1.29  %option       with_embedded    no
    1.30  %option       with_charset     utf8
    1.31  %option       with_collation   utf8_unicode_ci
    1.32  %option       with_jdbc        no
    1.33  
    1.34 -#   fixing implicit inter-plugin dependencies and correlations
    1.35 +#   fixing implicit interplugin dependencies and correlations
    1.36  %if "%{with_ndbcluster}" == "yes"
    1.37  %undefine     with_partition
    1.38  %define       with_partition   yes
    1.39  %endif
    1.40  
    1.41  #   list of sources
    1.42 -Source0:      http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-%{V_major}/mysql-%{V_mysql}.tar.gz
    1.43 +Source0:      http://www.mysql.com/Downloads/MySQL-%{V_major}/mysql-%{V_mysql}.tar.gz
    1.44  Source1:      http://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-J/mysql-connector-java-%{V_jdbc}.tar.gz
    1.45  Source2:      my.cnf
    1.46  Source3:      my.pwd
    1.47 @@ -83,9 +84,9 @@
    1.48  %endif
    1.49  
    1.50  %description
    1.51 -    MySQL is a multi-user Relational Database Management System (RDBMS),
    1.52 +    MySQL is a multiuser Relational Database Management System (RDBMS),
    1.53      which is controlled through Structured Query Language (SQL)
    1.54 -    operating in full multi-threading mode. The main goals of MySQL are
    1.55 +    operating in full multithreading mode. The main goals of MySQL are
    1.56      speed, robustness and ease of use. MySQL was originally developed
    1.57      because of the need for a SQL server that could handle very big
    1.58      databases with magnitude higher speed than what any database vendor
    1.59 @@ -110,7 +111,6 @@
    1.60  %endif
    1.61      %patch -p0
    1.62  
    1.63 -%build
    1.64      #   patch file search path
    1.65      %{l_shtool} subst %{l_value -s -a} \
    1.66          mysys/default.c
    1.67 @@ -121,119 +121,135 @@
    1.68          -e 's;^#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
    1.69          scripts/*
    1.70  
    1.71 -    #   determine additional configure options
    1.72 -    case "%{l_platform -t}" in
    1.73 -        *-freebsd* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;;
    1.74 -        *-linux*   ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;;
    1.75 -        *-sunos*   ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;;
    1.76 -    esac
    1.77 +%build
    1.78 +    #   create build subdirectory
    1.79 +    %{l_shtool} mkdir -p objbld
    1.80 +    cd objbld
    1.81  
    1.82 -    #   configure source tree
    1.83 -    CC="%{l_cc}" \
    1.84 -    CXX="%{l_cxx}" \
    1.85 -    CFLAGS="%{l_cflags -O}" \
    1.86 -    CXXFLAGS="%{l_cxxflags -O}" \
    1.87 -    CPPFLAGS="%{l_cppflags ncurses}" \
    1.88 -    LDFLAGS="-L`pwd`/libmysql %{l_ldflags}" \
    1.89 -    LIBS="-lz" \
    1.90 -    ./configure \
    1.91 -        --prefix=%{l_prefix} \
    1.92 -        --mandir=%{l_prefix}/man \
    1.93 -        --infodir=%{l_prefix}/info \
    1.94 -        --sysconfdir=%{l_prefix}/etc/mysql \
    1.95 -        --localstatedir=%{l_prefix}/var/mysql \
    1.96 -        --libexecdir=%{l_prefix}/libexec/mysql \
    1.97 -        --with-unix-socket-path=%{l_prefix}/var/mysql/mysql.sock \
    1.98 -        --with-mysqld-user=%{l_musr} \
    1.99 -        --enable-thread-safe-client \
   1.100 -        --with-comment="%{l_openpkg_release}" \
   1.101 +    #   configure environment
   1.102 +    export CC="%{l_cc}"
   1.103 +    export CXX="%{l_cxx}"
   1.104 +    export CFLAGS="%{l_cflags -O}"
   1.105 +    export CXXFLAGS="%{l_cxxflags -O} -felide-constructors -fno-exceptions -fno-rtti"
   1.106 +    export CPPFLAGS="%{l_cppflags ncurses}"
   1.107 +    export LDFLAGS="-L`pwd`/libmysql %{l_ldflags}"
   1.108 +    export LIBS="-lz"
   1.109 +
   1.110 +    #   Configure source tree.
   1.111 +    #   Tips are in mysql_release.cmake
   1.112 +    #   or run cmake(1) -L for all opts
   1.113 +    #   Disable dtrace(1) to avoid 'mysqld_dtrace_all.o: file not recognized: Bad value'
   1.114 +    %{l_prefix}/bin/cmake \
   1.115 +        -DCMAKE_INSTALL_PREFIX="%{l_prefix}" \
   1.116 +        -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
   1.117 +        -DINSTALL_DOCDIR="share/mysql/doc" \
   1.118 +        -DINSTALL_DOCREADMEDIR="share/mysql/doc" \
   1.119 +        -DINSTALL_INCLUDEDIR="include/mysql" \
   1.120 +        -DINSTALL_INFODIR:STRING="info" \
   1.121 +        -DINSTALL_MYSQLSHAREDIR="share/mysql" \
   1.122 +        -DINSTALL_SBINDIR="libexec/mysql" \
   1.123 +        -DINSTALL_SHAREDIR="share/mysql" \
   1.124 +        -DINSTALL_SCRIPTDIR="bin" \
   1.125 +        -DINSTALL_SUPPORTFILESDIR="share/mysql" \
   1.126 +        -DMYSQL_UNIX_ADDR="%{l_prefix}/var/mysql/mysql.sock" \
   1.127 +        -DFEATURE_SET="community" \
   1.128 +        -DCOMPILATION_COMMENT="%{l_openpkg_release}" \
   1.129 +        -DMANUFACTURER="Built from OpenPKG sources" \
   1.130 +        -DDEFAULT_CHARSET="%{with_charset}" \
   1.131 +        -DDEFAULT_COLLATION="%{with_collation}" \
   1.132 +        -DMYSQL_USER="%{l_musr}" \
   1.133 +        -DWITH_ZLIB=system \
   1.134 +        -DWITH_READLINE=YES \
   1.135 +        -DWITH_LIBEDIT=NO \
   1.136 +        -DWITH_LIBWRAP=NO \
   1.137 +        -DDISABLE_SHARED=YES \
   1.138 +        -DENABLE_DTRACE=NO \
   1.139 +        -DZLIB_INCLUDE_DIR=%{l_cppflags zlib} \
   1.140 +        -DPKG_CONFIG_EXECUTABLE="PKG_CONFIG_EXECUTABLE-NOTFOUND" \
   1.141  %if "%{with_server}" != "yes"
   1.142 -        --without-server \
   1.143 +        -DWITHOUT_SERVER=YES \
   1.144 +%endif
   1.145 +%if "%{with_ssl}" == "yes"
   1.146 +        -DWITH_SSL=system \
   1.147 +        -DOPENSSL_INCLUDE_DIR="%{l_cppflags openssl}" \
   1.148 +        -DOPENSSL_SSL_LIBRARY="%{l_prefix}/lib/libssl.a" \
   1.149 +        -DOPENSSL_CRYPTO_LIBRARY="%{l_prefix}/lib/libcrypto.a" \
   1.150 +        -DCRYPTO_LIBRARY="%{l_prefix}/lib/libcrypto.a" \
   1.151  %else
   1.152 -        --with-server \
   1.153 -        --with-plugin-csv \
   1.154 -        --with-plugin-heap \
   1.155 -        --with-plugin-myisam \
   1.156 -        --with-plugin-myisammrg \
   1.157 +        -DWITH_SSL=NO \
   1.158 +%endif
   1.159  %if "%{with_innobase}" == "yes"
   1.160 -        --with-plugin-innobase \
   1.161 +        -DWITH_INNOBASE_STORAGE_ENGINE=YES \
   1.162  %else
   1.163 -        --without-plugin-innobase \
   1.164 +        -DWITH_INNOBASE_STORAGE_ENGINE=NO \
   1.165  %endif
   1.166  %if "%{with_archive}" == "yes"
   1.167 -        --with-plugin-archive \
   1.168 +        -DWITH_ARCHIVE_STORAGE_ENGINE=YES \
   1.169  %else
   1.170 -        --without-plugin-archive \
   1.171 +        -DWITH_ARCHIVE_STORAGE_ENGINE=NO \
   1.172  %endif
   1.173  %if "%{with_blackhole}" == "yes"
   1.174 -        --with-plugin-blackhole \
   1.175 +        -DWITH_BLACKHOLE_STORAGE_ENGINE=YES \
   1.176  %else
   1.177 -        --without-plugin-blackhole \
   1.178 +        -DWITH_BLACKHOLE_STORAGE_ENGINE=NO \
   1.179  %endif
   1.180  %if "%{with_federated}" == "yes"
   1.181 -        --with-plugin-federated \
   1.182 +        -DWITH_FEDERATED_STORAGE_ENGINE=YES \
   1.183  %else
   1.184 -        --without-plugin-federated \
   1.185 +        -DWITH_FEDERATED_STORAGE_ENGINE=NO \
   1.186  %endif
   1.187  %if "%{with_ndbcluster}" == "yes"
   1.188 -        --with-plugin-ndbcluster \
   1.189 +        -DWITH_NDBCLUSTER_STORAGE_ENGINE=YES \
   1.190  %else
   1.191 -        --without-plugin-ndbcluster \
   1.192 +        -DWITH_NDBCLUSTER_STORAGE_ENGINE=NO \
   1.193  %endif
   1.194  %if "%{with_partition}" == "yes"
   1.195 -        --with-plugin-partition \
   1.196 +        -DWITH_PARTITION_STORAGE_ENGINE=YES \
   1.197  %else
   1.198 -        --without-plugin-partition \
   1.199 +        -DWITH_PARTITION_STORAGE_ENGINE=NO \
   1.200  %endif
   1.201 -%endif
   1.202 -        --with-zlib-dir=%{l_prefix} \
   1.203 -%if "%{with_ssl}" == "yes"
   1.204 -        --with-ssl=%{l_prefix} \
   1.205 +%if "%{with_perfschema}" == "yes"
   1.206 +        -DWITH_PERFSCHEMA_STORAGE_ENGINE=YES \
   1.207 +%else
   1.208 +        -DWITH_PERFSCHEMA_STORAGE_ENGINE=NO \
   1.209  %endif
   1.210  %if "%{with_embedded}" == "yes"
   1.211 -        --with-embedded-server \
   1.212 +        -DWITH_EMBEDDED_SERVER=YES \
   1.213 +%else
   1.214 +        -DWITH_EMBEDDED_SERVER=NO \
   1.215  %endif
   1.216 -        --with-charset=%{with_charset} \
   1.217 -        --with-collation=%{with_collation} \
   1.218 -        --without-readline \
   1.219 -        --without-libedit \
   1.220 -        --with-big-tables \
   1.221 -        --with-low-memory \
   1.222 -        --disable-shared \
   1.223 -        $opt
   1.224 +        ..
   1.225  
   1.226 -    #   build source tree
   1.227 -    %{l_make} %{l_mflags}
   1.228 +    #   build source tree (VERBOSE=1)
   1.229 +    %{l_make} %{l_mflags -O}
   1.230  
   1.231  %install
   1.232 +    #   install from build subdirectory
   1.233 +    cd objbld
   1.234  
   1.235 -    #   patch init script
   1.236 -    %{l_shtool} subst %{l_value -s -a} \
   1.237 -        scripts/mysql_install_db.sh
   1.238 +    ##   patch init script (this broken)
   1.239 +    #%{l_shtool} subst %{l_value -s -a} \
   1.240 +    #    bin/mysql_install_db.sh
   1.241  
   1.242      #   perform standard installation procedure
   1.243      %{l_make} %{l_mflags} install \
   1.244 -        AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" \
   1.245          DESTDIR=$RPM_BUILD_ROOT
   1.246  
   1.247 -    #   cleanup mysql_config script
   1.248 +    #   cleanup scripts
   1.249      %{l_shtool} subst \
   1.250          -e 's;^\(ldflags=.\).*\(.\)$;\1%{l_ldflags}\2;' \
   1.251          $RPM_BUILD_ROOT%{l_prefix}/bin/mysql_config
   1.252  
   1.253 -    #   move utility 'replace', msql2mysql is patched for new path
   1.254 +    #   move utilities, patched for new paths
   1.255      mv $RPM_BUILD_ROOT%{l_prefix}/bin/replace \
   1.256         $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/
   1.257  
   1.258      #   strip installation area
   1.259 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/data
   1.260      rm -rf $RPM_BUILD_ROOT%{l_prefix}/mysql-test
   1.261      rm -rf $RPM_BUILD_ROOT%{l_prefix}/sql-bench
   1.262 -    rm -f  $RPM_BUILD_ROOT%{l_prefix}/info/dir
   1.263 -    rm -f  $RPM_BUILD_ROOT%{l_prefix}/share/mysql/mysql-%{V_mysql}.spec
   1.264      rm -f  $RPM_BUILD_ROOT%{l_prefix}/share/mysql/binary-configure
   1.265 -    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/make_win_src_distribution
   1.266 -    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/make_win_binary_distribution
   1.267 -    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/comp_err
   1.268 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/share/mysql/ndb-config-2-node.ini
   1.269      strip  $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
   1.270      strip  $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/* 2>/dev/null || true
   1.271  %if "%{with_ndbcluster}" == "yes"
   1.272 @@ -243,7 +259,6 @@
   1.273      rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/mysql/storage/ndb
   1.274      rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/mysql/libndb*
   1.275      rm -f  $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/ndb*
   1.276 -    rm -f  $RPM_BUILD_ROOT%{l_prefix}/share/mysql/ndb-config-2-node.ini
   1.277  %endif
   1.278  
   1.279      #   install global configuration
   1.280 @@ -261,11 +276,15 @@
   1.281          %{SOURCE my.pwd} \
   1.282          $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
   1.283  
   1.284 -    #   install run-command script
   1.285 +    #   install runcommand script
   1.286      %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   1.287      %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.288          %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.289  
   1.290 +    #   mitigate complex buildconf
   1.291 +    %{l_shtool} install -c -m 644 \
   1.292 +        INSTALL-SOURCE $RPM_BUILD_ROOT%{l_prefix}/share/mysql/doc/
   1.293 +
   1.294      #   make sure the database directory exists
   1.295      %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/mysql
   1.296  
   1.297 @@ -305,16 +324,14 @@
   1.298      #   determine the package files
   1.299      %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.300  %if "%{with_server}" == "yes"
   1.301 -        %{l_files_std} \
   1.302          '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.cnf' \
   1.303          '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.pwd' \
   1.304          '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql' \
   1.305 -        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp'
   1.306 -%else
   1.307 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp' \
   1.308 +%endif
   1.309          %{l_files_std}
   1.310 -%endif
   1.311  
   1.312 -%files -f files
   1.313 +%files -f objbld/files
   1.314  
   1.315  %clean
   1.316  

mercurial