| 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.31 2006/05/15 00:48:11 robbat2 Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.38 2006/10/20 13:14:21 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 |
| … | |
… | |
| 45 | # and we will run a mysql server during test phase |
45 | # and we will run a mysql server during test phase |
| 46 | S="${WORKDIR}/${PN}" |
46 | S="${WORKDIR}/${PN}" |
| 47 | |
47 | |
| 48 | # Define $MY_FIXED_PV for MySQL patchsets |
48 | # Define $MY_FIXED_PV for MySQL patchsets |
| 49 | MY_FIXED_PV="${PV/_alpha/}" |
49 | MY_FIXED_PV="${PV/_alpha/}" |
| 50 | MY_FIXED_PV="${MY_FIXED_PV/_beta/}" |
50 | #MY_FIXED_PV="${MY_FIXED_PV/_beta/}" |
| 51 | MY_FIXED_PV="${MY_FIXED_PV/_rc/}" |
51 | #MY_FIXED_PV="${MY_FIXED_PV/_rc/}" |
| 52 | |
52 | |
| 53 | # Define correct SRC_URIs |
53 | # Define correct SRC_URIs |
| 54 | SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${P/_/-}.tar.gz" |
54 | SRC_URI="mirror://mysql/Downloads/MySQL-${PV%.*}/${P/_/-}${MYSQL_RERELEASE}.tar.gz" |
| 55 | if [[ -n "${MYSQL_PATCHSET_REV}" ]]; then |
55 | if [[ -n "${MYSQL_PATCHSET_REV}" ]] ; then |
| 56 | MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2" |
56 | MYSQL_PATCHSET_FILENAME="${PN}-patchset-${MY_FIXED_PV}-r${MYSQL_PATCHSET_REV}.tar.bz2" |
| 57 | # we add the Gentoo mirror here as we only use primaryuri for the mysql tarball. |
57 | # We add the Gentoo mirror here, as we only use primaryuri for the MySQL tarball |
| 58 | SRC_URI="${SRC_URI} mirror://gentoo/${MYSQL_PATCHSET_FILENAME} http://gentoo.longitekk.com/${MYSQL_PATCHSET_FILENAME}" |
58 | SRC_URI="${SRC_URI} http://gentoo.longitekk.com/${MYSQL_PATCHSET_FILENAME}" |
| 59 | fi |
59 | fi |
| 60 | |
60 | |
| 61 | DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." |
61 | DESCRIPTION="A fast, multi-threaded, multi-user SQL database server." |
| 62 | HOMEPAGE="http://www.mysql.com/" |
62 | HOMEPAGE="http://www.mysql.com/" |
| 63 | SLOT="0" |
63 | SLOT="0" |
| 64 | LICENSE="GPL-2" |
64 | LICENSE="GPL-2" |
| 65 | IUSE="big-tables berkdb debug embedded minimal perl selinux srvdir ssl static" |
65 | IUSE="big-tables berkdb debug embedded minimal perl selinux srvdir ssl static" |
| 66 | RESTRICT="primaryuri confcache" |
66 | RESTRICT="confcache" |
| 67 | |
67 | |
| 68 | mysql_version_is_at_least "4.01.00.00" \ |
68 | mysql_version_is_at_least "4.01.00.00" \ |
| 69 | && IUSE="${IUSE} latin1" |
69 | && IUSE="${IUSE} latin1" |
| 70 | |
70 | |
| 71 | mysql_version_is_at_least "4.01.03.00" \ |
71 | mysql_version_is_at_least "4.01.03.00" \ |
| … | |
… | |
| 79 | |
79 | |
| 80 | mysql_version_is_at_least "5.01.00.00" \ |
80 | mysql_version_is_at_least "5.01.00.00" \ |
| 81 | && IUSE="${IUSE} innodb" |
81 | && IUSE="${IUSE} innodb" |
| 82 | |
82 | |
| 83 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ |
83 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst \ |
| 84 | pkg_postinst pkg_config pkg_postrm |
84 | pkg_postinst pkg_config pkg_postrm |
|
|
85 | |
|
|
86 | # |
|
|
87 | # HELPER FUNCTIONS: |
|
|
88 | # |
| 85 | |
89 | |
| 86 | # void mysql_init_vars() |
90 | # void mysql_init_vars() |
| 87 | # |
91 | # |
| 88 | # Initialize global variables |
92 | # Initialize global variables |
| 89 | # 2005-11-19 <vivo@gentoo.org> |
93 | # 2005-11-19 <vivo@gentoo.org> |
| … | |
… | |
| 137 | export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR |
141 | export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR |
| 138 | export MY_INCLUDEDIR |
142 | export MY_INCLUDEDIR |
| 139 | export DATADIR |
143 | export DATADIR |
| 140 | } |
144 | } |
| 141 | |
145 | |
|
|
146 | configure_minimal() { |
|
|
147 | # these are things we exclude from a minimal build |
|
|
148 | # note that the server actually does get built and installed |
|
|
149 | # but we then delete it before packaging. |
|
|
150 | local minimal_exclude_list="server embedded-server extra-tools innodb bench berkeley-db row-based-replication" |
|
|
151 | |
|
|
152 | for i in ${minimal_exclude_list}; do |
|
|
153 | myconf="${myconf} --without-${i}" |
|
|
154 | done |
|
|
155 | myconf="${myconf} --with-extra-charsets=none" |
|
|
156 | } |
|
|
157 | |
|
|
158 | configure_common() { |
|
|
159 | myconf="${myconf} --enable-local-infile" |
|
|
160 | myconf="${myconf} --with-extra-charsets=all" |
|
|
161 | myconf="${myconf} --with-mysqld-user=mysql" |
|
|
162 | myconf="${myconf} --with-unix-socket-path='/var/run/mysqld/mysqld.sock'" |
|
|
163 | myconf="${myconf} --without-libwrap" |
|
|
164 | |
|
|
165 | if useq "static" ; then |
|
|
166 | myconf="${myconf} --with-mysqld-ldflags=-all-static" |
|
|
167 | myconf="${myconf} --with-client-ldflags=-all-static" |
|
|
168 | myconf="${myconf} --disable-shared" |
|
|
169 | else |
|
|
170 | myconf="${myconf} --enable-shared --enable-static" |
|
|
171 | fi |
|
|
172 | |
|
|
173 | if useq "debug" ; then |
|
|
174 | myconf="${myconf} --with-debug=full" |
|
|
175 | else |
|
|
176 | myconf="${myconf} --without-debug" |
|
|
177 | mysql_version_is_at_least "4.01.03.00" \ |
|
|
178 | && useq "cluster" \ |
|
|
179 | && myconf="${myconf} --without-ndb-debug" |
|
|
180 | fi |
|
|
181 | |
|
|
182 | if mysql_version_is_at_least "4.01.00.00" && ! useq "latin1" ; then |
|
|
183 | myconf="${myconf} --with-charset=utf8" |
|
|
184 | myconf="${myconf} --with-collation=utf8_general_ci" |
|
|
185 | else |
|
|
186 | myconf="${myconf} --with-charset=latin1" |
|
|
187 | myconf="${myconf} --with-collation=latin1_swedish_ci" |
|
|
188 | fi |
|
|
189 | |
|
|
190 | if useq "embedded" ; then |
|
|
191 | myconf="${myconf} --with-embedded-privilege-control" |
|
|
192 | myconf="${myconf} --with-embedded-server" |
|
|
193 | else |
|
|
194 | myconf="${myconf} --without-embedded-privilege-control" |
|
|
195 | myconf="${myconf} --without-embedded-server" |
|
|
196 | fi |
|
|
197 | |
|
|
198 | } |
|
|
199 | |
|
|
200 | configure_40_41_50() { |
|
|
201 | myconf="${myconf} $(use_with perl bench)" |
|
|
202 | myconf="${myconf} --enable-assembler" |
|
|
203 | myconf="${myconf} --with-extra-tools" |
|
|
204 | myconf="${myconf} --with-innodb" |
|
|
205 | myconf="${myconf} --without-readline" |
|
|
206 | mysql_version_is_at_least "5.00.00.00" || myconf="${myconf} $(use_with raid)" |
|
|
207 | |
|
|
208 | if useq "ssl" ; then |
|
|
209 | # --with-vio is not needed anymore, it's on by default and |
|
|
210 | # has been removed from configure |
|
|
211 | mysql_version_is_at_least "5.00.04.00" || myconf="${myconf} --with-vio" |
|
|
212 | if mysql_version_is_at_least "5.00.06.00" ; then |
|
|
213 | # myconf="${myconf} --with-yassl" |
|
|
214 | myconf="${myconf} --with-openssl" |
|
|
215 | else |
|
|
216 | myconf="${myconf} --with-openssl" |
|
|
217 | fi |
|
|
218 | else |
|
|
219 | myconf="${myconf} --without-openssl" |
|
|
220 | fi |
|
|
221 | |
|
|
222 | # The following fix is due to a bug with bdb on SPARC's. See: |
|
|
223 | # http://www.geocrawler.com/mail/msg.php3?msg_id=4754814&list=8 |
|
|
224 | # It comes down to non-64-bit safety problems. |
|
|
225 | if useq "sparc" || useq "alpha" || useq "hppa" || useq "mips" || useq "amd64" ; then |
|
|
226 | ewarn "bdb berkeley-db disabled due to incompatible arch" |
|
|
227 | myconf="${myconf} --without-berkeley-db" |
|
|
228 | else |
|
|
229 | useq "berkdb" && myconf="${myconf} --with-berkeley-db=./bdb" |
|
|
230 | fi |
|
|
231 | |
|
|
232 | if mysql_version_is_at_least "4.01.03.00" ; then |
|
|
233 | myconf="${myconf} --with-geometry" |
|
|
234 | myconf="${myconf} $(use_with cluster ndbcluster)" |
|
|
235 | fi |
|
|
236 | |
|
|
237 | mysql_version_is_at_least "4.01.11.00" \ |
|
|
238 | && myconf="${myconf} $(use_with big-tables)" |
|
|
239 | |
|
|
240 | if mysql_version_is_at_least "4.01.03.00" && useq "extraengine" ; then |
|
|
241 | # http://dev.mysql.com/doc/mysql/en/archive-storage-engine.html |
|
|
242 | myconf="${myconf} --with-archive-storage-engine" |
|
|
243 | |
|
|
244 | # http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html |
|
|
245 | myconf="${myconf} --with-csv-storage-engine" |
|
|
246 | |
|
|
247 | # http://dev.mysql.com/doc/mysql/en/blackhole-storage-engine.html |
|
|
248 | myconf="${myconf} --with-blackhole-storage-engine" |
|
|
249 | |
|
|
250 | # http://dev.mysql.com/doc/mysql/en/federated-storage-engine.html |
|
|
251 | # http://dev.mysql.com/doc/mysql/en/federated-description.html |
|
|
252 | # http://dev.mysql.com/doc/mysql/en/federated-limitations.html |
|
|
253 | if mysql_version_is_at_least "5.00.03.00" ; then |
|
|
254 | einfo "Before using the Federated storage engine, please be sure to read" |
|
|
255 | einfo "http://dev.mysql.com/doc/mysql/en/federated-limitations.html" |
|
|
256 | myconf="${myconf} --with-federated-storage-engine" |
|
|
257 | fi |
|
|
258 | fi |
|
|
259 | |
|
|
260 | mysql_version_is_at_least "5.00.18.00" \ |
|
|
261 | && useq "max-idx-128" \ |
|
|
262 | && myconf="${myconf} --with-max-indexes=128" |
|
|
263 | } |
|
|
264 | |
|
|
265 | configure_51() { |
|
|
266 | # TODO : !!!!! readd --withouth-readline |
|
|
267 | # the failure depend upon config/ac-macros/readline.m4 checking into |
|
|
268 | # readline.h instead of history.h |
|
|
269 | myconf="${myconf} $(use_with big-tables)" |
|
|
270 | myconf="${myconf} $(use_with ssl)" |
|
|
271 | myconf="${myconf} --enable-assembler" |
|
|
272 | myconf="${myconf} --with-geometry" |
|
|
273 | myconf="${myconf} --with-readline" |
|
|
274 | myconf="${myconf} --with-row-based-replication" |
|
|
275 | myconf="${myconf} --with-zlib=/usr/$(get_libdir)" |
|
|
276 | myconf="${myconf} --without-pstack" |
|
|
277 | useq "max-idx-128" && myconf="${myconf} --with-max-indexes=128" |
|
|
278 | |
|
|
279 | # 5.1 introduces a new way to manage storage engines (plugins) |
|
|
280 | # like configuration=none |
|
|
281 | local plugins="csv,myisam,myisammrg,heap" |
|
|
282 | if useq "extraengine" ; then |
|
|
283 | # like configuration=max-no-ndb, archive and example removed in 5.1.11 |
|
|
284 | plugins="${plugins},blackhole,federated,ftexample,partition" |
|
|
285 | |
|
|
286 | einfo "before to use federated engine be sure to read" |
|
|
287 | einfo "http://dev.mysql.com/doc/refman/5.1/en/federated-limitations.html" |
|
|
288 | fi |
|
|
289 | |
|
|
290 | if useq "innodb" ; then |
|
|
291 | plugins="${plugins},innobase" |
|
|
292 | fi |
|
|
293 | |
|
|
294 | # like configuration=max-no-ndb |
|
|
295 | if useq "cluster" ; then |
|
|
296 | plugins="${plugins},ndbcluster" |
|
|
297 | myconf="${myconf} --with-ndb-binlog" |
|
|
298 | fi |
|
|
299 | |
|
|
300 | myconf="${myconf} --with-plugins=${plugins}" |
|
|
301 | } |
|
|
302 | |
|
|
303 | # |
|
|
304 | # EBUILD FUNCTIONS |
|
|
305 | # |
|
|
306 | |
| 142 | mysql_pkg_setup() { |
307 | mysql_pkg_setup() { |
| 143 | enewgroup mysql 60 || die "problem adding 'mysql' group" |
308 | enewgroup mysql 60 || die "problem adding 'mysql' group" |
| 144 | enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
309 | enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" |
|
|
310 | |
|
|
311 | if mysql_version_is_at_least "5.01.12.00" && useq "innodb" ; then |
|
|
312 | die "innodb now use cmake to build this is a TODO item" |
|
|
313 | fi |
| 145 | |
314 | |
| 146 | # Check for USE flag problems in pkg_setup |
315 | # Check for USE flag problems in pkg_setup |
| 147 | if useq "static" && useq "ssl" ; then |
316 | if useq "static" && useq "ssl" ; then |
| 148 | eerror "MySQL does not support being built statically with SSL support enabled!" |
317 | eerror "MySQL does not support being built statically with SSL support enabled!" |
| 149 | die "MySQL does not support being built statically with SSL support enabled!" |
318 | die "MySQL does not support being built statically with SSL support enabled!" |
| … | |
… | |
| 161 | && ( useq "cluster" || useq "extraengine" ) \ |
330 | && ( useq "cluster" || useq "extraengine" ) \ |
| 162 | && useq "minimal" ; then |
331 | && useq "minimal" ; then |
| 163 | eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" |
332 | eerror "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" |
| 164 | die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" |
333 | die "USE flags 'cluster' and 'extraengine' conflict with 'minimal' USE flag!" |
| 165 | fi |
334 | fi |
|
|
335 | |
|
|
336 | useq "berkdb" && ewarn "Berkley DB support is deprecated and will be removed in future versions" |
| 166 | } |
337 | } |
| 167 | |
338 | |
| 168 | mysql_src_unpack() { |
339 | mysql_src_unpack() { |
| 169 | # Initialize the proper variables first |
340 | # Initialize the proper variables first |
| 170 | mysql_init_vars |
341 | mysql_init_vars |
| 171 | |
342 | |
| 172 | unpack ${A} |
343 | unpack ${A} |
| 173 | |
344 | |
| 174 | mv -f "${WORKDIR}/${P/_/-}" "${S}" |
345 | mv -f "${WORKDIR}/${P/_/-}${MYSQL_RERELEASE}" "${S}" |
| 175 | cd "${S}" |
346 | cd "${S}" |
| 176 | |
347 | |
| 177 | # Apply the patches for this MySQL version |
348 | # Apply the patches for this MySQL version |
| 178 | if [[ -d "${WORKDIR}/${MY_FIXED_PV}" ]] ; then |
349 | if [[ -d "${WORKDIR}/${MY_FIXED_PV}" ]] ; then |
| 179 | EPATCH_SOURCE="${WORKDIR}/${MY_FIXED_PV}" EPATCH_SUFFIX="patch" epatch |
350 | EPATCH_SOURCE="${WORKDIR}/${MY_FIXED_PV}" EPATCH_SUFFIX="patch" epatch |
| … | |
… | |
| 183 | rm -f "${S}/zlib/"*.[ch] |
354 | rm -f "${S}/zlib/"*.[ch] |
| 184 | sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in" |
355 | sed -i -e "s/zlib\/Makefile dnl/dnl zlib\/Makefile/" "${S}/configure.in" |
| 185 | rm -f "scripts/mysqlbug" |
356 | rm -f "scripts/mysqlbug" |
| 186 | |
357 | |
| 187 | # Make charsets install in the right place |
358 | # Make charsets install in the right place |
|
|
359 | find . -name 'Makefile.am' \ |
| 188 | find . -name 'Makefile.am' -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; |
360 | -exec sed --in-place -e 's!$(pkgdatadir)!'${MY_SHAREDSTATEDIR}'!g' {} \; |
| 189 | |
361 | |
| 190 | # Manage mysqlmanager |
362 | # Manage mysqlmanager |
| 191 | mysql_version_is_at_least "5.00.15.00" \ |
363 | mysql_version_is_at_least "5.00.15.00" \ |
| 192 | && sed -i -e "s!@GENTOO_EXT@!!g" -e "s!@GENTOO_SOCK_PATH@!var/run/mysqld!g" "${S}/server-tools/instance-manager/Makefile.am" |
364 | && sed -i -e "s!@GENTOO_EXT@!${MY_SUFFIX}!g" \ |
|
|
365 | -e "s!@GENTOO_SOCK_PATH@!var/run/mysqld!g" \ |
|
|
366 | "${S}/server-tools/instance-manager/Makefile.am" |
| 193 | |
367 | |
| 194 | if mysql_version_is_at_least "4.01.00.00" ; then |
368 | if mysql_version_is_at_least "4.01.00.00" ; then |
| 195 | # Remove what needs to be recreated, so we're sure it's actually done |
369 | # Remove what needs to be recreated, so we're sure it's actually done |
| 196 | find . -name Makefile \ |
370 | find . -name Makefile \ |
| 197 | -o -name Makefile.in \ |
371 | -o -name Makefile.in \ |
| 198 | -o -name configure \ |
372 | -o -name configure \ |
| 199 | -exec rm -f {} \; |
373 | -exec rm -f {} \; |
| 200 | rm -f "ltmain.sh" |
374 | rm -f "ltmain.sh" |
|
|
375 | rm -f "scripts/mysqlbug" |
| 201 | fi |
376 | fi |
| 202 | |
377 | |
| 203 | local rebuilddirlist bdbdir d |
378 | local rebuilddirlist bdbdir d |
| 204 | |
379 | |
| 205 | if mysql_version_is_at_least "5.01.00.00" ; then |
380 | if mysql_version_is_at_least "5.01.00.00" ; then |
| … | |
… | |
| 407 | filter-flags "-O" "-O[01]" |
582 | filter-flags "-O" "-O[01]" |
| 408 | |
583 | |
| 409 | # glib-2.3.2_pre fix, bug #16496 |
584 | # glib-2.3.2_pre fix, bug #16496 |
| 410 | append-flags "-DHAVE_ERRNO_AS_DEFINE=1" |
585 | append-flags "-DHAVE_ERRNO_AS_DEFINE=1" |
| 411 | |
586 | |
| 412 | # The compiler flags are as their "official" spec says ;) |
587 | append-flags "-fno-exceptions -fno-strict-aliasing" |
| 413 | # CFLAGS="${CFLAGS/-O?/} -O3" |
|
|
| 414 | export CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-exceptions -fno-rtti" |
588 | CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" |
| 415 | mysql_version_is_at_least "5.00.00.00" \ |
589 | mysql_version_is_at_least "5.00.00.00" \ |
| 416 | && export CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" |
590 | && CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" |
|
|
591 | export CXXFLAGS="${CXXFLAGS}" |
| 417 | |
592 | |
| 418 | econf \ |
593 | econf \ |
| 419 | --libexecdir="/usr/sbin" \ |
594 | --libexecdir="/usr/sbin" \ |
| 420 | --sysconfdir="${MY_SYSCONFDIR}" \ |
595 | --sysconfdir="${MY_SYSCONFDIR}" \ |
| 421 | --localstatedir="${MY_LOCALSTATEDIR}" \ |
596 | --localstatedir="${MY_LOCALSTATEDIR}" \ |
| … | |
… | |
| 455 | dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" |
630 | dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" |
| 456 | dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" |
631 | dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" |
| 457 | |
632 | |
| 458 | # Various junk (my-*.cnf moved elsewhere) |
633 | # Various junk (my-*.cnf moved elsewhere) |
| 459 | rm -Rf "${D}/usr/share/info" |
634 | rm -Rf "${D}/usr/share/info" |
| 460 | for removeme in "mysql-log-rotate" mysql.server* binary-configure* my-*.cnf mi_test_all* ; do |
635 | for removeme in "mysql-log-rotate" mysql.server* \ |
|
|
636 | binary-configure* my-*.cnf mi_test_all* |
|
|
637 | do |
| 461 | rm -f "${D}"/usr/share/mysql/${removeme} |
638 | rm -f "${D}"/usr/share/mysql/${removeme} |
| 462 | done |
639 | done |
| 463 | |
640 | |
| 464 | # Clean up stuff for a minimal build |
641 | # Clean up stuff for a minimal build |
| 465 | if useq "minimal" ; then |
642 | if useq "minimal" ; then |
| … | |
… | |
| 547 | mysql_pkg_postinst() { |
724 | mysql_pkg_postinst() { |
| 548 | # Make sure the vars are correctly initialized |
725 | # Make sure the vars are correctly initialized |
| 549 | mysql_init_vars |
726 | mysql_init_vars |
| 550 | |
727 | |
| 551 | # Check FEATURES="collision-protect" before removing this |
728 | # Check FEATURES="collision-protect" before removing this |
|
|
729 | [[ -d "${ROOT}/var/log/mysql" ]] \ |
| 552 | [[ -d "${ROOT}/var/log/mysql" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
730 | || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}" |
| 553 | |
731 | |
| 554 | # Secure the logfiles |
732 | # Secure the logfiles |
| 555 | touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} |
733 | touch "${ROOT}${MY_LOGDIR}"/mysql.{log,err} |
| 556 | chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* |
734 | chown mysql:mysql "${ROOT}${MY_LOGDIR}"/mysql* |
| 557 | chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* |
735 | chmod 0660 "${ROOT}${MY_LOGDIR}"/mysql* |
| … | |
… | |
| 564 | einfo "if this is a new install." |
742 | einfo "if this is a new install." |
| 565 | einfo |
743 | einfo |
| 566 | mysql_version_is_at_least "5.01.00.00" \ |
744 | mysql_version_is_at_least "5.01.00.00" \ |
| 567 | || einfo "InnoDB is *not* optional as of MySQL-4.0.24, at the request of upstream." |
745 | || einfo "InnoDB is *not* optional as of MySQL-4.0.24, at the request of upstream." |
| 568 | fi |
746 | fi |
|
|
747 | useq "berkdb" && ewarn "Berkley DB support is deprecated and will be removed in future versions" |
| 569 | } |
748 | } |
| 570 | |
749 | |
| 571 | mysql_pkg_config() { |
750 | mysql_pkg_config() { |
| 572 | # Make sure the vars are correctly initialized |
751 | # Make sure the vars are correctly initialized |
| 573 | mysql_init_vars |
752 | mysql_init_vars |