From: "Robin H. Johnson (robbat2)" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in eclass: mysql.eclass
Date: Wed, 09 Dec 2009 18:45:46 +0000 [thread overview]
Message-ID: <E1NIRXm-0003Fh-Jn@stork.gentoo.org> (raw)
robbat2 09/12/09 18:45:46
Modified: mysql.eclass
Log:
Add eclass documentation and clean up EAPI version checks, thanks to jmbsvicetto for the work.
Revision Changes Path
1.119 eclass/mysql.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/mysql.eclass?rev=1.119&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/mysql.eclass?rev=1.119&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/mysql.eclass?r1=1.118&r2=1.119
Index: mysql.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v
retrieving revision 1.118
retrieving revision 1.119
diff -p -w -b -B -u -u -r1.118 -r1.119
--- mysql.eclass 19 Nov 2009 20:59:38 -0000 1.118
+++ mysql.eclass 9 Dec 2009 18:45:46 -0000 1.119
@@ -1,11 +1,19 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.118 2009/11/19 20:59:38 hanno Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.119 2009/12/09 18:45:46 robbat2 Exp $
+# @ECLASS: mysql.eclass
+# @MAINTAINER:
# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
-# Maintainer: MySQL Team <mysql-bugs@gentoo.org>
+# Maintainers: MySQL Team <mysql-bugs@gentoo.org>
# - Luca Longinotti <chtekk@gentoo.org>
# - Robin H. Johnson <robbat2@gentoo.org>
+# @BLURB: This eclass provides most of the functions for mysql ebuilds
+# @DESCRIPTION:
+# The mysql.eclass provides almost all the code to build the mysql ebuilds
+# including the src_unpack, src_prepare, src_configure, src_compile,
+# scr_install, pkg_preinst, pkg_postinst, pkg_config and pkg_postrm
+# phase hooks.
WANT_AUTOCONF="latest"
WANT_AUTOMAKE="latest"
@@ -22,7 +30,7 @@ case "${EAPI:-0}" in
pkg_config pkg_postrm
IUSE_DEFAULT_ON='+'
;;
- *)
+ 0 | 1)
EXPORT_FUNCTIONS pkg_setup \
src_unpack \
src_compile \
@@ -30,6 +38,8 @@ case "${EAPI:-0}" in
pkg_preinst pkg_postinst \
pkg_config pkg_postrm
;;
+ *)
+ die "Unsupported EAPI: ${EAPI}" ;;
esac
# Shorten the path because the socket path length must be shorter than 107 chars
@@ -43,6 +53,8 @@ if [[ "${MY_EXTRAS_VER}" == "live" ]]; t
inherit git
fi
+# @ECLASS-VARIABLE: MYSQL_VERSION_ID
+# @DESCRIPTION:
# MYSQL_VERSION_ID will be:
# major * 10e6 + minor * 10e4 + micro * 10e2 + gentoo revision number, all [0..99]
# This is an important part, because many of the choices the MySQL ebuild will do
@@ -61,6 +73,10 @@ done
# strip leading "0" (otherwise it's considered an octal number by BASH)
MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"}
+# @ECLASS-VARIABLE: MYSQL_COMMUNITY_FEATURES
+# @DESCRIPTION:
+# Specifiy if community features are available. Possible values are 1 (yes)
+# and 0 (no).
# Community features are available in mysql-community
# AND in the re-merged mysql-5.0.82 and newer
if [ "${PN}" == "mysql-community" ]; then
@@ -160,6 +177,9 @@ mysql_version_is_at_least "5.1.12" \
# HELPER FUNCTIONS:
#
+# @FUNCTION: mysql_disable_test
+# @DESCRIPTION:
+# Helper function to disable specific tests.
mysql_disable_test() {
local testname="${1}" ; shift
local reason="${@}"
@@ -168,11 +188,11 @@ mysql_disable_test() {
ewarn "test '${testname}' disabled: '${reason}'"
}
+# @FUNCTION: mysql_init_vars
+# @DESCRIPTION:
# void mysql_init_vars()
-#
# Initialize global variables
# 2005-11-19 <vivo@gentoo.org>
-
mysql_init_vars() {
MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="/usr/share/mysql"}
MY_SYSCONFDIR=${MY_SYSCONFDIR="/etc/mysql"}
@@ -468,6 +488,13 @@ pbxt_src_install() {
#
# EBUILD FUNCTIONS
#
+# @FUNCTION: mysql_pkg_setup
+# @DESCRIPTION:
+# Perform some basic tests and tasks during pkg_setup phase:
+# die if FEATURES="test", USE="-minimal" and not using FEATURES="userpriv"
+# check for conflicting use flags
+# create new user and group for mysql
+# warn about deprecated features
mysql_pkg_setup() {
if hasq test ${FEATURES} ; then
if ! use minimal ; then
@@ -507,6 +534,9 @@ mysql_pkg_setup() {
&& elog "Berkeley DB support is deprecated and will be removed in future versions!"
}
+# @FUNCTION: mysql_src_unpack
+# @DESCRIPTION:
+# Unpack the source code and call mysql_src_prepare for EAPI < 2.
mysql_src_unpack() {
# Initialize the proper variables first
mysql_init_vars
@@ -518,11 +548,15 @@ mysql_src_unpack() {
mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}"
# Be backwards compatible for now
- if [[ $EAPI != 2 ]]; then
- mysql_src_prepare
- fi
+ case ${EAPI:-0} in
+ 2) : ;;
+ 0 | 1) mysql_src_prepare ;;
+ esac
}
+# @FUNCTION: mysql_src_prepare
+# @DESCRIPTION:
+# Apply patches to the source code and remove unneeded bundled libs.
mysql_src_prepare() {
cd "${S}"
@@ -594,6 +628,9 @@ mysql_src_prepare() {
fi
}
+# @FUNCTION: mysql_src_configure
+# @DESCRIPTION:
+# Configure mysql to build the code for Gentoo respecting the use flags.
mysql_src_configure() {
# Make sure the vars are correctly initialized
mysql_init_vars
@@ -657,17 +694,24 @@ mysql_src_configure() {
fi
}
+# @FUNCTION: mysql_src_compile
+# @DESCRIPTION:
+# Compile the mysql code.
mysql_src_compile() {
# Be backwards compatible for now
- if [[ $EAPI != 2 ]]; then
- mysql_src_configure
- fi
+ case ${EAPI:-0} in
+ 2) : ;;
+ 0 | 1) mysql_src_configure ;;
+ esac
emake || die "emake failed"
mysql_version_is_at_least "5.1.12" && use pbxt && pbxt_src_compile
}
+# @FUNCTION: mysql_src_install
+# @DESCRIPTION:
+# Install mysql.
mysql_src_install() {
# Make sure the vars are correctly initialized
mysql_init_vars
@@ -763,11 +807,22 @@ mysql_src_install() {
mysql_lib_symlinks "${D}"
}
+# @FUNCTION: mysql_pkg_preinst
+# @DESCRIPTION:
+# Create the user and groups for mysql - die if that fails.
mysql_pkg_preinst() {
enewgroup mysql 60 || die "problem adding 'mysql' group"
enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
}
+# @FUNCTION: mysql_pkg_postinst
+# @DESCRIPTION:
+# Run post-installation tasks:
+# create the dir for logfiles if non-existant
+# touch the logfiles and secure them
+# install scripts
+# issue required steps for optional features
+# issue deprecation warnings
mysql_pkg_postinst() {
# Make sure the vars are correctly initialized
mysql_init_vars
@@ -823,6 +878,9 @@ mysql_pkg_postinst() {
&& elog "Berkeley DB support is deprecated and will be removed in future versions!"
}
+# @FUNCTION: mysql_pkg_config
+# @DESCRIPTION:
+# Configure mysql environment.
mysql_pkg_config() {
local old_MY_DATADIR="${MY_DATADIR}"
@@ -967,6 +1025,9 @@ mysql_pkg_config() {
einfo "Done"
}
+# @FUNCTION: mysql_pkg_postrm
+# @DESCRIPTION:
+# Remove mysql symlinks.
mysql_pkg_postrm() {
: # mysql_lib_symlinks "${D}"
}
next reply other threads:[~2009-12-09 18:45 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-09 18:45 Robin H. Johnson (robbat2) [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-07-31 16:57 [gentoo-commits] gentoo-x86 commit in eclass: mysql.eclass Robin H. Johnson (robbat2)
2012-01-08 23:33 Jorge Manuel B. S. Vicetto (jmbsvicetto)
2011-05-07 19:16 Robin H. Johnson (robbat2)
2011-04-21 12:15 Robin H. Johnson (robbat2)
2011-03-28 22:36 Jorge Manuel B. S. Vicetto (jmbsvicetto)
2011-03-26 23:44 Jorge Manuel B. S. Vicetto (jmbsvicetto)
2010-11-28 21:55 Robin H. Johnson (robbat2)
2010-11-02 20:27 Robin H. Johnson (robbat2)
2010-10-28 20:46 Robin H. Johnson (robbat2)
2010-10-27 7:19 Robin H. Johnson (robbat2)
2010-09-06 8:02 Robin H. Johnson (robbat2)
2010-08-20 23:52 Robin H. Johnson (robbat2)
2010-08-09 19:29 Robin H. Johnson (robbat2)
2010-08-08 23:31 Robin H. Johnson (robbat2)
2010-05-13 19:45 Robin H. Johnson (robbat2)
2010-04-27 5:45 Robin H. Johnson (robbat2)
2010-04-01 20:36 Robin H. Johnson (robbat2)
2010-03-25 20:58 Robin H. Johnson (robbat2)
2010-03-24 20:37 Robin H. Johnson (robbat2)
2010-03-24 3:45 Robin H. Johnson (robbat2)
2010-03-24 3:09 Robin H. Johnson (robbat2)
2010-03-15 19:27 Robin H. Johnson (robbat2)
2010-03-15 19:05 Robin H. Johnson (robbat2)
2010-03-15 18:50 Robin H. Johnson (robbat2)
2010-03-09 20:37 Robin H. Johnson (robbat2)
2010-03-03 23:57 Robin H. Johnson (robbat2)
2010-02-27 18:21 Robin H. Johnson (robbat2)
2010-02-21 0:18 Robin H. Johnson (robbat2)
2010-02-02 22:16 Robin H. Johnson (robbat2)
2010-02-02 3:01 Robin H. Johnson (robbat2)
2010-02-02 2:59 Robin H. Johnson (robbat2)
2010-02-02 2:46 Robin H. Johnson (robbat2)
2010-02-01 19:16 Hanno Boeck (hanno)
2010-02-01 1:07 Robin H. Johnson (robbat2)
2010-01-31 5:47 Robin H. Johnson (robbat2)
2010-01-31 5:00 Robin H. Johnson (robbat2)
2010-01-31 3:05 Robin H. Johnson (robbat2)
2009-12-10 1:27 Robin H. Johnson (robbat2)
2009-12-09 19:17 Robin H. Johnson (robbat2)
2009-12-09 18:54 Robin H. Johnson (robbat2)
2009-12-09 18:46 Robin H. Johnson (robbat2)
2009-11-19 20:59 Hanno Boeck (hanno)
2009-11-19 18:22 Robin H. Johnson (robbat2)
2009-10-11 11:42 Markus Meier (maekke)
2009-09-08 5:28 Robin H. Johnson (robbat2)
2009-07-06 19:06 Robin H. Johnson (robbat2)
2009-07-06 19:05 Robin H. Johnson (robbat2)
2009-07-06 18:58 Robin H. Johnson (robbat2)
2009-07-06 18:21 Robin H. Johnson (robbat2)
2009-07-06 18:18 Robin H. Johnson (robbat2)
2009-02-28 10:51 Robin H. Johnson (robbat2)
2009-02-28 10:50 Robin H. Johnson (robbat2)
2009-02-28 10:49 Robin H. Johnson (robbat2)
2009-02-11 11:29 Robin H. Johnson (robbat2)
2009-02-11 11:28 Robin H. Johnson (robbat2)
2009-02-11 11:27 Robin H. Johnson (robbat2)
2009-01-12 23:08 Markus Meier (maekke)
2008-11-29 2:30 Robin H. Johnson (robbat2)
2008-11-20 20:44 Robin H. Johnson (robbat2)
2008-11-14 22:07 Robin H. Johnson (robbat2)
2008-11-14 4:48 Robin H. Johnson (robbat2)
2008-11-14 1:46 Robin H. Johnson (robbat2)
2008-10-16 18:48 Petteri Raty (betelgeuse)
2008-05-29 19:35 Robin H. Johnson (robbat2)
2008-05-29 5:38 Robin H. Johnson (robbat2)
2008-05-29 5:33 Robin H. Johnson (robbat2)
2008-05-29 5:28 Robin H. Johnson (robbat2)
2008-05-29 5:17 Robin H. Johnson (robbat2)
2008-05-29 3:15 Robin H. Johnson (robbat2)
2008-05-22 18:13 Robin H. Johnson (robbat2)
2008-04-05 0:43 Robin H. Johnson (robbat2)
2008-03-10 2:47 Robin H. Johnson (robbat2)
2008-03-09 21:19 Robin H. Johnson (robbat2)
2008-03-09 21:13 Robin H. Johnson (robbat2)
2008-03-09 21:09 Robin H. Johnson (robbat2)
2008-01-16 4:01 Robin H. Johnson (robbat2)
2007-11-08 9:42 Robin H. Johnson (robbat2)
2007-10-02 10:00 Robin H. Johnson (robbat2)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1NIRXm-0003Fh-Jn@stork.gentoo.org \
--to=robbat2@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox