# mariadb/cfg - "Build" settings for package #--------------------------------------------------------------------- [technotes] 1. As of mid-2019, if "clang[++]" was used to build this package, the daemon installed (mysqld) crashed at startup. This happened for both release 10.2.24 and 10.3.15. #--------------------------------------------------------------------- 2. As of mid-2019, upstream release 10.3.15 couldn't be built using "gcc". #--------------------------------------------------------------------- 3. WARNING: A build of this package deletes all existing "mariadb" databases and creates a fresh "mariadb" setup. Presently, the "build" procedure aborts if it detects that there are existing "mariadb" databases. The new "mariadb" setup doesn't have a root password. The package "mariadb-pass" sets one when that package is built. #--------------------------------------------------------------------- 4. WARNING: If "purge" is set to "no", builds may fail. #--------------------------------------------------------------------- 5. Some usage examples: # Start the MySQL daemon # mysqld_safe --user=mysql >& /dev/null & # List accounts as Host, User pairs # Note: Blank User entries are apparently for anonymous access # echo "select Host, User from mysql.user;" | mysql -u root # Delete anonymous MySQL accounts # echo "drop user '';" | mysql -u root # Create MySQL-level user NAME for database DATABASE # echo "grant all on DATABASE.* to 'NAME'@'localhost';" \ | mysql -u root # Set password for MySQL-level user NAME to PASSWORD # echo "set password for \ 'NAME'@'localhost' = password('PASSWORD');" | mysql -u root # Create a database named "foo" # echo "create database foo;" | mysql -u root # Delete a database named "foo" # echo "drop database foo;" | mysql -u root #--------------------------------------------------------------------- 6. If the Linux account "mysql" and/or group "mysql" don't exist prior to a build of this package, the build will create either or both as necessary. If the "mysql" account is created, the account password will be set to a unique and non-recoverable string. This is O.K. as login to the account by password isn't needed. #--------------------------------------------------------------------- [buildtimes] 00.41 hours (or 024.77 minutes) - 2021 L.A. dedi box: 6x2 CPU 32GB RAM 00.63 hours (or 037.95 minutes) - ThinkPad W530 i7 4x2 32GB RAM 01.31 hours (or 078.47 minutes) - HP EliteBook 8560w 32GB RAM #--------------------------------------------------------------------- [settings] altpkg = yes compiler = gcc # See "technotes" in "cfg" file exepack = yes fortran = disabled license = See "license*.txt" in installed tree licfile = COPYING ltkludge = yes smptries = 10 tmpsize = 1842M unpack = relaxed dontfind = db openssl # Note: "bzip2" and "liblz4" are special cases. The "setpaths" list # shouldn't include these two packages. This would cause FTBFS at # compile time due to conflicts between external and internal files # with the same names. The following command needs to be done [on- # ly] at "cmake" time instead: # # . srcpkgpaths bzip2 liblz4 setpaths = \ gnutls3 libaio libevent2 libzmq mariadb \ ncurses readline zlib zstd #--------------------------------------------------------------------- [depends] actools bison3 boost brotli bzip2 cmake curl db gawk git gnutls3 grep libaio libedit libevent2 libffi libgmp libidn2 liblz4 liblzo2 libpsl librtmp libsasl libunistring libxml2 libzmq ncurses nettle3 numactl openldap openssl p11kit pcre pcre2 perl pkgconf procpsng readline ruby30:forward sed xzutils zlib zstd #--------------------------------------------------------------------- [configure] BINDIR=$PKGDIR_PROD/bin ETCDIR=$PKGDIR_PROD/etc LIBDIR=$PKGDIR_PROD/lib MANBASE=$PKGDIR_PROD/man SBINDIR=$PKGDIR_PROD/sbin SOCKPATH=/var/run/mysql/mysql.sock DATADIR=/var/cache/mysql TESTDIR=$PKGDIR_PROD/test #--------------------------------------------------------------------- killall -qw --signal SIGTERM mariadbd || true killall -qw --signal SIGTERM mysqld || true killany -9 mysqld || true #--------------------------------------------------------------------- if [ -d $DATADIR ]; then cat << END Error: MariaDB data directory already exists: $DATADIR The MariaDB package build procedure will delete the data directory. If you know what you're doing, stop the MariaDB service, move the dir- ectory somewhere else, build the package, stop the service again, and restore a copy of the directory. It may be safer to export all databases and to import them after the build. If the software is updated as well as rebuilt, the new release may not be backwards-compatible with existing formats. END exit 1 fi #--------------------------------------------------------------------- rm -fr $DATADIR /var/run/mysql mkdir -p $BINDIR $ETCDIR $LIBDIR $MANBASE \ $SBINDIR $TESTDIR #--------------------------------------------------------------------- APASS=`od -Anone /dev/random | head -1 | sed -e 's/ //g'` mkdir -p /home/jail if test -z "`grep '^mysql:' /etc/group`" ; then groupadd mysql fi if test -z "`grep '^mysql:' /etc/passwd`" ; then useradd mysql -g mysql -d /home/jail \ -s /bin/bash -p $APASS fi #--------------------------------------------------------------------- for dir in cache lib run do mkdir -p /var/$dir/mysql chmod 755 /var/$dir/mysql chown -R mysql.mysql /var/$dir/mysql done AS=ADD_SUBDIRECTORY # sed -e "/$AS(sql\/share)/d" \ -i CMakeLists.txt sed -e "s/$AS(libmysql)/&\\n$AS(sql\/share)/" \ -i CMakeLists.txt sed -e "s@data/test@\${INSTALL_MYSQLSHAREDIR}@g" \ -i sql/CMakeLists.txt sed -e "s@data/mysql@\${INSTALL_MYSQLTESTDIR}@g" \ -i sql/CMakeLists.txt # Needed for 10.2.X: # sed -e "s@data/test@\${INSTALL_MYSQLTESTDIR}@g" \ -i sql/CMakeLists.txt sed -e '/void..coc_malloc/{s/char ./&x/; s/int/& y/}' \ -i mysys_ssl/openssl.c mkdir build cd build mkdir -p sql/share P=$PKGDIR_PROD # This step should only be done at "cmake" time: # . srcpkgpaths bzip2 liblz4 # The following "cmake"-time switch settings seem no longer to work # with absolute paths: # # -DINSTALL_SBINDIR=$P/sbin \ # -DINSTALL_SCRIPTDIR=$P/bin \ # -DINSTALL_INCLUDEDIR=$P/include/mysql \ # -DINSTALL_PLUGINDIR=$P/lib/mysql/plugin \ # # -DINSTALL_DOCDIR=$P/share/doc/mysql \ # -DINSTALL_DOCREADMEDIR=$P/share/doc/mysql \ # -DINSTALL_INFODIR=$P/share/info \ # -DINSTALL_MANDIR=$P/share/man \ # -DINSTALL_MYSQLSHAREDIR=$P/share/mysql \ # -DINSTALL_MYSQLTESTDIR=$P/share/mysql/test \ # -DINSTALL_SQLBENCHDIR=$P/share/mysql/bench \ # -DINSTALL_SUPPORTFILESDIR=$P/share/mysql \ cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=$P \ \ -DINSTALL_MYSQLDATADIR=$DATADIR \ -DMYSQL_DATADIR=$DATADIR \ -DMYSQL_UNIX_ADDR=$SOCKPATH \ -DSYSCONFDIR=$ETCDIR \ -DTOKUDB_OK=0 \ \ -DWITH_EMBEDDED_SERVER=ON \ -DWITH_EXTRA_CHARSETS=complex \ -DWITH_LIBEVENT=system \ -DHAVE_PWD_H=ON \ -DSKIP_TESTS=ON \ -DWITH_SSL=bundled \ .. #--------------------------------------------------------------------- [build] cd build smpmake && make install #--------------------------------------------------------------------- [postbuild] BINDIR=$PKGDIR_PROD/bin ETCDIR=$PKGDIR_PROD/etc INCDIR=$PKGDIR_PROD/include LIBDIR=$PKGDIR_PROD/lib SBINDIR=$PKGDIR_PROD/sbin SHADIR=$PKGDIR_PROD/share TESTDIR=$PKGDIR_PROD/test DATADIR=/var/cache/mysql echo postbuild started EMDIR=$PKGDIR_PROD/share/mysql/english mkdir -p $EMDIR cp -p build/sql/share/english/errmsg.sys $EMDIR/ sed -e "s|__META_PREFIX__|$PKGDIR_PROD|g" \ -e "s|__META_EMDIR__|$EMDIR|g" \ < $PKGDIR_SPECIAL/my.cnf.in \ > $ETCDIR/my.cnf for dir in cache lib run do rm -fr /var/$dir/mysql mkdir -p /var/$dir/mysql chmod 755 /var/$dir/mysql chown -R mysql.mysql /var/$dir/mysql done cd $LIBDIR if [ \! -d mysql ]; then ln -nsf . mysql fi cd $SHADIR if [ \! -d mysql ]; then ln -nsf . mysql fi if [ \! -d english ]; then if [ -d mysql/english ]; then ln -nsf mysql/english . fi fi cd $BINDIR ln -nsf ../scripts/* . PATH=$BINDIR:$SBINDIR:$PATH echo Running mysql_install_db echo mysql_install_db \ --basedir=$PKGDIR_PROD \ --datadir=$DATADIR mysql_install_db \ --basedir=$PKGDIR_PROD \ --datadir=$DATADIR cd $SBINDIR sed -e "s|__META_LACUTIL__|$SYSDIR_LACUTIL|g" \ -e "s|__META_PREFIX__|$PKGDIR_PROD|g" \ -e "s|__META_PRODTREE__|$PRODTREE|g" \ < $PKGDIR_SPECIAL/mysql-start.in \ > mysql-start chmod 755 mysql-start cd $INCDIR/mysql ln -nsf mariadb_version.h mysql_version.h cd $INCDIR/mysql H="#" for x in *.h do cat > ../$x << END ${H}include END done #--------------------------------------------------------------------- [setup.boot] #--------------------------------------------------------------------- APASS=`od -Anone /dev/random | head -1 | sed -e 's/ //g'` mkdir -p /home/jail if test -z "`grep '^mysql:' /etc/group`" ; then groupadd mysql fi if test -z "`grep '^mysql:' /etc/passwd`" ; then useradd mysql -g mysql -d /home/jail \ -s /bin/bash -p $APASS fi #--------------------------------------------------------------------- for dir in cache lib run do mkdir -p /var/$dir/mysql chmod 755 /var/$dir/mysql chown -R mysql.mysql /var/$dir/mysql done #--------------------------------------------------------------------- # Original URLs. These URLs were valid at one point, but may have died # since then. If you download newer versions of tarballs [etc.], don't # delete the original versions, as you may not be able to replace # them. [urls] url_debian = tbd url_home = http://www.mariadb.com/ url_lfs = http://www.linuxfromscratch.org/blfs/view/stable/\ server/mysql.html url_tarball = https://downloads.mariadb.org/interstitial/\ mariadb-10.11.8/source/mariadb-10.11.8.tar.gz #--------------------------------------------------------------------- [history] 170809 Added package. Started with 10.2.7. 170820 Updated to 10.2.8 170928 Updated to 10.2.9 171201 Updated to 10.2.11 180108 Updated to 10.2.12 180303 Updated to 10.2.13 180329 Updated to 10.2.14 180518 Updated to 10.2.15 180624 Updated to 10.3.7 180704 Updated to 10.3.8 180815 Updated to 10.3.9 181006 Updated to 10.3.10 181121 Updated to 10.3.11 190112 Updated to 10.3.12 190222 Updated to 10.3.13 190404 Updated to 10.3.14 190514 Updated to 10.3.15 190529 Downdated to 10.2.24 190721 Updated to 10.2.25 190808 Updated to 10.2.26 190929 Updated to 10.2.27 210218 Updated to 10.5.8 210223 Updated to 10.5.9 210706 Updated to 10.5.11 211019 Updated to 10.5.12 211212 Updated to 10.6.5 220802 Updated to 10.6.8 220817 Updated to 10.6.9 220818 Updated to 10.8.4 230122 Updated to 10.8.6 240628 Updated to 10.11.8