#!/bin/sh # Build and install MySQL on Slackware # by: David Cantrell # Currently maintained by: Patrick Volkerding CWD=`pwd` TMP=${TMP:-/tmp} if [ ! -d $TMP ]; then mkdir -p $TMP fi PKG=$TMP/package-devel32 mkdir -p $PKG VERSION=5.0.67 ARCH=${ARCH:-x86_64} BUILD=${BUILD:-1} DISTRO=${DISTRO:-slamd64} if [ $DISTRO = slackware ]; then PKGARCH=$ARCH else PKGARCH=${ARCH}_${DISTRO} fi if [ $DISTRO = slamd64 ]; then LIBSUFFIX=${LIBSUFFIX:-64} fi if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi cd $TMP rm -rf mysql-$VERSION tar xjvf $CWD/mysql-$VERSION.tar.bz2 cd mysql-$VERSION chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ -exec chmod 755 {} \; -o \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS -felide-constructors -fno-exceptions -fno-rtti" \ CXX=gcc \ ./configure \ --prefix=/usr \ --libdir=/usr/lib$LIBSUFFIX \ --with-mysqld-user=mysql \ --with-unix-socket-path=/var/run/mysql/mysql.sock \ --localstatedir=/var/lib/mysql \ --enable-assembler \ --with-raid \ --without-debug \ --enable-thread-safe-client \ --without-bench \ --with-extra-charsets=complex \ --with-vio \ --with-openssl \ --build=$ARCH-slackware-linux # # --without-readline make -j6 || exit 1 make install DESTDIR=$PKG ( # Stuff we want from the 64-bit package instead, or don't want at all cd $PKG rm -rf usr/{info,libexec,man,mysql-test} rm usr/bin/* ) # Strip ELF objects: ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Add some handy library symlinks: if [ -r $PKG/usr/lib$LIBSUFFIX/mysql/libmysqlclient.so.15 ]; then ( cd $PKG/usr/lib$LIBSUFFIX rm -f libmysqlclient.so libmysqlclient.so.15 ln -sf mysql/libmysqlclient.so . ln -sf mysql/libmysqlclient.so.15 . ) else exit 1 fi if [ -r $PKG/usr/lib$LIBSUFFIX/mysql/libmysqlclient_r.so.15 ]; then ( cd $PKG/usr/lib$LIBSUFFIX rm -f libmysqlclient_r.so libmysqlclient_r.so.15 ln -sf mysql/libmysqlclient_r.so . ln -sf mysql/libmysqlclient_r.so.15 . ) else exit 1 fi