Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@×××××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mysql:master commit in: eclass/
Date: Wed, 30 Apr 2014 20:39:24
Message-Id: 1398890339.a6fc813816f0115c3911dce9db9d6ed66acaedac.grknight.pub@gentoo
1 commit: a6fc813816f0115c3911dce9db9d6ed66acaedac
2 Author: Brian Evans <grknight <AT> tuffmail <DOT> com>
3 AuthorDate: Wed Apr 30 20:38:59 2014 +0000
4 Commit: Brian Evans <grknight <AT> lavabit <DOT> com>
5 CommitDate: Wed Apr 30 20:38:59 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/mysql.git;a=commit;h=a6fc8138
7
8 [eclass] Fix pkg_config for mysql 5.6+ (needs InnoDB)
9
10 Signed-off-by: Brian Evans <grknight <AT> tuffmail.com>
11
12 ---
13 eclass/mysql-multilib.eclass | 29 +++++++++++++++++------------
14 eclass/mysql-v2.eclass | 31 ++++++++++++++++++-------------
15 2 files changed, 35 insertions(+), 25 deletions(-)
16
17 diff --git a/eclass/mysql-multilib.eclass b/eclass/mysql-multilib.eclass
18 index 28df036..d89e15a 100644
19 --- a/eclass/mysql-multilib.eclass
20 +++ b/eclass/mysql-multilib.eclass
21 @@ -747,7 +747,7 @@ mysql-multilib_pkg_config() {
22 helpfile="${TMPDIR}/mysqld-help"
23 ${EROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null
24 for opt in grant-tables host-cache name-resolve networking slave-start \
25 - federated innodb ssl log-bin relay-log slow-query-log external-locking \
26 + federated ssl log-bin relay-log slow-query-log external-locking \
27 ndbcluster log-slave-updates \
28 ; do
29 optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
30 @@ -763,6 +763,22 @@ mysql-multilib_pkg_config() {
31 use prefix && [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] \
32 && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
33
34 + # MySQL 5.6+ needs InnoDB
35 + if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] ; then
36 + mysql_version_is_at_least "5.6" || options="${options} --loose-skip-innodb"
37 + fi
38 +
39 + einfo "Creating the mysql database and setting proper"
40 + einfo "permissions on it ..."
41 +
42 + # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
43 + PID_DIR="${EROOT}/var/run/mysqld"
44 + if [[ ! -d "${PID_DIR}" ]]; then
45 + mkdir -p "${PID_DIR}"
46 + chown mysql:mysql "${PID_DIR}"
47 + chmod 755 "${PID_DIR}"
48 + fi
49 +
50 pushd "${TMPDIR}" &>/dev/null
51 #cmd="'${EROOT}/usr/share/mysql/scripts/mysql_install_db' '--basedir=${EPREFIX}/usr' ${options}"
52 cmd=${EROOT}usr/share/mysql/scripts/mysql_install_db
53 @@ -789,17 +805,6 @@ mysql-multilib_pkg_config() {
54 cat "${help_tables}" >> "${sqltmp}"
55 fi
56
57 - einfo "Creating the mysql database and setting proper"
58 - einfo "permissions on it ..."
59 -
60 - # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
61 - PID_DIR="${EROOT}/var/run/mysqld"
62 - if [[ ! -d "${PID_DIR}" ]]; then
63 - mkdir "${PID_DIR}"
64 - chown mysql:mysql "${PID_DIR}"
65 - chmod 755 "${PID_DIR}"
66 - fi
67 -
68 local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
69 local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
70 local mysqld="${EROOT}/usr/sbin/mysqld \
71
72 diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass
73 index 15faf6c..5a7a6f7 100644
74 --- a/eclass/mysql-v2.eclass
75 +++ b/eclass/mysql-v2.eclass
76 @@ -764,7 +764,7 @@ mysql-v2_pkg_config() {
77 helpfile="${TMPDIR}/mysqld-help"
78 ${EROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null
79 for opt in grant-tables host-cache name-resolve networking slave-start \
80 - federated innodb ssl log-bin relay-log slow-query-log external-locking \
81 + federated ssl log-bin relay-log slow-query-log external-locking \
82 ndbcluster log-slave-updates \
83 ; do
84 optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
85 @@ -780,11 +780,27 @@ mysql-v2_pkg_config() {
86 use prefix && [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] \
87 && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
88
89 + # MySQL 5.6+ needs InnoDB
90 + if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] ; then
91 + mysql_version_is_at_least "5.6" || options="${options} --loose-skip-innodb"
92 + fi
93 +
94 + einfo "Creating the mysql database and setting proper"
95 + einfo "permissions on it ..."
96 +
97 + # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
98 + PID_DIR="${EROOT}/var/run/mysqld"
99 + if [[ ! -d "${PID_DIR}" ]]; then
100 + mkdir -p "${PID_DIR}"
101 + chown mysql:mysql "${PID_DIR}"
102 + chmod 755 "${PID_DIR}"
103 + fi
104 +
105 pushd "${TMPDIR}" &>/dev/null
106 #cmd="'${EROOT}/usr/share/mysql/scripts/mysql_install_db' '--basedir=${EPREFIX}/usr' ${options}"
107 cmd=${EROOT}usr/share/mysql/scripts/mysql_install_db
108 [[ -f ${cmd} ]] || cmd=${EROOT}usr/bin/mysql_install_db
109 - cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options}"
110 + cmd="'$cmd' '--basedir=${EPREFIX}/usr' ${options} '--datadir=${EROOT}/${MY_DATADIR}'"
111 einfo "Command: $cmd"
112 eval $cmd \
113 >"${TMPDIR}"/mysql_install_db.log 2>&1
114 @@ -806,17 +822,6 @@ mysql-v2_pkg_config() {
115 cat "${help_tables}" >> "${sqltmp}"
116 fi
117
118 - einfo "Creating the mysql database and setting proper"
119 - einfo "permissions on it ..."
120 -
121 - # Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
122 - PID_DIR="${EROOT}/var/run/mysqld"
123 - if [[ ! -d "${PID_DIR}" ]]; then
124 - mkdir "${PID_DIR}"
125 - chown mysql:mysql "${PID_DIR}"
126 - chmod 755 "${PID_DIR}"
127 - fi
128 -
129 local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
130 local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
131 local mysqld="${EROOT}/usr/sbin/mysqld \