From d150a5f3e462fa7fe194a805a4aa0076f4d03ab9 Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Sun, 16 Sep 2018 18:48:36 +0200 Subject: Add ports. --- development/mariadb/mariadb.build | 198 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100755 development/mariadb/mariadb.build (limited to 'development/mariadb/mariadb.build') diff --git a/development/mariadb/mariadb.build b/development/mariadb/mariadb.build new file mode 100755 index 0000000..b1945e8 --- /dev/null +++ b/development/mariadb/mariadb.build @@ -0,0 +1,198 @@ +#!/bin/bash +# +# Maintainer: Deposite Pirate + +source /usr/src/ports/Build/build.sh + +NAME=mariadb +VERSION=5.5.30 +BUILD=1 +OPTDEPENDS=('openssl >= 1.0.1e-1') + +# Description + +cat > ${PKG}/install/slack-desc <> ${PKG}/install/doinst.sh < /dev/null 2> /dev/null ; then + true +else + echo "mariadb:x:27:27:MariaDB:/var/lib/mariadb:/bin/bash" >> etc/passwd +fi +if grep "^mariadb:x:" etc/group 1> /dev/null 2> /dev/null ; then + true +else + echo "mariadb:x:27:" >> etc/group +fi +if grep "^mariadb:" etc/shadow 1> /dev/null 2> /dev/null ; then + true +else + echo "mariadb:*:9797:0:::::" >> etc/shadow +fi + +# Fix directory permissions + +( + cd var/lib + chown mariadb.mariadb mariadb + chmod 750 mariadb +) + +# Create mariadb's run directory if it's not already there + +if [ ! -d run/mariadb ]; then + install -m 0750 -o mariadb -g mariadb -d run/mariadb +fi + +# Initialize the database if it isn't + +if [ ! -d var/lib/mariadb/mysql ]; then + usr/bin/mysql_install_db --user=mariadb --basedir=usr --datadir=var/lib/mariadb + chown -R mariadb.mariadb var/lib/mariadb &>/dev/null +fi + +# Keep same perms on rc.mariadb.new: + +if [ -e etc/rc.d/rc.mariadb ]; then + cp -a etc/rc.d/rc.mariadb etc/rc.d/rc.mariadb.new.incoming + cat etc/rc.d/rc.mariadb.new > etc/rc.d/rc.mariadb.new.incoming + mv etc/rc.d/rc.mariadb.new.incoming etc/rc.d/rc.mariadb.new +fi + +config etc/rc.d/rc.mariadb.new +config etc/mariadb/mysqlaccess.conf.new +config etc/mariadb/my.cnf.new +config etc/mariadb/my.cnf.d/client.cnf.new +config etc/mariadb/my.cnf.d/mysql-clients.cnf.new +config etc/mariadb/my.cnf.d/server.cnf.new +config etc/logrotate.d/mariadb.new +EOF + +# Sources + +SRCNAME[0]=${NAME} +SRCVERS[0]=${VERSION} +SRCPACK[0]=http://downloads.askmonty.org/f/${SRCNAME[0]}-${SRCVERS[0]}/kvm-tarbake-jaunty-x86/${SRCNAME[0]}-${SRCVERS[0]}.tar.gz +SRCCOPY[0]="GPL2 LGPL21" +# normla nostrip ? + +build0() +{ +cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DMANUFACTURER="Tightware" \ + -DCMAKE_C_FLAGS="-fPIC ${FLAGS} -DBIG_JOINS=1 -fno-strict-aliasing" \ + -DCMAKE_CXX_FLAGS="-fPIC ${FLAGS} -DBIG_JOINS=1 -fno-strict-aliasing -felide-constructors -fno-rtti" \ + -DWITH_MYSQLD_LDFLAGS="${LDFLAGS}" \ + -DCMAKE_INSTALL_PREFIX="${SYS_DIR[usr]}" \ + -DMYSQL_DATADIR="${SYS_DIR[var]}/lib/mariadb" \ + -DMYSQL_UNIX_ADDR="${SYS_DIR[run]}/mariadb/mariadb.sock" \ + -DINSTALL_SCRIPTDIR="${SYS_DIR[bin]}" \ + -DINSTALL_INCLUDEDIR="${SYS_DIR[include]}/mariadb" \ + -DINSTALL_SYSCONFDIR="${SYS_DIR[etc]}/mariadb" \ + -DINSTALL_MANDIR="${SYS_DIR[man]}" \ + -DINSTALL_PLUGINDIR="${SYS_DIR[lib]}/plugins/mariadb" \ + -DINSTALL_SHAREDIR="${SYS_DIR[share]}" \ + -DINSTALL_MYSQLSHAREDIR="share/application-data/mariadb" \ + -DINSTALL_SUPPORTFILESDIR="${SYS_DIR[doc]}/mariadb/sample" \ + -DINSTALL_DOCREADMEDIR="${SYS_DIR[doc]}/mariadb" \ + -DINSTALL_DOCDIR="${SYS_DIR[doc]}/mariadb" \ + -DINSTALL_SQLBENCHDIR="${SYS_DIR[usr]}/src" \ + -DINSTALL_MYSQLTESTDIR="${SYS_DIR[usr]}/src" \ + -DMYSQLD_USER="mariadb" \ + -DDEFAULT_CHARSET=utf8 \ + -DDEFAULT_COLLATION=utf8_general_ci \ + -DENABLED_LOCAL_INFILE=ON \ + -DUSE_ARIA_FOR_TMP_TABLES=ON \ + -DWITH_ZLIB=system \ + -DWITH_SSL=system \ + -DWITH_READLINE=ON \ + -DWITH_LIBWRAP=OFF \ + -DWITH_EXTRA_CHARSETS=complex \ + -DWITH_EMBEDDED_SERVER=ON \ + -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ + -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ + -DWITH_INNOBASE_STORAGE_ENGINE=1 \ + -DWITH_PARTITION_STORAGE_ENGINE=1 \ + -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \ + -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \ + -DWITHOUT_PBXT_STORAGE_ENGINE=1 \ +CMakeLists.txt +make ${JOBS} +make install DESTDIR="${PKG}" +install.dir ${PKG}${SYS_DIR[var]}/lib/mariadb +install.dir ${PKG}${SYS_DIR[etc]}/{rc.d,tmpfiles.d} +install.dat rc.mariadb.new ${PKG}${SYS_DIR[etc]}/rc.d/rc.mariadb.new +install.dat mariadb.conf.tmpfiles ${PKG}${SYS_DIR[etc]}/tmpfiles.d/mariadb.conf +install.dir ${PKG}${SYS_DIR[systemdsystemunitdir]} +install.dat mariadb.service ${PKG}${SYS_DIR[systemdsystemunitdir]} +install.bin mysqld-post.sh ${PKG}${SYS_DIR[bin]}/mysqld-post +install.dat support-files/{my-*.cnf,*.ini} ${PKG}${SYS_DIR[etc]}/mariadb +install.cfg scripts/mysqlaccess.conf ${PKG}${SYS_DIR[etc]}/mariadb +mv \ + ${PKG}${SYS_DIR[lib]}/plugins/mariadb/daemon_example.ini \ + ${PKG}${SYS_DIR[etc]}/mariadb +config ${PKG}${SYS_DIR[etc]}/logrotate.d/mariadb +config ${PKG}${SYS_DIR[etc]}/mariadb/mysqlaccess.conf +config ${PKG}${SYS_DIR[etc]}/mariadb/my.cnf +config ${PKG}${SYS_DIR[etc]}/mariadb/my.cnf.d/client.cnf +config ${PKG}${SYS_DIR[etc]}/mariadb/my.cnf.d/mysql-clients.cnf +config ${PKG}${SYS_DIR[etc]}/mariadb/my.cnf.d/server.cnf + +#FIXME: compat + +( + cd ${PKG}${SYS_DIR[include]} + ln -sf mariadb mysql +) + +# Unneeded stuff + +rm -rf \ + ${PKG}${SYS_DIR[lib]}/libmysql{d,client,client_r}.a \ + ${PKG}${SYS_DIR[bin]}/rcmysql \ + ${PKG}${SYS_DIR[etc]}/init.d \ + ${PKG}${SYS_DIR[man]}/man1/{mysqlman,mysql.server,mysql*test*.pl}.1 \ + ${PKG}${SYS_DIR[usr]}/src \ + ${PKG}${SYS_DIR[usr]}/data \ + ${PKG}${SYS_DIR[doc]}/mariadb + +#FIXME: Make subpackages of mysql-test and sql-bench +} -- cgit v1.2.3-70-g09d2