mysql-client.rb
2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# Copyright:: Copyright (c) 2013 Robby Dyer
# Copyright:: Copyright (c) 2014 GitLab.com
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "mysql-client"
default_version "5.5.37"
dependencies [
"openssl",
"zlib",
"ncurses"
]
source :url => "http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz",
:md5 => "bf1d80c66d4822ec6036300399a33c03"
relative_path "mysql-#{version}"
env = {
"LDFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include",
"CFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include",
"CXXFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include",
"CPPFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include",
"LD_RUN_PATH" => "#{install_dir}/embedded/lib",
"PATH" => "#{install_dir}/embedded/bin:#{ENV['PATH']}",
}
unless OHAI.platform =~ /ubuntu/ && OHAI.platform_version =~ /^14.04/
# Perhaps we can drop LD_LIBRARY_PATH on all platforms? For now, all we know
# is that it breaks the build on Ubuntu 14.04.
env.merge!("LD_LIBRARY_PATH" => "#{install_dir}/embedded/lib")
end
# Force CentOS-5 to use gcc/g++ v4.4
if OHAI.platform =~ /centos/ and OHAI.platform_version =~ /^5/
env.merge!( {
"CC" => "gcc44",
"CXX" => "g++44"
})
end
build do
command [
"cmake",
"-DCMAKE_SKIP_RPATH=YES",
"-DCMAKE_INSTALL_PREFIX=#{install_dir}/embedded",
"-DWITH_SSL=system",
"-DOPENSSL_INCLUDE_DIR:PATH=#{install_dir}/embedded/include",
"-DOPENSSL_LIBRARIES:FILEPATH=#{install_dir}/embedded/lib/libssl.so",
"-DWITH_ZLIB=system",
"-DZLIB_INCLUDE_DIR:PATH=#{install_dir}/embedded/include",
"-DZLIB_LIBRARY:FILEPATH=#{install_dir}/embedded/lib/libz.so",
"-DCRYPTO_LIBRARY:FILEPATH=#{install_dir}/embedded/lib/libcrypto.so",
".",
].join(" "), :env => env
%w{libmysql client include}.each do |target|
command "make -j #{max_build_jobs} install", :env => env, :cwd => "#{project_dir}/#{target}"
end
end