1 |
commit: cda4995e825424bf017dc4a76e249d0531f841d4 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 28 14:17:49 2019 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 28 14:43:21 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cda4995e |
7 |
|
8 |
dev-db/mysql-init-scripts: rev bump |
9 |
|
10 |
- Move acct-* dependencies to RDEPEND to support binary packages. |
11 |
Note: According to devmanual there will be a problem once emerge |
12 |
will merge RDEPEND after the actual package. |
13 |
|
14 |
- Handle the case when option is defined multiple times. |
15 |
|
16 |
Closes: https://bugs.gentoo.org/693000 |
17 |
Closes: https://bugs.gentoo.org/686378 |
18 |
Package-Manager: Portage-2.3.72, Repoman-2.3.17 |
19 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
20 |
|
21 |
.../mysql-init-scripts/files/logrotate.mysql-2.3 | 5 +- |
22 |
.../mysql-init-scripts-2.3-r3.ebuild | 70 ++++++++++++++++++++++ |
23 |
2 files changed, 74 insertions(+), 1 deletion(-) |
24 |
|
25 |
diff --git a/dev-db/mysql-init-scripts/files/logrotate.mysql-2.3 b/dev-db/mysql-init-scripts/files/logrotate.mysql-2.3 |
26 |
index 6a3b9eeb2ca..6573671b2c7 100644 |
27 |
--- a/dev-db/mysql-init-scripts/files/logrotate.mysql-2.3 |
28 |
+++ b/dev-db/mysql-init-scripts/files/logrotate.mysql-2.3 |
29 |
@@ -9,6 +9,9 @@ size 5M |
30 |
sharedscripts |
31 |
missingok |
32 |
postrotate |
33 |
- /bin/kill -HUP $(cat $(my_print_defaults server mysqld mariadb | grep 'pid[_-]file' | cut -d = -f 2)) |
34 |
+ pidfile=$(my_print_defaults server mysqld mariadb | grep 'pid[_-]file' | tail -n 1 | cut -d = -f 2) |
35 |
+ if [ -s "${pidfile}" ] ; then |
36 |
+ /bin/kill -HUP $(cat "${pidfile}") |
37 |
+ fi |
38 |
endscript |
39 |
} |
40 |
|
41 |
diff --git a/dev-db/mysql-init-scripts/mysql-init-scripts-2.3-r3.ebuild b/dev-db/mysql-init-scripts/mysql-init-scripts-2.3-r3.ebuild |
42 |
new file mode 100644 |
43 |
index 00000000000..ddd4c187ef2 |
44 |
--- /dev/null |
45 |
+++ b/dev-db/mysql-init-scripts/mysql-init-scripts-2.3-r3.ebuild |
46 |
@@ -0,0 +1,70 @@ |
47 |
+# Copyright 1999-2019 Gentoo Authors |
48 |
+# Distributed under the terms of the GNU General Public License v2 |
49 |
+ |
50 |
+EAPI=6 |
51 |
+ |
52 |
+inherit systemd s6 tmpfiles |
53 |
+ |
54 |
+DESCRIPTION="Gentoo MySQL init scripts." |
55 |
+HOMEPAGE="https://www.gentoo.org/" |
56 |
+SRC_URI="" |
57 |
+ |
58 |
+LICENSE="GPL-2" |
59 |
+SLOT="0" |
60 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" |
61 |
+IUSE="" |
62 |
+ |
63 |
+DEPEND="" |
64 |
+# This _will_ break with MySQL 5.0, 4.x, 3.x |
65 |
+# It also NEEDS openrc for the save_options/get_options builtins. |
66 |
+# The s6 support was added after openrc 0.16.2 |
67 |
+# mysql-connector-c needed for my_print_defaults |
68 |
+RDEPEND=" |
69 |
+ !<dev-db/mysql-5.1 |
70 |
+ !<sys-apps/openrc-0.16.2 |
71 |
+ dev-db/mysql-connector-c |
72 |
+ !prefix? ( |
73 |
+ acct-group/mysql acct-user/mysql |
74 |
+ ) |
75 |
+ " |
76 |
+# Need to set S due to PMS saying we need it existing, but no SRC_URI |
77 |
+S=${WORKDIR} |
78 |
+ |
79 |
+src_install() { |
80 |
+ newconfd "${FILESDIR}/conf.d-2.0" "mysql" |
81 |
+ |
82 |
+ # s6 init scripts |
83 |
+ if use amd64 || use x86 ; then |
84 |
+ newconfd "${FILESDIR}/conf.d-2.0" "mysql-s6" |
85 |
+ newinitd "${FILESDIR}/init.d-s6-2.3" "mysql-s6" |
86 |
+ s6_install_service mysql "${FILESDIR}/run-s6" |
87 |
+ s6_install_service mysql/log "${FILESDIR}/log-s6" |
88 |
+ fi |
89 |
+ |
90 |
+ newinitd "${FILESDIR}/init.d-2.3" "mysql" |
91 |
+ newinitd "${FILESDIR}/init.d-supervise-2.3" "mysql-supervise" |
92 |
+ |
93 |
+ # systemd unit installation |
94 |
+ exeinto /usr/libexec |
95 |
+ doexe "${FILESDIR}"/mysqld-wait-ready |
96 |
+ systemd_newunit "${FILESDIR}/mysqld-v2.service" "mysqld.service" |
97 |
+ systemd_newunit "${FILESDIR}/mysqld_at-v2.service" "mysqld@.service" |
98 |
+ dotmpfiles "${FILESDIR}/mysql.conf" |
99 |
+ |
100 |
+ insinto /etc/logrotate.d |
101 |
+ newins "${FILESDIR}/logrotate.mysql-2.3" "mysql" |
102 |
+} |
103 |
+ |
104 |
+pkg_postinst() { |
105 |
+ tmpfiles_process mysql.conf |
106 |
+ if use amd64 || use x86 ; then |
107 |
+ elog "" |
108 |
+ elog "To use the mysql-s6 script, you need to install the optional sys-apps/s6 package." |
109 |
+ elog "If you wish to use s6 logging support, comment out the log-error setting in your my.cnf" |
110 |
+ fi |
111 |
+ |
112 |
+ elog "" |
113 |
+ elog "Starting with version 10.1.8, MariaDB includes an improved systemd unit named mariadb.service" |
114 |
+ elog "You should prefer that unit over this package's mysqld.service." |
115 |
+ einfo "" |
116 |
+} |