summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO49
-rw-r--r--PKGBUILD84
-rw-r--r--mariadb-post.sh8
-rw-r--r--mariadb-tmpfile.conf1
-rw-r--r--mariadb.install65
-rw-r--r--mariadb.service16
6 files changed, 223 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..14aa26488af
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,49 @@
+pkgbase = mroonga
+ pkgdesc = Fast fulltext search on MySQL(MariaDB and groonga bundled package).
+ pkgver = 5.03
+ pkgrel = 2
+ url = http://mroonga.org/
+ arch = i686
+ arch = x86_64
+ license = LGPL2
+ makedepends = cmake
+ makedepends = openssl
+ makedepends = zlib
+ makedepends = libaio
+ makedepends = libxml2
+ makedepends = pcre
+ makedepends = jemalloc
+ makedepends = lz4
+ depends = perl
+ depends = inetutils
+ depends = libaio
+ depends = libxml2
+ depends = pcre
+ optdepends = cutter-test_framework
+ optdepends = ruby
+ optdepends = snowball-c
+ provides = groonga=5.0.4
+ provides = mysql-clients=10.0.19
+ provides = mysql=10.0.19
+ provides = libmysqlclient=10.0.19
+ conflicts = libmariadbclient
+ conflicts = mariadb-clients
+ conflicts = mytop
+ conflicts = mariadb
+ conflicts = mysql
+ conflicts = libmysqlclient
+ conflicts = mysql-clients
+ conflicts = groonga
+ source = http://packages.groonga.org/source/mroonga/mariadb-10.0.19-with-mroonga-5.03.tar.gz
+ source = mariadb.service
+ source = mariadb-post.sh
+ source = mariadb-tmpfile.conf
+ sha1sums = 78fdb3c8e1663cfa7edc7bc0e91ed3f89aab08b8
+ sha1sums = 4bc34244fc4b578c155c8cd569d952a97a476f10
+ sha1sums = 206e9f7ba5357027becc2491e0987442f684d63e
+ sha1sums = c2a86c745002923234f9d6d79b3b462d5ab55e8d
+
+pkgname = mroonga
+ install = mariadb.install
+ backup = etc/mysql/my.cnf
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..2dfcc10105e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,84 @@
+pkgname=mroonga
+pkgver=5.03
+pkgrel=2
+pkgdesc="Fast fulltext search on MySQL(MariaDB and groonga bundled package)."
+mariadbver=10.0.19
+groongaver=5.0.4
+arch=('i686' 'x86_64')
+url="http://mroonga.org/"
+license=('LGPL2')
+provides=("groonga=$groongaver" "mysql-clients=$mariadbver" "mysql=$mariadbver" "libmysqlclient=$mariadbver")
+source=(http://packages.groonga.org/source/mroonga/mariadb-$mariadbver-with-$pkgname-$pkgver.tar.gz
+ mariadb.service
+ mariadb-post.sh
+ mariadb-tmpfile.conf)
+makedepends=('cmake' 'openssl' 'zlib' 'libaio' 'libxml2' 'pcre' 'jemalloc' 'lz4')
+conflicts=('libmariadbclient' 'mariadb-clients' 'mytop' 'mariadb' 'mysql' 'libmysqlclient' 'mysql-clients' 'groonga')
+depends=('perl' 'inetutils' 'libaio' 'libxml2' 'pcre')
+optdepends=('cutter-test_framework' 'ruby' 'snowball-c')
+
+build() {
+ cd $srcdir/mariadb-$mariadbver-with-$pkgname-$pkgver
+ cmake . \
+ -DBUILD_CONFIG=mysql_release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DSYSCONFDIR=/etc/mysql \
+ -DMYSQL_DATADIR=/var/lib/mysql \
+ -DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
+ -DDEFAULT_CHARSET=utf8 \
+ -DDEFAULT_COLLATION=utf8_general_ci \
+ -DENABLED_LOCAL_INFILE=ON \
+ -DINSTALL_INFODIR=share/mysql/docs \
+ -DINSTALL_MANDIR=share/man \
+ -DINSTALL_PLUGINDIR=lib/mysql/plugin \
+ -DINSTALL_SCRIPTDIR=bin \
+ -DINSTALL_INCLUDEDIR=include/mysql \
+ -DINSTALL_DOCREADMEDIR=share/mysql \
+ -DINSTALL_SUPPORTFILESDIR=share/mysql \
+ -DINSTALL_MYSQLSHAREDIR=share/mysql \
+ -DINSTALL_DOCDIR=share/mysql/docs \
+ -DINSTALL_SHAREDIR=share/mysql \
+ -DWITH_READLINE=ON \
+ -DWITH_ZLIB=system \
+ -DWITH_LZ4=ON \
+ -DWITH_SSL=system \
+ -DWITH_PCRE=system \
+ -DWITH_LIBWRAP=OFF \
+ -DWITH_JEMALLOC=ON \
+ -DCMAKE_EXE_LINKER_FLAGS='-ljemalloc' \
+ -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 \
+ -DWITH_TOKUDB_STORAGE_ENGINE=1 \
+ -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
+ -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \
+ -DWITHOUT_PBXT_STORAGE_ENGINE=1 \
+ -DWITHOUT_TOKUDB=1 \
+ -DCMAKE_C_FLAGS="-fPIC $CFLAGS -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer -fno-delete-null-pointer-checks" \
+ -DCMAKE_CXX_FLAGS="-fPIC $CXXFLAGS -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti -fno-delete-null-pointer-checks" \
+ -DWITH_MYSQLD_LDFLAGS="-pie $LDFLAGS,-z,now"
+
+ make
+}
+
+package() {
+ backup=('etc/mysql/my.cnf')
+ install=mariadb.install
+ cd $srcdir/mariadb-$mariadbver-with-$pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
+
+ # not needed for using Mroonga just for testing.
+ rm -r "$pkgdir"/usr/{data,mysql-test,sql-bench}
+ rm "$pkgdir"/usr/share/man/man1/mysql-test-run.pl.1
+
+ install -Dm755 ../mariadb-post.sh "$pkgdir"/usr/bin/mysqld-post
+ install -Dm644 ../mariadb.service "$pkgdir"/usr/lib/systemd/system/mysqld.service
+ install -Dm644 ../mariadb-tmpfile.conf "$pkgdir"/usr/lib/tmpfiles.d/mysql.conf
+}
+sha1sums=('78fdb3c8e1663cfa7edc7bc0e91ed3f89aab08b8'
+ '4bc34244fc4b578c155c8cd569d952a97a476f10'
+ '206e9f7ba5357027becc2491e0987442f684d63e'
+ 'c2a86c745002923234f9d6d79b3b462d5ab55e8d')
diff --git a/mariadb-post.sh b/mariadb-post.sh
new file mode 100644
index 00000000000..c4ac181710d
--- /dev/null
+++ b/mariadb-post.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+while true; do
+ response=$(/usr/bin/mysqladmin -uUNKNOWN_USER ping 2>&1) && break
+ echo "$response" | grep -q "mysqld is alive" && break
+ echo "$response" | grep -q "Access denied for user" && break
+ sleep 1
+done
diff --git a/mariadb-tmpfile.conf b/mariadb-tmpfile.conf
new file mode 100644
index 00000000000..6883dc79888
--- /dev/null
+++ b/mariadb-tmpfile.conf
@@ -0,0 +1 @@
+d /run/mysqld 0755 mysql mysql -
diff --git a/mariadb.install b/mariadb.install
new file mode 100644
index 00000000000..43a9fae3814
--- /dev/null
+++ b/mariadb.install
@@ -0,0 +1,65 @@
+if [[ $(command -v my_print_defaults >/dev/null 2>&1) ]]; then
+ datadir=$(my_print_defaults mysqld | sed -n "s/^--datadir=//p")
+fi
+[[ -z $datadir ]] && datadir=/var/lib/mysql
+
+install_mroonga_announce() {
+ install_sql=/usr/share/mroonga/install.sql
+ echo "run the following command to register Mroonga:"; \
+ command="/usr/bin/mysql -u root < ${install_sql}"
+ echo $command
+}
+
+uninstall_mroonga_announce() {
+ uninstall_sql=/usr/share/mroonga/uninstall.sql
+ echo "run the following command to unregister Mroonga:"; \
+ command="/usr/bin/mysql -u root < ${uninstall_sql}"
+ echo $command
+}
+
+post_install(){
+ groupadd -g 89 mysql &>/dev/null
+ useradd -u 89 -g mysql -d $datadir -s /bin/false mysql &>/dev/null
+
+ if [[ ! -e $datadir ]]; then
+ install -dm700 $datadir
+ usr/bin/mysql_install_db --user=mysql --basedir=/usr --datadir=$datadir
+ chown -R mysql:mysql var/lib/mysql &>/dev/null
+ fi
+
+ install_mroonga_announce
+ uninstall_mroonga_announce
+ usr/bin/systemd-tmpfiles --create mysql.conf
+}
+
+post_upgrade(){
+ getent group mysql >/dev/null 2>&1 || groupadd -g 89 mysql &>/dev/null
+ getent passwd mysql >/dev/null 2>&1 || useradd -u 89 -g mysql -d $datadir -s /bin/false mysql &>/dev/null
+
+ if [[ "$(vercmp $2 5.5.25-4)" -lt 0 ]] && [[ -d /data ]]; then
+ for x in data/*; do
+ cp -r $x $datadir/
+ done
+ rm -rf data
+ fi
+
+ if [[ "$(vercmp $2 5.5.25-5)" -lt 0 ]]; then
+ echo ":: mysql.service has been renamed to mysqld.service to keep"
+ echo " consistency with MySQL package."
+ fi
+
+ if [[ "$(vercmp $2 10.0)" -lt 0 ]]; then
+ echo ":: Major version update. Consider restarting mysqld.service and"
+ echo " running mysql_upgrade afterwards."
+ fi
+}
+
+post_remove(){
+ if getent passwd mysql >/dev/null 2>&1; then
+ userdel mysql
+ fi
+
+ if getent group mysql >/dev/null 2>&1; then
+ groupdel mysql
+ fi
+}
diff --git a/mariadb.service b/mariadb.service
new file mode 100644
index 00000000000..28ab26ee44d
--- /dev/null
+++ b/mariadb.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=MariaDB database server (MySQL compatibility service)
+After=syslog.target
+
+[Service]
+User=mysql
+Group=mysql
+
+ExecStart=/usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid
+ExecStartPost=/usr/bin/mysqld-post
+
+Restart=always
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target