Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: media-sound/amarok/
Date: Tue, 04 May 2021 16:05:23
Message-Id: 1620143751.26e8ae85e284ba49fef6ac7b2c7e74b697b3c2ed.asturm@gentoo
1 commit: 26e8ae85e284ba49fef6ac7b2c7e74b697b3c2ed
2 Author: band-a-prend <torokhov-s-a <AT> yandex <DOT> ru>
3 AuthorDate: Tue Apr 13 21:00:22 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Tue May 4 15:55:51 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=26e8ae85
7
8 media-sound/amarok: Add optfeature and pkg_config to create database
9
10 Add optfeature 'kde-apps/audiocd-kio' for Audio CD support.
11
12 Add additional pkg_postinst() elog messages with URLs to pages
13 with preliminary configuration of MySQL/MariaDB Server.
14
15 Add elog messages with steps to create Amarok external database
16 with 'emerge --config amarok' command and switching to use it.
17
18 Add simple short pkg_config() to create Amarok external database
19 with it's default username/password.
20
21 Committer-comment: Drop unrelated minor changes and fix mix of ewarn/einfo.
22
23 Closes: https://github.com/gentoo/kde/pull/899
24 Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>
25 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
26
27 media-sound/amarok/amarok-9999.ebuild | 37 +++++++++++++++++++++++++++++++----
28 1 file changed, 33 insertions(+), 4 deletions(-)
29
30 diff --git a/media-sound/amarok/amarok-9999.ebuild b/media-sound/amarok/amarok-9999.ebuild
31 index 4f26e37cef..397a86c538 100644
32 --- a/media-sound/amarok/amarok-9999.ebuild
33 +++ b/media-sound/amarok/amarok-9999.ebuild
34 @@ -6,7 +6,7 @@ EAPI=7
35 ECM_HANDBOOK="forceoptional"
36 KFMIN=5.74.0
37 QTMIN=5.15.2
38 -inherit ecm kde.org
39 +inherit ecm kde.org optfeature
40
41 DESCRIPTION="Advanced audio player based on KDE frameworks"
42 HOMEPAGE="https://amarok.kde.org/"
43 @@ -111,11 +111,40 @@ pkg_postinst() {
44 echo "${1} ($(has_version ${1} || echo "not ")installed)"
45 }
46
47 + optfeature "Audio CD support" kde-apps/audiocd-kio
48 +
49 if [[ -z "${REPLACING_VERSIONS}" ]]; then
50 - elog "You'll have to configure amarok to use an external db server:"
51 - use mariadb && elog " $(pkg_is_installed dev-db/mariadb)" ||
52 + elog "You'll have to configure amarok to use an external database server:"
53 + if use mariadb ; then
54 + elog " $(pkg_is_installed dev-db/mariadb)"
55 + elog " For preliminary configuration of MariaDB Server please refer to"
56 + elog " https://wiki.gentoo.org/wiki/MariaDB#Configuration"
57 + else
58 elog " $(pkg_is_installed dev-db/mysql)"
59 + elog " For preliminary configuration of MySQL Server please refer to"
60 + elog " https://wiki.gentoo.org/wiki/MySQL#Configuration"
61 + fi
62 elog "Please read https://community.kde.org/Amarok/Community/MySQL for details on how"
63 - elog "to configure the external db and migrate your data from the embedded database."
64 + elog "to configure the external database and migrate your data from the embedded database."
65 + elog "To create external amarok database with default user/password please:"
66 + elog " 1. Make sure that MySQL or MariaDB is installed and configured (see above)"
67 + elog " 2. Ensure that 'mysql' service is started and then run command 'emerge --config amarok'"
68 + elog " 3. On 'Configure Amarok - Database' menu page check 'Use external MySQL database' and press OK"
69 + fi
70 +}
71 +
72 +pkg_config() {
73 + # Create external mysql database with amarok default user/password
74 + local AMAROK_DB_NAME="amarokdb"
75 + local AMAROK_DB_USER_NAME="amarokuser"
76 + local AMAROK_DB_USER_PWD="password"
77 +
78 + einfo "Initializing ${PN} MySQL database 'amarokdb':"
79 + einfo "If prompted for a password, please enter your MySQL root password."
80 + einfo
81 +
82 + if [[ -e "${EROOT}"/usr/bin/mysql ]]; then
83 + "${EROOT}"/usr/bin/mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS ${AMAROK_DB_NAME}; GRANT ALL PRIVILEGES ON ${AMAROK_DB_NAME}.* TO '${AMAROK_DB_USER_NAME}' IDENTIFIED BY '${AMAROK_DB_USER_PWD}'; FLUSH PRIVILEGES;"
84 fi
85 + einfo "${PN} MySQL database 'amarokdb' successfully initialized!"
86 }