This repository was archived by the owner on Aug 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplan.sh
87 lines (79 loc) · 2.46 KB
/
plan.sh
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
75
76
77
78
79
80
81
82
83
84
85
86
87
pkg_name=mysql
pkg_origin=core
pkg_version=5.7.35
pkg_maintainer='The Habitat Maintainers <humans@habitat.sh>'
pkg_license=('GPL-2.0')
pkg_source=http://dev.mysql.com/get/Downloads/MySQL-5.7/${pkg_name}-${pkg_version}.tar.gz
pkg_shasum=3b4d3d503a32e3779a386126d79586804b199b455d646c36e58cb50ea75230e9
pkg_upstream_url=https://www.mysql.com/
pkg_description=$(cat << EOF
Starts MySQL with a basic configuration. Configurable at run time:
* root_password: the password for the mysql root user, empty by default
* app_username: the username for an application that will connect to the database server, false by default
* app_password: the password for the app user
* bind: the bind address to listen for connections, default 127.0.0.1
Set the app_username and app_password at runtime to have that user created, it will not be otherwise.
EOF
)
pkg_deps=(
core/coreutils
core/gawk
core/gcc-libs
core/glibc
core/grep
core/inetutils
core/ncurses
core/openssl
core/pcre
core/perl
core/procps-ng
core/sed
core/rpcsvc-proto
)
pkg_build_deps=(
core/bison
core/boost159
core/cmake
core/diffutils
core/gcc
core/make
core/patch
core/pkg-config
core/libtirpc
)
pkg_svc_user="hab"
pkg_bin_dirs=(bin)
pkg_include_dirs=(include)
pkg_lib_dirs=(lib)
pkg_exports=(
[port]=port
[password]=app_password
[username]=app_username
[server_id]=server_id
)
do_build() {
cmake . -DLOCAL_BOOST_DIR="$(pkg_path_for core/boost159)" \
-DBOOST_INCLUDE_DIR="$(pkg_path_for core/boost159)/include" \
-DWITH_BOOST="$(pkg_path_for core/boost159)" \
-DCURSES_INCLUDE_PATH="$(pkg_path_for core/ncurses)/include" \
-DCURSES_LIBRARY="$(pkg_path_for core/ncurses)/lib/libcurses.so" \
-DWITH_SSL=yes \
-DOPENSSL_INCLUDE_DIR="$(pkg_path_for core/openssl)/include" \
-DOPENSSL_LIBRARY="$(pkg_path_for core/openssl)/lib/libssl.so" \
-DCRYPTO_LIBRARY="$(pkg_path_for core/openssl)/lib/libcrypto.so" \
-DCMAKE_INSTALL_PREFIX="$pkg_prefix" \
-DWITH_EMBEDDED_SERVER=no \
-DWITH_EMBEDDED_SHARED_LIBRARY=no
make --jobs="$(nproc)"
}
do_install() {
do_default_install
# Remove static libraries, tests, and other things we don't need
rm -rf "$pkg_prefix/docs" "$pkg_prefix/man" "$pkg_prefix/mysql-test" \
"$pkg_prefix"/lib/*.a
fix_interpreter "$pkg_prefix/bin/mysqld_multi" core/perl bin/perl
fix_interpreter "$pkg_prefix/bin/mysqldumpslow" core/perl bin/perl
}
do_check() {
ctest
}