1 |
valya |
1.23 |
### RPM external mysql 5.1.35
|
2 |
eulisse |
1.5 |
## INITENV +PATH LD_LIBRARY_PATH %i/lib/mysql
|
3 |
valya |
1.23 |
## INITENV SET MYSQL_HOME $MYSQL_ROOT
|
4 |
eulisse |
1.5 |
|
5 |
eulisse |
1.3 |
#Different download locations according to the version.
|
6 |
|
|
|
7 |
elmer |
1.14 |
%if "%(echo %realversion | cut -d. -f1)" == "4"
|
8 |
|
|
%define source http://downloads.mysql.com/archives/mysql-4.0/%n-%realversion.tar.gz
|
9 |
eulisse |
1.3 |
%else
|
10 |
valya |
1.23 |
#%define source http://mirror.provenscaling.com/mysql/community/source/5.0/mysql-%realversion.tar.gz
|
11 |
|
|
%define source http://opensource.become.com/mysql/Downloads/MySQL-5.1/mysql-%realversion.tar.gz
|
12 |
eulisse |
1.3 |
%endif
|
13 |
|
|
|
14 |
|
|
Source: %source
|
15 |
eulisse |
1.6 |
# Let's fake the fact that we have perl (DBI) so that rpm does not complain.
|
16 |
|
|
Provides: perl(DBI)
|
17 |
argiro |
1.1 |
|
18 |
|
|
%prep
|
19 |
elmer |
1.14 |
%setup -n %n-%realversion
|
20 |
argiro |
1.1 |
%ifos darwin
|
21 |
|
|
# There's for some reason a "-traditional-cpp", which breaks with GCC 3.3
|
22 |
|
|
# so remove it. (FIXME: check if this is solved in a newer version.)
|
23 |
|
|
perl -p -i -e 's/-traditional-cpp/-no-cpp-precomp/g' configure.in configure
|
24 |
|
|
%endif
|
25 |
|
|
|
26 |
|
|
%build
|
27 |
|
|
CFLAGS=-O3 CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" \
|
28 |
|
|
./configure --prefix=%i --with-extra-charsets=complex \
|
29 |
|
|
--enable-thread-safe-client --enable-local-infile
|
30 |
eulisse |
1.2 |
make %makeprocesses
|
31 |
muzaffar |
1.17 |
|
32 |
eulisse |
1.8 |
%install
|
33 |
|
|
make install
|
34 |
eulisse |
1.11 |
perl -p -i -e "s|^#!.*perl(.*)|#!/usr/bin/env perl$1|" $(grep -r -e "^#!.*perl.*" %i | cut -d: -f1)
|
35 |
elmer |
1.20 |
rm -fR %i/mysql-test
|
36 |
muzaffar |
1.17 |
|
37 |
|
|
# SCRAM ToolBox toolfile
|
38 |
|
|
mkdir -p %i/etc/scram.d
|
39 |
|
|
cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
|
40 |
|
|
<doc type=BuildSystem::ToolDoc version=1.0>
|
41 |
|
|
<Tool name=%n version=%v>
|
42 |
|
|
<Lib name=mysqlclient>
|
43 |
|
|
<Client>
|
44 |
|
|
<Environment name=MYSQL_BASE default="%i"></Environment>
|
45 |
|
|
<Environment name=LIBDIR default="$MYSQL_BASE/lib/mysql"></Environment>
|
46 |
|
|
<Environment name=MYSQL_BINDIR default="$MYSQL_BASE/bin"></Environment>
|
47 |
|
|
<Environment name=INCLUDE default="$MYSQL_BASE/include/mysql"></Environment>
|
48 |
|
|
</Client>
|
49 |
|
|
<Runtime name=PATH value="$MYSQL_BINDIR" type=path>
|
50 |
|
|
</Tool>
|
51 |
|
|
EOF_TOOLFILE
|
52 |
|
|
|
53 |
eulisse |
1.4 |
%post
|
54 |
|
|
%{relocateConfig}bin/msql2mysql
|
55 |
|
|
%{relocateConfig}bin/mysqlaccess
|
56 |
|
|
%{relocateConfig}bin/mysqlbug
|
57 |
|
|
%{relocateConfig}bin/mysql_config
|
58 |
|
|
%{relocateConfig}bin/mysqld_multi
|
59 |
|
|
%{relocateConfig}bin/mysqld_safe
|
60 |
|
|
%{relocateConfig}bin/mysql_fix_privilege_tables
|
61 |
|
|
%{relocateConfig}bin/mysql_install_db
|
62 |
muzaffar |
1.17 |
%{relocateConfig}etc/scram.d/%n
|
63 |
|
|
|
64 |
valya |
1.23 |
# setup approripate links and made post install procedure
|
65 |
|
|
. $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh
|
66 |
|
|
cat > $MYSQL_ROOT/etc/my.cnf << EOF
|
67 |
|
|
[mysqld]
|
68 |
|
|
max_allowed_packet=128M
|
69 |
|
|
|
70 |
|
|
max_connections = 1000
|
71 |
|
|
connect_timeout = 60
|
72 |
|
|
|
73 |
|
|
set-variable = innodb_log_file_size=512M
|
74 |
|
|
set-variable = innodb_log_buffer_size=8M
|
75 |
|
|
set-variable = innodb_buffer_pool_size=2G
|
76 |
|
|
set-variable = innodb_additional_mem_pool_size=50M
|
77 |
|
|
|
78 |
|
|
key_buffer=512M
|
79 |
|
|
|
80 |
|
|
query_cache_type=1
|
81 |
|
|
query_cache_limit=10M
|
82 |
|
|
query_cache_size=128M
|
83 |
|
|
|
84 |
|
|
# inodb
|
85 |
|
|
innodb_thread_concurrency=0
|
86 |
|
|
innodb_concurrency_tickets=10000
|
87 |
|
|
innodb_commit_concurrency=0
|
88 |
|
|
innodb_flush_logs_at_trx_commit=0
|
89 |
|
|
innodb_flush_method=O_DIRECT
|
90 |
|
|
innodb_file_io_threads = 4
|
91 |
|
|
innodb_checksums=0
|
92 |
|
|
innodb_doublewrite=0
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
max_heap_table_size=1024M
|
96 |
|
|
tmp_table_size=1024M
|
97 |
|
|
|
98 |
|
|
long_query_time=5
|
99 |
|
|
innodb_sync_spin_loops=60
|
100 |
|
|
|
101 |
|
|
innodb_force_recovery = 0
|
102 |
|
|
innodb_lock_wait_timeout = 100
|
103 |
|
|
innodb_autoinc_lock_mode = 2
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
[mysql.server]
|
107 |
|
|
STRICT_TRANS_TABLES=1
|
108 |
|
|
transaction-isolation = READ-COMMITTED
|
109 |
|
|
EOF
|
110 |
eulisse |
1.4 |
|