Import package vendor original specs for necessary manipulations.

Tue, 28 Aug 2012 18:28:40 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:28:40 +0200
changeset 527
7b145ccff1e9
parent 526
7ddfdb42afce
child 528
3b08e6396b45

Import package vendor original specs for necessary manipulations.

mysql/my.cnf file | annotate | diff | comparison | revisions
mysql/my.pwd file | annotate | diff | comparison | revisions
mysql/mysql.patch file | annotate | diff | comparison | revisions
mysql/mysql.spec file | annotate | diff | comparison | revisions
mysql/rc.mysql file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mysql/my.cnf	Tue Aug 28 18:28:40 2012 +0200
     1.3 @@ -0,0 +1,55 @@
     1.4 +##
     1.5 +##  my.cnf -- MySQL configuration
     1.6 +##
     1.7 +
     1.8 +[client]
     1.9 +
    1.10 +socket                           = @l_prefix@/var/mysql/mysql.sock
    1.11 +port                             = 3306
    1.12 +
    1.13 +[mysqld]
    1.14 +
    1.15 +bind-address                     = 127.0.0.1
    1.16 +port                             = 3306
    1.17 +#skip-networking
    1.18 +
    1.19 +tmpdir                           = @l_prefix@/var/mysql/tmp
    1.20 +log                              = @l_prefix@/var/mysql/common.log
    1.21 +#log-bin                         = @l_prefix@/var/mysql/binary.log
    1.22 +#server-id                       = 1
    1.23 +
    1.24 +key_buffer_size                  = 64M
    1.25 +table_cache                      = 256
    1.26 +join_buffer_size                 = 1M
    1.27 +max_connections                  = 1000
    1.28 +max_connect_errors               = 10
    1.29 +max_delayed_threads              = 20
    1.30 +max_heap_table_size              = 16777216
    1.31 +max_sort_length                  = 1024
    1.32 +max_user_connections             = 1000
    1.33 +record_buffer                    = 131072
    1.34 +sort_buffer                      = 4M
    1.35 +key_buffer                       = 1M
    1.36 +tmp_table_size                   = 32M
    1.37 +query_cache_type                 = 1
    1.38 +query_cache_limit                = 1M
    1.39 +query_cache_size                 = 32M
    1.40 +ft_min_word_len                  = 3
    1.41 +
    1.42 +<with_innobase>
    1.43 +innodb_buffer_pool_size          = 70M
    1.44 +innodb_additional_mem_pool_size  = 2M
    1.45 +innodb_log_files_in_group        = 3
    1.46 +innodb_log_file_size             = 20M
    1.47 +innodb_log_buffer_size           = 8M
    1.48 +innodb_lock_wait_timeout         = 50
    1.49 +
    1.50 +</with_innobase>
    1.51 +[mysqld_safe]
    1.52 +
    1.53 +datadir                          = @l_prefix@/var/mysql
    1.54 +socket                           = @l_prefix@/var/mysql/mysql.sock
    1.55 +pid_file                         = @l_prefix@/var/mysql/mysqld.pid
    1.56 +user                             = @l_rusr@
    1.57 +basedir                          = @l_prefix@
    1.58 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/mysql/my.pwd	Tue Aug 28 18:28:40 2012 +0200
     2.3 @@ -0,0 +1,8 @@
     2.4 +##
     2.5 +##  my.pwd -- MySQL configuration (administrator password only)
     2.6 +##
     2.7 +
     2.8 +[mysqladmin]
     2.9 +user     = root
    2.10 +password = 
    2.11 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/mysql/mysql.patch	Tue Aug 28 18:28:40 2012 +0200
     3.3 @@ -0,0 +1,87 @@
     3.4 +Index: configure
     3.5 +--- configure.orig	2010-10-11 22:40:59.000000000 +0200
     3.6 ++++ configure	2010-11-03 13:05:31.000000000 +0100
     3.7 +@@ -19652,7 +19652,7 @@
     3.8 + 
     3.9 + # Enable the abi_check rule only if gcc is available
    3.10 + 
    3.11 +-if test "$GCC" != "yes" || expr "$CC" : ".*icc.*"
    3.12 ++if true
    3.13 + then
    3.14 +   ABI_CHECK=""
    3.15 + else
    3.16 +Index: include/Makefile.in
    3.17 +--- include/Makefile.in.orig	2010-10-11 22:40:17.000000000 +0200
    3.18 ++++ include/Makefile.in	2010-11-03 13:07:11.000000000 +0100
    3.19 +@@ -405,7 +405,8 @@
    3.20 + 			decimal.h errmsg.h my_global.h my_net.h \
    3.21 + 			my_getopt.h sslopt-longopts.h my_dir.h \
    3.22 + 			sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
    3.23 +-			m_ctype.h my_attribute.h my_compiler.h \
    3.24 ++			m_ctype.h my_attribute.h my_compiler.h rijndael.h sha1.h \
    3.25 ++			my_aes.h \
    3.26 + 			$(HEADERS_GEN_CONFIGURE) \
    3.27 + 			$(HEADERS_GEN_MAKE)
    3.28 + 
    3.29 +@@ -413,8 +414,7 @@
    3.30 + 			heap.h my_bitmap.h my_uctype.h \
    3.31 + 			myisam.h myisampack.h myisammrg.h ft_global.h\
    3.32 + 			mysys_err.h my_base.h help_start.h help_end.h \
    3.33 +-			my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
    3.34 +-			my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
    3.35 ++			my_nosys.h my_alarm.h queues.h my_tree.h my_trie.h hash.h thr_alarm.h \
    3.36 + 			thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
    3.37 + 			my_handler.h my_time.h my_vle.h my_user.h \
    3.38 + 			my_libwrap.h my_stacktrace.h
    3.39 +Index: mysys/default.c
    3.40 +--- mysys/default.c.orig	2010-10-11 22:34:24.000000000 +0200
    3.41 ++++ mysys/default.c	2010-11-03 13:05:31.000000000 +0100
    3.42 +@@ -1123,8 +1123,7 @@
    3.43 + 
    3.44 + #else
    3.45 + 
    3.46 +-  errors += add_directory(alloc, "/etc/", dirs);
    3.47 +-  errors += add_directory(alloc, "/etc/mysql/", dirs);
    3.48 ++  errors += add_directory(alloc, "@l_prefix@/etc/mysql/", dirs);
    3.49 + 
    3.50 + #if defined(DEFAULT_SYSCONFDIR)
    3.51 +   if (DEFAULT_SYSCONFDIR[0])
    3.52 +Index: scripts/mysql_config.sh
    3.53 +--- scripts/mysql_config.sh.orig	2010-10-11 22:34:28.000000000 +0200
    3.54 ++++ scripts/mysql_config.sh	2010-11-03 13:05:31.000000000 +0100
    3.55 +@@ -104,9 +104,9 @@
    3.56 + 
    3.57 + # Create options 
    3.58 + # We intentionally add a space to the beginning and end of lib strings, simplifies replace later
    3.59 +-libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
    3.60 ++libs=" $ldflags -L$pkglibdir -lmysqlclient -lmysys @ZLIB_DEPS@ @NON_THREADED_LIBS@"
    3.61 + libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ "
    3.62 +-libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ "
    3.63 ++libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r -lmysys @ZLIB_DEPS@ @LIBS@ @openssl_libs@ "
    3.64 + embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ "
    3.65 + 
    3.66 + if [ -r "$pkglibdir/libmygcc.a" ]; then
    3.67 +Index: scripts/mysql_system_tables_data.sql
    3.68 +--- scripts/mysql_system_tables_data.sql.orig	2010-10-11 22:34:29.000000000 +0200
    3.69 ++++ scripts/mysql_system_tables_data.sql	2010-11-03 13:05:31.000000000 +0100
    3.70 +@@ -11,8 +11,6 @@
    3.71 + -- Fill "db" table with default grants for anyone to
    3.72 + -- access database 'test' and 'test_%' if "db" table didn't exist
    3.73 + CREATE TEMPORARY TABLE tmp_db LIKE db;
    3.74 +-INSERT INTO tmp_db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
    3.75 +-INSERT INTO tmp_db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
    3.76 + INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0;
    3.77 + DROP TABLE tmp_db;
    3.78 + 
    3.79 +Index: sql/Makefile.in
    3.80 +--- sql/Makefile.in.orig	2010-10-11 22:40:27.000000000 +0200
    3.81 ++++ sql/Makefile.in	2010-11-03 13:05:31.000000000 +0100
    3.82 +@@ -538,7 +538,7 @@
    3.83 + 			$(top_builddir)/strings/libmystrings.a
    3.84 + 
    3.85 + mysqld_DEPENDENCIES = @mysql_plugin_libs@ $(SUPPORTING_LIBS) libndb.la
    3.86 +-LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
    3.87 ++LDADD = $(SUPPORTING_LIBS) @NDB_SCI_LIBS@
    3.88 + mysqld_LDADD = libndb.la \
    3.89 + 			@MYSQLD_EXTRA_LDFLAGS@ \
    3.90 + 			@pstack_libs@ \
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/mysql/mysql.spec	Tue Aug 28 18:28:40 2012 +0200
     4.3 @@ -0,0 +1,373 @@
     4.4 +##
     4.5 +##  mysql.spec -- OpenPKG RPM Package Specification
     4.6 +##  Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
     4.7 +##
     4.8 +##  Permission to use, copy, modify, and distribute this software for
     4.9 +##  any purpose with or without fee is hereby granted, provided that
    4.10 +##  the above copyright notice and this permission notice appear in all
    4.11 +##  copies.
    4.12 +##
    4.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    4.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    4.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    4.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    4.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    4.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    4.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    4.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    4.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    4.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    4.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    4.24 +##  SUCH DAMAGE.
    4.25 +##
    4.26 +
    4.27 +#   package version
    4.28 +%define       V_major   5.1
    4.29 +%define       V_minor   63
    4.30 +%define       V_mysql   %{V_major}.%{V_minor}
    4.31 +%define       V_opkg    %{V_major}.%{V_minor}
    4.32 +%define       V_jdbc    5.1.21
    4.33 +
    4.34 +#   package information
    4.35 +Name:         mysql
    4.36 +Summary:      Fast Relational Database Management System
    4.37 +URL:          http://www.mysql.com/products/mysql/
    4.38 +Vendor:       ORACLE
    4.39 +Packager:     OpenPKG Foundation e.V.
    4.40 +Distribution: OpenPKG Community
    4.41 +Class:        BASE
    4.42 +Group:        Database
    4.43 +License:      GPL
    4.44 +Version:      %{V_opkg}
    4.45 +Release:      20120704
    4.46 +
    4.47 +#   package options
    4.48 +%option       with_server      yes
    4.49 +%option       with_innobase    yes
    4.50 +%option       with_archive     no
    4.51 +%option       with_blackhole   no
    4.52 +%option       with_federated   no
    4.53 +%option       with_ndbcluster  no
    4.54 +%option       with_partition   no
    4.55 +%option       with_ssl         no
    4.56 +%option       with_embedded    no
    4.57 +%option       with_charset     utf8
    4.58 +%option       with_collation   utf8_unicode_ci
    4.59 +%option       with_jdbc        no
    4.60 +
    4.61 +#   fixing implicit inter-plugin dependencies and correlations
    4.62 +%if "%{with_ndbcluster}" == "yes"
    4.63 +%undefine     with_partition
    4.64 +%define       with_partition   yes
    4.65 +%endif
    4.66 +
    4.67 +#   list of sources
    4.68 +Source0:      http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-%{V_major}/mysql-%{V_mysql}.tar.gz
    4.69 +Source1:      http://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-J/mysql-connector-java-%{V_jdbc}.tar.gz
    4.70 +Source2:      my.cnf
    4.71 +Source3:      my.pwd
    4.72 +Source4:      rc.mysql
    4.73 +Patch0:       mysql.patch
    4.74 +
    4.75 +#   build information
    4.76 +BuildPreReq:  OpenPKG, openpkg >= 20100101, perl, make, gcc, gcc::with_cxx = yes
    4.77 +PreReq:       OpenPKG, openpkg >= 20100101, perl
    4.78 +BuildPreReq:  zlib, readline, ncurses
    4.79 +PreReq:       zlib, readline, ncurses
    4.80 +%if "%{with_ssl}" == "yes"
    4.81 +BuildPreReq:  openssl
    4.82 +PreReq:       openssl
    4.83 +%endif
    4.84 +%if "%{with_jdbc}" == "yes"
    4.85 +PreReq:       java, JAVA-JDK
    4.86 +%endif
    4.87 +
    4.88 +%description
    4.89 +    MySQL is a multi-user Relational Database Management System (RDBMS),
    4.90 +    which is controlled through Structured Query Language (SQL)
    4.91 +    operating in full multi-threading mode. The main goals of MySQL are
    4.92 +    speed, robustness and ease of use. MySQL was originally developed
    4.93 +    because of the need for a SQL server that could handle very big
    4.94 +    databases with magnitude higher speed than what any database vendor
    4.95 +    could offer.
    4.96 +
    4.97 +%track
    4.98 +    prog mysql = {
    4.99 +        version   = %{V_mysql}
   4.100 +        url       = http://dev.mysql.com/downloads/mysql/%{V_major}.html
   4.101 +        regex     = mysql-(__VER__)\.tar\.gz
   4.102 +    }
   4.103 +    prog mysql:connector-jdbc = {
   4.104 +        version   = %{V_jdbc}
   4.105 +        url       = http://dev.mysql.com/downloads/connector/j/%{V_major}.html
   4.106 +        regex     = mysql-connector-java-(__VER__)\.tar\.gz
   4.107 +    }
   4.108 +
   4.109 +%prep
   4.110 +    %setup -q
   4.111 +%if "%{with_jdbc}" == "yes"
   4.112 +    %setup -q -T -D -a 1
   4.113 +%endif
   4.114 +    %patch -p0
   4.115 +
   4.116 +%build
   4.117 +    #   patch file search path
   4.118 +    %{l_shtool} subst %{l_value -s -a} \
   4.119 +        mysys/default.c
   4.120 +
   4.121 +    #   fix shebang on supplemental Perl scripts
   4.122 +    rm -f scripts/*.orig
   4.123 +    %{l_shtool} subst \
   4.124 +        -e 's;^#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
   4.125 +        scripts/*
   4.126 +
   4.127 +    #   determine additional configure options
   4.128 +    case "%{l_platform -t}" in
   4.129 +        *-freebsd* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;;
   4.130 +        *-linux*   ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;;
   4.131 +        *-sunos*   ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;;
   4.132 +    esac
   4.133 +
   4.134 +    #   configure source tree
   4.135 +    CC="%{l_cc}" \
   4.136 +    CXX="%{l_cxx}" \
   4.137 +    CFLAGS="%{l_cflags -O}" \
   4.138 +    CXXFLAGS="%{l_cxxflags -O}" \
   4.139 +    CPPFLAGS="%{l_cppflags ncurses}" \
   4.140 +    LDFLAGS="-L`pwd`/libmysql %{l_ldflags}" \
   4.141 +    LIBS="-lz" \
   4.142 +    ./configure \
   4.143 +        --prefix=%{l_prefix} \
   4.144 +        --mandir=%{l_prefix}/man \
   4.145 +        --infodir=%{l_prefix}/info \
   4.146 +        --sysconfdir=%{l_prefix}/etc/mysql \
   4.147 +        --localstatedir=%{l_prefix}/var/mysql \
   4.148 +        --libexecdir=%{l_prefix}/libexec/mysql \
   4.149 +        --with-unix-socket-path=%{l_prefix}/var/mysql/mysql.sock \
   4.150 +        --with-mysqld-user=%{l_musr} \
   4.151 +        --enable-thread-safe-client \
   4.152 +        --with-comment="%{l_openpkg_release}" \
   4.153 +%if "%{with_server}" != "yes"
   4.154 +        --without-server \
   4.155 +%else
   4.156 +        --with-server \
   4.157 +        --with-plugin-csv \
   4.158 +        --with-plugin-heap \
   4.159 +        --with-plugin-myisam \
   4.160 +        --with-plugin-myisammrg \
   4.161 +%if "%{with_innobase}" == "yes"
   4.162 +        --with-plugin-innobase \
   4.163 +%else
   4.164 +        --without-plugin-innobase \
   4.165 +%endif
   4.166 +%if "%{with_archive}" == "yes"
   4.167 +        --with-plugin-archive \
   4.168 +%else
   4.169 +        --without-plugin-archive \
   4.170 +%endif
   4.171 +%if "%{with_blackhole}" == "yes"
   4.172 +        --with-plugin-blackhole \
   4.173 +%else
   4.174 +        --without-plugin-blackhole \
   4.175 +%endif
   4.176 +%if "%{with_federated}" == "yes"
   4.177 +        --with-plugin-federated \
   4.178 +%else
   4.179 +        --without-plugin-federated \
   4.180 +%endif
   4.181 +%if "%{with_ndbcluster}" == "yes"
   4.182 +        --with-plugin-ndbcluster \
   4.183 +%else
   4.184 +        --without-plugin-ndbcluster \
   4.185 +%endif
   4.186 +%if "%{with_partition}" == "yes"
   4.187 +        --with-plugin-partition \
   4.188 +%else
   4.189 +        --without-plugin-partition \
   4.190 +%endif
   4.191 +%endif
   4.192 +        --with-zlib-dir=%{l_prefix} \
   4.193 +%if "%{with_ssl}" == "yes"
   4.194 +        --with-ssl=%{l_prefix} \
   4.195 +%endif
   4.196 +%if "%{with_embedded}" == "yes"
   4.197 +        --with-embedded-server \
   4.198 +%endif
   4.199 +        --with-charset=%{with_charset} \
   4.200 +        --with-collation=%{with_collation} \
   4.201 +        --without-readline \
   4.202 +        --without-libedit \
   4.203 +        --with-big-tables \
   4.204 +        --with-low-memory \
   4.205 +        --disable-shared \
   4.206 +        $opt
   4.207 +
   4.208 +    #   build source tree
   4.209 +    %{l_make} %{l_mflags}
   4.210 +
   4.211 +%install
   4.212 +
   4.213 +    #   patch init script
   4.214 +    %{l_shtool} subst %{l_value -s -a} \
   4.215 +        scripts/mysql_install_db.sh
   4.216 +
   4.217 +    #   perform standard installation procedure
   4.218 +    %{l_make} %{l_mflags} install \
   4.219 +        AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" \
   4.220 +        DESTDIR=$RPM_BUILD_ROOT
   4.221 +
   4.222 +    #   cleanup mysql_config script
   4.223 +    %{l_shtool} subst \
   4.224 +        -e 's;^\(ldflags=.\).*\(.\)$;\1%{l_ldflags}\2;' \
   4.225 +        $RPM_BUILD_ROOT%{l_prefix}/bin/mysql_config
   4.226 +
   4.227 +    #   move utility 'replace', msql2mysql is patched for new path
   4.228 +    mv $RPM_BUILD_ROOT%{l_prefix}/bin/replace \
   4.229 +       $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/
   4.230 +
   4.231 +    #   strip installation area
   4.232 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/mysql-test
   4.233 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/sql-bench
   4.234 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/info/dir
   4.235 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/share/mysql/mysql-%{V_mysql}.spec
   4.236 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/share/mysql/binary-configure
   4.237 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/make_win_src_distribution
   4.238 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/make_win_binary_distribution
   4.239 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/comp_err
   4.240 +    strip  $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
   4.241 +    strip  $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/* 2>/dev/null || true
   4.242 +%if "%{with_ndbcluster}" == "yes"
   4.243 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/ndb*
   4.244 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/man/man1/ndb*
   4.245 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/man/man8/ndb*
   4.246 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/mysql/storage/ndb
   4.247 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/mysql/libndb*
   4.248 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/ndb*
   4.249 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/share/mysql/ndb-config-2-node.ini
   4.250 +%endif
   4.251 +
   4.252 +    #   install global configuration
   4.253 +    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql
   4.254 +    sed <%{SOURCE my.cnf} >my.cnf \
   4.255 +%if "%{with_innobase}" == "yes"
   4.256 +        -e '/<\/\{0,1\}with_innobase>/d'
   4.257 +%else
   4.258 +        -e '/<with_innobase>/,/<\/with_innobase>/d'
   4.259 +%endif
   4.260 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   4.261 +        my.cnf \
   4.262 +        $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
   4.263 +    %{l_shtool} install -c -m 600 \
   4.264 +        %{SOURCE my.pwd} \
   4.265 +        $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
   4.266 +
   4.267 +    #   install run-command script
   4.268 +    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   4.269 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   4.270 +        %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   4.271 +
   4.272 +    #   make sure the database directory exists
   4.273 +    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/mysql
   4.274 +
   4.275 +    #   directory for temporary tables
   4.276 +    %{l_shtool} mkdir -f -p -m 700 $RPM_BUILD_ROOT%{l_prefix}/var/mysql/tmp
   4.277 +
   4.278 +    #   optional client-only installation
   4.279 +%if "%{with_server}" != "yes"
   4.280 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql
   4.281 +    ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
   4.282 +      for bin in *; do
   4.283 +          case "$bin" in
   4.284 +              mysql | mysql_config ) ;;
   4.285 +              * ) rm -f $bin ;;
   4.286 +          esac
   4.287 +      done
   4.288 +    ) || exit $?
   4.289 +    ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man1
   4.290 +      for man in *; do
   4.291 +          case "$man" in
   4.292 +              mysql.1 | mysql_config.1 ) ;;
   4.293 +              * ) rm -f $man ;;
   4.294 +          esac
   4.295 +      done
   4.296 +    ) || exit $?
   4.297 +%endif
   4.298 +
   4.299 +    #   install JDBC driver
   4.300 +%if "%{with_jdbc}" == "yes"
   4.301 +    ( cd mysql-connector-java-%{V_jdbc}
   4.302 +      %{l_shtool} install -c -m 644 \
   4.303 +          mysql-connector-java-%{V_jdbc}-bin.jar \
   4.304 +          $RPM_BUILD_ROOT%{l_prefix}/lib/mysql/mysql.jar
   4.305 +    ) || exit $?
   4.306 +%endif
   4.307 +
   4.308 +    #   determine the package files
   4.309 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   4.310 +%if "%{with_server}" == "yes"
   4.311 +        %{l_files_std} \
   4.312 +        '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.cnf' \
   4.313 +        '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.pwd' \
   4.314 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql' \
   4.315 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp'
   4.316 +%else
   4.317 +        %{l_files_std}
   4.318 +%endif
   4.319 +
   4.320 +%files -f files
   4.321 +
   4.322 +%clean
   4.323 +
   4.324 +%pre
   4.325 +%if "%{with_server}" == "yes"
   4.326 +    #   before upgrade, save status and stop service
   4.327 +    [ $1 -eq 2 ] || exit 0
   4.328 +    eval `%{l_rc} mysql status 2>/dev/null | tee %{l_tmpfile}`
   4.329 +    %{l_rc} mysql stop 2>/dev/null
   4.330 +%endif
   4.331 +    exit 0
   4.332 +
   4.333 +%post
   4.334 +%if "%{with_server}" == "yes"
   4.335 +    if [ $1 -eq 1 ]; then
   4.336 +        #   after install, create initial database
   4.337 +        $RPM_INSTALL_PREFIX/bin/mysql_install_db \
   4.338 +            --defaults-file=$RPM_INSTALL_PREFIX/etc/mysql/my.cnf >/dev/null 2>&1
   4.339 +        chown -R %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/mysql/*
   4.340 +        ( echo "An initial MySQL DB was created. The owner of the database"
   4.341 +          echo "is the DB user 'root'. Its initial password is empty."
   4.342 +          echo "After starting MySQL with..."
   4.343 +          echo ""
   4.344 +          echo "  \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start"
   4.345 +          echo ""
   4.346 +          echo "...you should change the password as soon as possible with:"
   4.347 +          echo ""
   4.348 +          echo "  \$ $RPM_INSTALL_PREFIX/bin/mysqladmin \\ "
   4.349 +          echo "    -u root password '<new-password>'"
   4.350 +          echo ""
   4.351 +          echo "Additionally, because the MySQL package includes automated"
   4.352 +          echo "maintenance procedures that require administrator access to"
   4.353 +          echo "the database, you must maintain a (plain text) copy of the"
   4.354 +          echo "administrator account name and password:"
   4.355 +          echo ""
   4.356 +          echo "  \$ vi $RPM_INSTALL_PREFIX/etc/mysql/my.pwd"
   4.357 +        ) | %{l_rpmtool} msg -b -t notice
   4.358 +    fi
   4.359 +    if [ $1 -eq 2 ]; then
   4.360 +        #   after upgrade, restore status
   4.361 +        { eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}; true; } >/dev/null 2>&1
   4.362 +        [ ".$mysql_active" = .yes ] && %{l_rc} mysql start
   4.363 +    fi
   4.364 +%endif
   4.365 +    exit 0
   4.366 +
   4.367 +%preun
   4.368 +%if "%{with_server}" == "yes"
   4.369 +    #   before erase, stop service and remove log files
   4.370 +    [ $1 -eq 0 ] || exit 0
   4.371 +    %{l_rc} mysql stop 2>/dev/null
   4.372 +    rm -f $RPM_INSTALL_PREFIX/var/mysql/*.log* >/dev/null 2>&1 || true
   4.373 +    rm -f $RPM_INSTALL_PREFIX/var/mysql/*.err* >/dev/null 2>&1 || true
   4.374 +%endif
   4.375 +    exit 0
   4.376 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/mysql/rc.mysql	Tue Aug 28 18:28:40 2012 +0200
     5.3 @@ -0,0 +1,86 @@
     5.4 +#!@l_prefix@/bin/openpkg rc
     5.5 +##
     5.6 +##  rc.mysql -- Run-Commands
     5.7 +##
     5.8 +
     5.9 +%config
    5.10 +    mysql_enable="$openpkg_rc_def"
    5.11 +    mysql_pwd_file=@l_prefix@/etc/mysql/my.pwd
    5.12 +    mysql_cnf_file=@l_prefix@/etc/mysql/my.cnf
    5.13 +    mysql_common_prolog="true"
    5.14 +    mysql_common_epilog="true"
    5.15 +    mysql_common_numfiles="10"
    5.16 +    mysql_common_minsize="1M"
    5.17 +    mysql_common_complevel="9"
    5.18 +    mysql_err_prolog="true"
    5.19 +    mysql_err_epilog="true"
    5.20 +    mysql_err_numfiles="10"
    5.21 +    mysql_err_minsize="1M"
    5.22 +    mysql_err_complevel="9"
    5.23 +
    5.24 +%common
    5.25 +    mysql_pid_file=@l_prefix@/var/mysql/mysqld.pid
    5.26 +    mysql_err_log=@l_prefix@/var/mysql/mysqld.err
    5.27 +    mysql_common_log=@l_prefix@/var/mysql/common.log
    5.28 +    mysql_flush_logs () {
    5.29 +        HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
    5.30 +            --defaults-extra-file=${mysql_pwd_file} \
    5.31 +            flush-logs
    5.32 +    }
    5.33 +
    5.34 +%status -u @l_susr@ -o
    5.35 +    mysql_usable="unknown"
    5.36 +    mysql_active="no"
    5.37 +    HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
    5.38 +        --defaults-extra-file=${mysql_pwd_file} \
    5.39 +        ping >/dev/null 2>&1 && mysql_active="yes"
    5.40 +    if [ $mysql_active = "no" -a -f $mysql_pid_file ] ; then
    5.41 +        kill -0 `cat $mysql_pid_file` && mysql_active="unknown"
    5.42 +    fi
    5.43 +    echo "mysql_enable=\"$mysql_enable\""
    5.44 +    echo "mysql_usable=\"$mysql_usable\""
    5.45 +    echo "mysql_active=\"$mysql_active\""
    5.46 +
    5.47 +%start -p 400 -u @l_susr@
    5.48 +    rcService mysql enable yes || exit 0
    5.49 +    rcService mysql active yes && exit 0
    5.50 +    cd @l_prefix@
    5.51 +    cmd="@l_prefix@/bin/mysqld_safe"
    5.52 +    cmd="$cmd --pid-file=$mysql_pid_file"
    5.53 +    cmd="$cmd --log-error=$mysql_err_log"
    5.54 +    su @l_rusr@ -c "$cmd </dev/null >/dev/null 2>&1 &" </dev/null >/dev/null 2>&1
    5.55 +
    5.56 +%stop -p 600 -u @l_susr@
    5.57 +    rcService mysql enable yes || exit 0
    5.58 +    rcService mysql active no  && exit 0
    5.59 +    mysql_flush_logs
    5.60 +    HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
    5.61 +        --defaults-extra-file=${mysql_pwd_file} \
    5.62 +        shutdown
    5.63 +
    5.64 +%restart -p 400 -u @l_susr@
    5.65 +    rcService mysql enable yes || exit 0
    5.66 +    rcService mysql active no  && exit 0
    5.67 +    rc mysql stop start
    5.68 +
    5.69 +%daily -u @l_susr@
    5.70 +    rcService mysql enable yes || exit 0
    5.71 +    rcTmp -i
    5.72 +    hintfile=`rcTmp -f -n hint`
    5.73 +    shtool rotate -f \
    5.74 +        -n ${mysql_common_numfiles} -s ${mysql_common_minsize} -d \
    5.75 +        -z ${mysql_common_complevel} -m 660 -o @l_rusr@ -g @l_rgrp@ \
    5.76 +        -P "${mysql_common_prolog}" \
    5.77 +        -E "${mysql_common_epilog}; echo 1 >$hintfile" \
    5.78 +        ${mysql_common_log}
    5.79 +    shtool rotate -f \
    5.80 +        -n ${mysql_err_numfiles} -s ${mysql_err_minsize} -d \
    5.81 +        -z ${mysql_err_complevel} -m 660 -o @l_rusr@ -g @l_rgrp@ \
    5.82 +        -P "${mysql_err_prolog}" \
    5.83 +        -E "${mysql_err_epilog}; echo 1 >$hintfile" \
    5.84 +        ${mysql_err_log}
    5.85 +    if [ -s $hintfile ]; then
    5.86 +        mysql_flush_logs
    5.87 +    fi
    5.88 +    rcTmp -k
    5.89 +

mercurial