#!/bin/bash # mysql.SlackBuild # Build and install MySQL on Slackware # Author....................: David Cantrell # Currently maintained by...: Patrick Volkerding # Modified for ARMedslack by: Stuart Winter # 19-Sep-2004 # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PACKAGE export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PACKAGE export PKG=$TMP/package-$PACKAGE mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Determine the CFLAGS for the known architectures: case $PORTARCH in arm) export SLKCFLAGS="-O2 -march=armv3 -mtune=xscale" ;; powerpc) export SLKCFLAGS="-O2" ;; sparc) export SLKCFLAGS="-O2" ;; esac # Extract source: tar jxvvf $CWD/$PACKAGE-$VERSION.tar.bz2 cd $PACKAGE-$VERSION slackhousekeeping # Create the package framework: mkdir -p $PKG/{etc/rc.d,usr/doc/$PACKAGE-$VERSION/Docs} # this is the directory where databases are stored mkdir -pm750 $PKG/var/lib/mysql chown mysql:mysql $PKG/var/lib/mysql # this is where the socket is stored mkdir -pm755 $PKG/var/run/mysql chown mysql:mysql $PKG/var/run/mysql # Configure: CFLAGS="$SLKCFLAGS" \ CXX=gcc \ CXXFLAGS="$SLKCFLAGS -felide-constructors -fno-exceptions -fno-rtti" \ ./configure \ --prefix=/usr \ --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 \ --program-prefix="" \ --program-suffix="" \ $ARCH-slackware-linux || failconfig # # --without-readline # Build: make || failmake # Install into package: make install DESTDIR=$PKG || failinstall # Install sample config files: ( cd support-files install -m644 my-huge.cnf my-large.cnf my-medium.cnf my-small.cnf $PKG/etc ) # Install docs: cp -a COPYING* MIRRORS README $PKG/usr/doc/$PACKAGE-$VERSION ( cd Docs cp -a INSTALL-BINARY *.html *.txt Flags \ $PKG/usr/doc/$PACKAGE-$VERSION/Docs ) rm -f $PKG/usr/doc/mysql-$VERSION/Docs/manual.txt # Do not include the test suite: rm -rf $PKG/usr/mysql-test # Add init script - intentionally chmod 644: zcat $CWD/rc.mysqld.gz > $PKG/etc/rc.d/rc.mysqld.new # Add some handy library symlinks: if [ -r $PKG/usr/lib/mysql/libmysqlclient.so.15 ]; then ( cd $PKG/usr/lib 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/mysql/libmysqlclient_r.so.15 ]; then ( cd $PKG/usr/lib 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 # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh # Build the package: if [ $PORTARCH = arm ]; then slackmp # run makepkg else makepkg -l y -c n $PKGSTORE/$PKGSERIES/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz fi # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links