DOCS="COPY* MIRRORS README Docs/*.html"
IGNOREPATH=/boot:/dev:/home:/mnt:/proc:/root:/tmp:/var:/storage
STRIPLIB=y
STRIPBIN=y
SETATTR=y
# pkginfo
VERSION=3.23.36
PROGNAME="MySQL 3.23.36"
DESC="\
MySQL is a true multi-user, multi-threaded SQL database server. MySQL is a\n\
client/server implementation that consists of a server daemon and many\n\
different client programs and libraries."
# maintainer
BUILD=1
MAINTAINER="Robert Stan TG "
SOURCE=http://www.mysql.com
LOCATION=ftp://ftp.linuxmafia.org/pub/Slackware-7/robert/mysql-3.23.36
# package name
PKGNAME=mysql
compile() {
tar xvzf $CWD/$PKGNAME-$VERSION.tar.gz
cd $PKGNAME-$VERSION
CFLAGS="-O6 -mpentiumpro -fomit-frame-pointer" CXX=gcc \
CXXFLAGS="-O6 -mpentiumpro -fomit-frame-pointer \
-felide-constructors -fno-exceptions -fno-rtti" ./configure \
--enable-assembler \
--with-mysqld-ldflags=-all-static \
--disable-shared \
--prefix=/ \
--exec-prefix=/usr \
--libexecdir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--localstatedir=/var/lib/mysql \
--infodir=/usr/info \
--includedir=/usr/include \
--mandir=/usr/man \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-extra-charsets=complex \
--without-debug \
--without-docs \
--without-bench \
--with-mysqld-user=mysql
#--with-berkeley-db=/usr \
#--with-raid
make -j2
}
install() {
make install
cat Docs/mysql.info > /usr/info/mysql.info
mkdir -p /usr/doc/$PKGNAME-$VERSION
cp -a $DOCS /usr/doc/$PKGNAME-$VERSION
# Create sysv style dirs if needed
if test ! -d /etc/rc.d/init.d; then mkdir -p /etc/rc.d/init.d; fi
if test ! -d /etc/rc.d/rc3.d; then mkdir -p /etc/rc.d/rc3.d;
fi
if test ! -d /etc/rc.d/rc6.d; then mkdir -p /etc/rc.d/rc6.d;
fi
cat /usr/share/mysql/mysql.server > /etc/rc.d/init.d/mysql
chmod 755 /etc/rc.d/init.d/mysql
}
attributes() {
echo "No special attributes..."
}
special() {
cat << EOF >> $CTL/doinst.sh
# Create data directory if needed
if test ! -d /var/lib/mysql; then mkdir -p /var/lib/mysql; fi
if test ! -d /var/lib/mysql/mysql; then mkdir -p /var/lib/mysql/mysql; fi
if test ! -d /var/lib/mysql/test; then mkdir -p /var/lib/mysql/test; fi
# Make MySQL start/shutdown automatically when the machine does it.
ln -s /etc/rc.d/init.d/mysql /etc/rc.d/rc3.d/S90mysql
ln -s /etc/rc.d/init.d/mysql /etc/rc.d/rc6.d/K90mysql
# Create a MySQL user. Do not report any problems if it already exists.
groupadd mysql 2> /dev/null || true
useradd -M -g mysql -d /var/lib/mysql -s /dev/null -c "MySQL server" mysql 2> /dev/null || true
# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
chown -R mysql.mysql /var/lib/mysql
# Initiate databases
mysql_install_db -IN-RPM
# Change permissions again to fix any new files.
chown -R mysql.mysql /var/lib/mysql
# Fix permissions for the permission database so that only the user
# can read them.
chmod -R og-rw /var/lib/mysql/mysql
# Restart in the same way that mysqld will be started normally.
/etc/rc.d/init.d/mysql start
EOF
}
subpacks() {
echo "No subpacks..."
}