# $Id$ PNAME="mysql" PVER="5.5.15" PBUILD="r1" PCATEGORIE="dev-db" DESCRIPTION="MySQL is a SQL (Structured Query Language) database server." HOMEPAGE="http://www.mysql.com/" DEPEND=">= sys-libs/zlib-1.2" SRCFILE="${PNAME}-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" ALX_ONLY_KEEP="etc/mysql usr/bin/mysql usr/$(mlibdir)/*.so.* usr/$(mlibdir)/*.so usr/$(mlibdir)/mysql/*.so.* usr/$(mlibdir)/mysql/*.so" sminclude mtools alx-split SRC_URI=( ftp://ftp.mysql.com/pub/mysql/src/${SRCFILE} http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-${PVER%.*}/${SRCFILE} mirror://mysql5/${SRCFILE} mirror://mysql5/mysql5-${PVER}-cnf-defaults.patch ) UP2DATE="updatecmd http://dev.mysql.com/ | grep GA | sed 's/.*\ \([0-9].*\)/\1/;q'" src_prepare() { # warn about /proc in chroot environments [[ ! -d /proc/sys ]] && die "Please make sure /proc is mounted in chroot-environments." munpack ${SRCFILE} || die cd ${SRCDIR} # adjust default settings for magellan mpatch mysql5-${PVER}-cnf-defaults.patch || die } src_compile() { cd ${SRCDIR} # fixes some issues export CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing" export CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti -fno-implicit-templates" # fix PIC issues export CFLAGS="${CFLAGS} -fPIC" export CXXFLAGS="${CXXFLAGS} -fPIC" # --with-readline uses included readline, detection is broken mconfigure \ --libexecdir=/usr/sbin \ --sysconfdir=/etc/mysql \ --localstatedir=/var/lib/mysql \ --without-raid \ --with-low-memory \ --enable-assembler \ --with-charset=latin1 \ --with-collation=latin1_swedish_ci \ --enable-local-infile \ --with-mysqld-user=mysql \ --with-extra-charsets=none \ --enable-thread-safe-client \ --with-client-ldflags=-lstdc++ \ --with-comment="Magellan_MySQL_${PVER}-${PBUILD}" \ --with-unix-socket-path=/var/run/mysqld/mysqld.sock \ --enable-shared \ --disable-static \ --without-libwrap \ --without-ssl \ --without-debug \ --without-server \ --without-embedded-server \ --without-extra-tools \ --without-innodb \ --without-bench \ --without-berkeley-db \ --without-row-based-relication \ --with-readline \ || die mmake || die } alx_generic_src_install() { cd ${SRCDIR} mmake DESTDIR=${BINDIR} install || die # symlink client libs to libdir pushd ${BINDIR}/usr/$(mlibdir) || die for i in mysql/libmysqlclient{,_r}.so* do mlink ${i} /usr/$(mlibdir) || die done popd # remove all unneeded stuff local i # dirs for i in sql-bench mysql-test do if [[ -d ${BINDIR}/usr/${i} ]] then rm -r ${BINDIR}/usr/${i} || die fi done # files for i in share/mysql/mysql-log-rotate \ share/mysql/mysql.server* \ share/mysql/binary-configure* \ share/mysql/my-*.cnf \ share/mysql/mi_test_all* \ bin/comp_err do if [[ -f ${BINDIR}/usr/${i} ]] then rm ${BINDIR}/usr/${i} || die fi done # needed directories mkeepdir /var/lib/mysql || die mchown mysql:mysql /var/lib/mysql || die mchmod 0750 /var/lib/mysql || die mkeepdir /var/run/mysqld || die mchown mysql:mysql /var/run/mysqld || die mkeepdir /var/log/mysql || die mchown mysql:mysql /var/log/mysql || die # some common symlinks for i in mysqlanalyze mysqlrepair mysqloptimize do mlink mysqlcheck /usr/bin/${i} || die done minstalldocs ChangeLog COPYING EXCEPTIONS-CLIENT README || die minstalldocs support-files/my-*.cnf support-files/magic || die minstalldocs support-files/ndb-config-2-node.ini || die for i in scripts/mysql* do [[ ${i%.sh} == ${i} ]] && minstalldocs ${i} done # install a default my.cnf minstalldir /etc/mysql || die minstallfile support-files/my-medium.cnf /etc/mysql/my.cnf || die } preinstall() { add_conf_prot_mask /etc/mysql/my.cnf }