| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2006 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.43 2006/10/23 12:26:45 vivo Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.50 2006/12/16 12:34:29 chtekk Exp $ |
| 4 | |
4 | |
| 5 | # Author: Francesco Riosa <vivo@gentoo.org> |
5 | # Author: Francesco Riosa <vivo@gentoo.org> |
| 6 | # Maintainer: Luca Longinotti <chtekk@gentoo.org> |
6 | # Maintainer: Luca Longinotti <chtekk@gentoo.org> |
| 7 | |
7 | |
| 8 | # Both MYSQL_VERSION_ID and MYSQL_PATCHSET_REV must be set in the ebuild too |
8 | # Both MYSQL_VERSION_ID and MYSQL_PATCHSET_REV must be set in the ebuild too |
| … | |
… | |
| 33 | >=sys-apps/sed-4 |
33 | >=sys-apps/sed-4 |
| 34 | >=sys-apps/texinfo-4.7-r1 |
34 | >=sys-apps/texinfo-4.7-r1 |
| 35 | >=sys-libs/readline-4.1 |
35 | >=sys-libs/readline-4.1 |
| 36 | >=sys-libs/zlib-1.2.3" |
36 | >=sys-libs/zlib-1.2.3" |
| 37 | |
37 | |
|
|
38 | # LEAVE THE SURROUNDING SPACES THERE |
|
|
39 | MYSQL_MUTUALLY_EXCLUSIVE=" !dev-db/mysql !dev-db/mysql-community " |
|
|
40 | DEPEND="${DEPEND} ${MYSQL_MUTUALLY_EXCLUSIVE/ !${CATEGORY}\/${PN} /}" |
|
|
41 | |
| 38 | mysql_version_is_at_least "5.01.00.00" \ |
42 | mysql_version_is_at_least "5.01.00.00" \ |
| 39 | || DEPEND="${DEPEND} berkdb? ( sys-apps/ed )" |
43 | || DEPEND="${DEPEND} berkdb? ( sys-apps/ed )" |
| 40 | |
44 | |
| 41 | RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-mysql )" |
45 | RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-mysql )" |
| 42 | |
46 | |
| 43 | # dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
47 | # dev-perl/DBD-mysql is needed by some scripts installed by MySQL |
| 44 | PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" |
48 | PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" |
| 45 | |
49 | |
| 46 | # Shorten the path because the socket path length must be shorter than 107 chars |
50 | # Shorten the path because the socket path length must be shorter than 107 chars |
| 47 | # and we will run a mysql server during test phase |
51 | # and we will run a mysql server during test phase |
| 48 | S="${WORKDIR}/${PN/_alpha/-bk-}" # BitKeeper ebuilds |
52 | S="${WORKDIR}/mysql" # BitKeeper ebuilds |
| 49 | |
53 | |
| 50 | # Define $MY_FIXED_PV for MySQL patchsets |
54 | # Define $MY_FIXED_PV for MySQL patchsets |
| 51 | MY_FIXED_PV="${PV/_alpha/}" |
55 | MY_FIXED_PV="${PV/_alpha/}" |
| 52 | #MY_FIXED_PV="${MY_FIXED_PV/_beta/}" |
56 | #MY_FIXED_PV="${MY_FIXED_PV/_beta/}" |
| 53 | #MY_FIXED_PV="${MY_FIXED_PV/_rc/}" |
57 | #MY_FIXED_PV="${MY_FIXED_PV/_rc/}" |
| 54 | |
58 | |
| 55 | MY_P="${P/_/-}" |
59 | MY_P="${P/_/-}" |
| 56 | MY_P="${MY_P/-alpha/-bk-}" # BitKeeper ebuilds |
60 | MY_P="${MY_P/-alpha/-bk-}" # BitKeeper ebuilds |
|
|
61 | MY_P="${MY_P/-community/}" |
| 57 | |
62 | |
| 58 | # Define correct SRC_URIs |
63 | # Define correct SRC_URIs |
| 59 | SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${MY_P}${MYSQL_RERELEASE}.tar.gz" |
64 | SRC_URI="${BASE_URI}/${MY_P}${MYSQL_RERELEASE}.tar.gz" |
| 60 | if [[ -n "${MYSQL_PATCHSET_REV}" ]] ; then |
65 | if [[ -n "${MYSQL_PATCHSET_REV}" ]] ; then |
| 61 | MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2" |
66 | MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2" |
| 62 | # We add the Gentoo mirror here, as we only use primaryuri for the MySQL tarball |
67 | # We add the Gentoo mirror here, as we only use primaryuri for the MySQL tarball |
| 63 | SRC_URI="${SRC_URI} http://gentoo.longitekk.com/${MYSQL_PATCHSET_FILENAME}" |
68 | SRC_URI="${SRC_URI} http://g3nt8.org/patches/${MYSQL_PATCHSET_FILENAME}" |
| 64 | fi |
69 | fi |
| 65 | |
70 | |
| 66 | DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." |
71 | DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." |
| 67 | HOMEPAGE="http://www.mysql.com/" |
72 | HOMEPAGE="http://www.mysql.com/" |
| 68 | SLOT="0" |
73 | SLOT="0" |
| … | |
… | |
| 150 | export MY_INCLUDEDIR |
155 | export MY_INCLUDEDIR |
| 151 | export DATADIR |
156 | export DATADIR |
| 152 | } |
157 | } |
| 153 | |
158 | |
| 154 | configure_minimal() { |
159 | configure_minimal() { |
| 155 | # These are things we exclude from a minimal build, please |
160 | # These are things we exclude from a minimal build, please |
| 156 | # note that the server actually does get built and installed, |
161 | # note that the server actually does get built and installed, |
| 157 | # but we then delete it before packaging. |
162 | # but we then delete it before packaging. |
| 158 | local minimal_exclude_list="server embedded-server extra-tools innodb bench berkeley-db row-based-replication" |
163 | local minimal_exclude_list="server embedded-server extra-tools innodb bench berkeley-db row-based-replication" |
| 159 | |
164 | |
| 160 | for i in ${minimal_exclude_list} ; do |
165 | for i in ${minimal_exclude_list} ; do |
| 161 | myconf="${myconf} --without-${i}" |
166 | myconf="${myconf} --without-${i}" |
| 162 | done |
167 | done |
| 163 | myconf="${myconf} --with-extra-charsets=none" |
168 | myconf="${myconf} --with-extra-charsets=none" |
|
|
169 | myconf="${myconf} --enable-local-infile" |
|
|
170 | |
|
|
171 | if useq "static" ; then |
|
|
172 | myconf="${myconf} --with-client-ldflags=-all-static" |
|
|
173 | myconf="${myconf} --disable-shared" |
|
|
174 | else |
|
|
175 | myconf="${myconf} --enable-shared --enable-static" |
|
|
176 | fi |
|
|
177 | |
|
|
178 | if mysql_version_is_at_least "4.01.00.00" && ! useq "latin1" ; then |
|
|
179 | myconf="${myconf} --with-charset=utf8" |
|
|
180 | myconf="${myconf} --with-collation=utf8_general_ci" |
|
|
181 | else |
|
|
182 | myconf="${myconf} --with-charset=latin1" |
|
|
183 | myconf="${myconf} --with-collation=latin1_swedish_ci" |
|
|
184 | fi |
| 164 | } |
185 | } |
| 165 | |
186 | |
| 166 | configure_common() { |
187 | configure_common() { |
| 167 | myconf="${myconf} $(use_with big-tables)" |
188 | myconf="${myconf} $(use_with big-tables)" |
| 168 | myconf="${myconf} --enable-local-infile" |
189 | myconf="${myconf} --enable-local-infile" |
| … | |
… | |
| 439 | filter-flags "-O" "-O[01]" |
460 | filter-flags "-O" "-O[01]" |
| 440 | |
461 | |
| 441 | # glib-2.3.2_pre fix, bug #16496 |
462 | # glib-2.3.2_pre fix, bug #16496 |
| 442 | append-flags "-DHAVE_ERRNO_AS_DEFINE=1" |
463 | append-flags "-DHAVE_ERRNO_AS_DEFINE=1" |
| 443 | |
464 | |
| 444 | append-flags "-fno-exceptions -fno-strict-aliasing" |
465 | CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing" |
| 445 | CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" |
466 | CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" |
| 446 | mysql_version_is_at_least "5.00.00.00" \ |
467 | mysql_version_is_at_least "5.00.00.00" \ |
| 447 | && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" |
468 | && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" |
| 448 | export CXXFLAGS |
469 | export CXXFLAGS |
| 449 | |
470 | |
| … | |
… | |
| 606 | # Make sure the vars are correctly initialized |
627 | # Make sure the vars are correctly initialized |
| 607 | mysql_init_vars |
628 | mysql_init_vars |
| 608 | |
629 | |
| 609 | [[ -z "${DATADIR}" ]] && die "Sorry, unable to find DATADIR" |
630 | [[ -z "${DATADIR}" ]] && die "Sorry, unable to find DATADIR" |
| 610 | |
631 | |
| 611 | if built_with_use dev-db/mysql minimal ; then |
632 | if built_with_use ${CATEGORY}/${PN} minimal ; then |
| 612 | die "Minimal builds do NOT include the MySQL server" |
633 | die "Minimal builds do NOT include the MySQL server" |
| 613 | fi |
634 | fi |
| 614 | |
635 | |
| 615 | local pwd1="a" |
636 | local pwd1="a" |
| 616 | local pwd2="b" |
637 | local pwd2="b" |
| … | |
… | |
| 711 | wait %1 |
732 | wait %1 |
| 712 | einfo "Done" |
733 | einfo "Done" |
| 713 | } |
734 | } |
| 714 | |
735 | |
| 715 | mysql_pkg_postrm() { |
736 | mysql_pkg_postrm() { |
| 716 | mysql_lib_symlinks |
737 | : #mysql_lib_symlinks |
| 717 | } |
738 | } |