X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from ncopa-desktop.alpinelinux.org (unknown [79.160.13.133]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: n@tanael.org) by mail.alpinelinux.org (Postfix) with ESMTPSA id 58049DC0D9B; Thu, 15 Jan 2015 11:00:55 +0000 (UTC) Date: Thu, 15 Jan 2015 12:00:52 +0100 From: Natanael Copa To: =?ISO-8859-1?B?KnVrYXN6?= Jendrysik Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] [PATCH] testing/mariadb: new aport Message-ID: <20150115120052.46719101@ncopa-desktop.alpinelinux.org> In-Reply-To: <1420286532-12015-1-git-send-email-scadu@yandex.com> References: <1420286532-12015-1-git-send-email-scadu@yandex.com> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.25; x86_64-alpine-linux-musl) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sat, 3 Jan 2015 13:02:12 +0100 *ukasz Jendrysik wrote: > An initial commit preparing Alpine for migration to MariaDB. >=20 > Signed-off-by: *ukasz Jendrysik > --- > testing/mariadb/APKBUILD | 194 +++++++++++++++++++++++++= ++++++ > testing/mariadb/fix-xtradb-storage.patch | 38 ++++++ > testing/mariadb/mariadb.initd | 58 +++++++++ > 3 files changed, 290 insertions(+) > create mode 100644 testing/mariadb/APKBUILD > create mode 100644 testing/mariadb/fix-xtradb-storage.patch > create mode 100644 testing/mariadb/mariadb.initd Thank you very much! I disabled toku storage engine to be able to build it on x86_64. I am a bit interested to know if jemalloc actually gives any significant improvement compared to musl libc malloc. -nc > diff --git a/testing/mariadb/APKBUILD b/testing/mariadb/APKBUILD > new file mode 100644 > index 0000000..cf2d8b3 > --- /dev/null > +++ b/testing/mariadb/APKBUILD > @@ -0,0 +1,194 @@ > +# Contributor: *ukasz Jendrysik > +# Contributor: Carlo Landmeter > +# Maintainer: Natanael Copa > +pkgname=3Dmariadb > +pkgver=3D5.5.41 > +pkgrel=3D0 > +pkgdesc=3D"A fast SQL database server" > +url=3D"http://www.mariadb.org" > +pkgusers=3D"mysql" > +pkggroups=3D"mysql" > +arch=3D"all" > +license=3D'GPL' > +depends=3D"" > +depends_dev=3D"openssl-dev zlib-dev" > +makedepends=3D"cmake openssl-dev zlib-dev readline-dev libaio-dev ncurse= s-dev jemalloc-dev glib linux-headers libc-dev" > +source=3D"https://downloads.mariadb.org/interstitial/mariadb-$pkgver/sou= rce/mariadb-$pkgver.tar.gz > +$pkgname.initd > +fix-xtradb-storage.patch > +" > + > +subpackages=3D"$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-common $= pkgname-client $pkgname-bench $pkgname-test:mytest" > + > +_builddir=3D"$srcdir/$pkgname-$pkgver" > + > +prepare() { > + cd "$_builddir" > + for i in $source; do > + case $i in > + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; > + esac > + done > +} > + > +build() { > + cd "$_builddir" > + cmake . -DBUILD_CONFIG=3Dmysql_release \ > + -DCMAKE_INSTALL_PREFIX=3D/usr \ > + -DSYSCONFDIR=3D/etc/mysql \ > + -DMYSQL_DATADIR=3D/var/lib/mysql \ > + -DMYSQL_UNIX_ADDR=3D/run/mysqld/mysqld.sock \ > + -DDEFAULT_CHARSET=3Dutf8 \ > + -DDEFAULT_COLLATION=3Dutf8_general_ci \ > + -DENABLED_LOCAL_INFILE=3DON \ > + -DINSTALL_INFODIR=3Dshare/mysql/docs \ > + -DINSTALL_MANDIR=3Dshare/man \ > + -DINSTALL_PLUGINDIR=3Dlib/mysql/plugin \ > + -DINSTALL_SCRIPTDIR=3Dbin \ > + -DINSTALL_INCLUDEDIR=3Dinclude/mysql \ > + -DINSTALL_DOCREADMEDIR=3Dshare/mysql \ > + -DINSTALL_SUPPORTFILESDIR=3Dshare/mysql \ > + -DINSTALL_MYSQLSHAREDIR=3Dshare/mysql \ > + -DINSTALL_DOCDIR=3Dshare/mysql/docs \ > + -DINSTALL_SHAREDIR=3Dshare/mysql \ > + -DWITH_READLINE=3DON \ > + -DWITH_ZLIB=3Dsystem \ > + -DWITH_SSL=3Dsystem \ > + -DWITH_LIBWRAP=3DOFF \ > + -DWITH_EXTRA_CHARSETS=3Dcomplex \ > + -DWITH_EMBEDDED_SERVER=3DON \ > + -DWITH_ARCHIVE_STORAGE_ENGINE=3D1 \ > + -DWITH_BLACKHOLE_STORAGE_ENGINE=3D1 \ > + -DWITH_INNOBASE_STORAGE_ENGINE=3D1 \ > + -DWITH_PARTITION_STORAGE_ENGINE=3D1 \ > + -DWITH_TOKUDB_STORAGE_ENGINE=3D1 \ > + -DWITHOUT_EXAMPLE_STORAGE_ENGINE=3D1 \ > + -DWITHOUT_FEDERATED_STORAGE_ENGINE=3D1 \ > + -DWITHOUT_PBXT_STORAGE_ENGINE=3D1 \ > + || return 1 > + make || return 1 > +} > + > +package() { > + cd "$_builddir" > + make DESTDIR=3D"$pkgdir/" install || return 1 > + > + install -Dm 755 "$startdir"/$pkgname.initd \ > + "$pkgdir"/etc/init.d/$pkgname || return 1 > + > + # use small example config as default, which has tcp disabled > + install -D "$pkgdir"/usr/share/mysql/my-medium.cnf \ > + "$pkgdir"/etc/mysql/my.cnf || return 1 > + > + install -dDo mysql "$pkgdir"/var/log/mysql || return 1 > + install -dDo mysql "$pkgdir"/var/run/mysqld || return 1 > + > + # libmysqlclient_r is no more. Upstream tries to replace it with > + # symlinks but that really doesn't work (wrong soname in particular). > + # We'll keep just the devel libmysqlclient_r.so link, so that > + # rebuilding without any source change is enough to get rid of > + # dependency on libmysqlclient_r. > + rm -f "$pkgdir"/usr/lib/libmysqlclient_r.so* > + ln -s libmysqlclient.so "$pkgdir"/usr/lib/libmysqlclient_r.so > + > + # mysql-test includes one executable that doesn't belong under > + # /usr/share, so move it and provide a symlink > + mv "$pkgdir"/usr/mysql-test/lib/My/SafeProcess/my_safe_process \ > + "$pkgdir"/usr/bin > + ln -s ../../../../bin/my_safe_process \ > + "$pkgdir"/usr/mysql-test/lib/My/SafeProcess/my_safe_process > + > +} > + > +dev(){ > + default_dev > + replaces=3D"libmysqlclient" > +} > + > +libs() { > + pkgdesc=3D"MariaDB client library" > + replaces=3D"mariadb libmysqlclient" > + depends=3D"mariadb-common" > + mkdir -p "$subpkgdir"/usr/lib \ > + "$subpkgdir"/usr/share/mysql \ > + || return 1 > + mv "$pkgdir"/usr/lib/libmysqlclient.so* \ > + "$subpkgdir"/usr/lib/ \ > + || return 1 > +} > + > +common() { > + pkgdesc=3D"MariaDB common files for boh server and client" > + replaces=3D"mariadb" > + depends=3D > + mkdir -p "$subpkgdir"/usr/share/mysql \ > + mv "$pkgdir"/etc "$subpkgdir"/ || return 1 > + mv "$pkgdir"/usr/share/mysql/english \ > + "$pkgdir"/usr/share/mysql/czech \ > + "$pkgdir"/usr/share/mysql/danish \ > + "$pkgdir"/usr/share/mysql/dutch \ > + "$pkgdir"/usr/share/mysql/estonian \ > + "$pkgdir"/usr/share/mysql/french \ > + "$pkgdir"/usr/share/mysql/german \ > + "$pkgdir"/usr/share/mysql/greek \ > + "$pkgdir"/usr/share/mysql/hungarian \ > + "$pkgdir"/usr/share/mysql/italian \ > + "$pkgdir"/usr/share/mysql/japanese \ > + "$pkgdir"/usr/share/mysql/korean \ > + "$pkgdir"/usr/share/mysql/norwegian \ > + "$pkgdir"/usr/share/mysql/norwegian-ny \ > + "$pkgdir"/usr/share/mysql/polish \ > + "$pkgdir"/usr/share/mysql/portuguese \ > + "$pkgdir"/usr/share/mysql/romanian \ > + "$pkgdir"/usr/share/mysql/russian \ > + "$pkgdir"/usr/share/mysql/serbian \ > + "$pkgdir"/usr/share/mysql/slovak \ > + "$pkgdir"/usr/share/mysql/spanish \ > + "$pkgdir"/usr/share/mysql/swedish \ > + "$pkgdir"/usr/share/mysql/ukrainian \ > + "$pkgdir"/usr/share/mysql/charsets \ > + "$subpkgdir"/usr/share/mysql/ \ > + || return 1 > +} > + > +mytest() { > + pkgdesc=3D"The test suite distributed with MariaDB" > + mkdir -p "$subpkgdir"/usr/bin || return 1 > + mv "$pkgdir"/usr/bin/mysql_client_test \ > + "$pkgdir"/usr/mysql-test \ > + "$pkgdir"/usr/bin/my_safe_process \ > + "$subpkgdir"/usr/bin/ \ > + || return 1 > +} > + > +client() { > + pkgdesc=3D"client for the MariaDB database" > + depends=3D"mariadb-common" > + install=3D"" > + local bins=3D"myisam_ftdump mysql mysqlaccess mysqladmin mysqlbug > + mysqlcheck mysqldump mysqldumpslow mysql_find_rows > + mysql_fix_extensions mysqlimport mysqlshow mysql_waitpid" > + > + mkdir -p "$subpkgdir"/usr/bin/ || return 1 > + > + for i in $bins; do > + mv "$pkgdir"/usr/bin/${i} "$subpkgdir"/usr/bin/ || return 1 > + done > +} > + > +bench() { > + pkgdesc=3D"MariaDB benchmark scripts and data" > + replaces=3D"mariadb" > + mkdir -p "$subpkgdir"/usr/share/ > + mv "$pkgdir"/usr/sql-bench "$subpkgdir"/usr/share > +} > + > +md5sums=3D"d2415efc6a6d73d7a58f3c79bb42f2e8 mariadb-5.5.41.tar.gz > +01fe0055305d8f974c35d0898245014b mariadb.initd > +0bc35376a413719e77808ab778378517 fix-xtradb-storage.patch" > +sha256sums=3D"a16dc62e4bcabecd5c483f2f8b657483a8c51934e7be5ad4ab21b8baea= 1f5332 mariadb-5.5.41.tar.gz > +cbf3c99c41310033ed092b38ae0f55bc74334ce4531a6c82f21feff26f25008d mariad= b.initd > +b83ee0bdf0f1c40f563dc227cb3fa1060ca859cb42222886f66550a3c2fe0b7a fix-xt= radb-storage.patch" > +sha512sums=3D"727ce6994966a42602ea8f735f34b1b3c342d08b9dae2667e465805bff= 36e68bf69b582ec0b844b25fb7024f9b25a39280160c2935f639491a1c3654d3166953 mar= iadb-5.5.41.tar.gz > +fccc31e8e67dc21087c4feb3a36d2ac129dccfe6d393172b58834b408faa85ab6f9f70ec= 423c88ab7613df9ae258a8db990f3c48d69ef2a1906f7e3b4e18c892 mariadb.initd > +64505f8a65ceb4e3568b81ba4e58c8c92264f12c3d16a5bf3e9c26978ba6e4f120f653b7= 4a9cabb252540559f1019647ab070a067d90e6cb75ccc4bfca0126bd fix-xtradb-storag= e.patch" > diff --git a/testing/mariadb/fix-xtradb-storage.patch b/testing/mariadb/f= ix-xtradb-storage.patch > new file mode 100644 > index 0000000..096e87a > --- /dev/null > +++ b/testing/mariadb/fix-xtradb-storage.patch > @@ -0,0 +1,38 @@ > +--- mariadb-5.5.41/storage/xtradb/include/os0stacktrace.h.orig 2014-12-1= 9 11:57:31.000000000 +0100 > ++++ mariadb-5.5.41/storage/xtradb/include/os0stacktrace.h 2014-12-27 12:= 41:11.952594278 +0100 > +@@ -20,7 +20,7 @@ > + #ifndef os0stacktrace_h > + #define os0stacktrace_h > +=20 > +-#ifdef __linux__ > ++#if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS > + #if HAVE_EXECINFO_H > + #include > + #endif > +@@ -40,5 +40,5 @@ > + siginfo_t* info, /*!< in: signal information */ > + void* ucontext);/*!< in: signal context */ > +=20 > +-#endif /* __linux__ */ > ++#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBO= LS */ > + #endif /* os0stacktrace.h */ > +--- mariadb-5.5.41/storage/xtradb/srv/srv0start.c.orig 2014-12-19 11:57:= 32.000000000 +0100 > ++++ mariadb-5.5.41/storage/xtradb/srv/srv0start.c 2014-12-27 12:48:08.79= 8016960 +0100 > +@@ -1274,7 +1274,7 @@ > + stacktrace feature. */ > +=20 > + if (srv_use_stacktrace) { > +-#ifdef __linux__ > ++#if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS > + struct sigaction sigact; > +=20 > + sigact.sa_sigaction =3D os_stacktrace_print; > +@@ -1287,7 +1287,7 @@ > + srv_use_stacktrace =3D FALSE; > +=20 > + } > +-#endif /* __linux__ */ > ++#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBO= LS */ > + } > +=20 > +=20 > diff --git a/testing/mariadb/mariadb.initd b/testing/mariadb/mariadb.initd > new file mode 100644 > index 0000000..2763285 > --- /dev/null > +++ b/testing/mariadb/mariadb.initd > @@ -0,0 +1,58 @@ > +#!/sbin/runscript > +# Copyright 1999-2004 Gentoo Foundation > +# Distributed under the terms of the GNU General Public License v2 > +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/mysql.init,v 1.7 2= 004/07/14 21:41:15 agriffis Exp $ > + > +extra_stopped_commands=3D"setup" > +pidfile=3D/var/run/mysqld/mysqld.pid > + > +depend() { > + need net > + after firewall > + use dns > +} > + > +setup() { > + ebegin "Creating a new MySQL database" > + mysql_install_db --user=3Dmysql --rpm > + eend $? > +} > + > +checkconfig() { > + if [ ! -f /etc/mysql/my.cnf ] ; then > + eerror "No /etc/mysql/my.cnf file exists!" > + fi > + > + dir=3D`my_print_defaults mysqld | grep -- --datadir | sed -e "s|^.*=3D\= (.*\)|\1|"` > + > + dir=3D${dir:-/var/lib/mysql} > + [ -d ${dir}/mysql ] && return 0 > + > + if [ -z "$AUTO_SETUP" ] ; then > + eerror "Database not found in $dir" > + eerror "You can run '/etc/init.d/mysql setup' to setup a new database." > + return 1 > + fi > + setup > +} > + > +start() { > + checkconfig || return 1 > + ebegin "Starting mysqld" > + start-stop-daemon --pidfile $pidfile \ > + --start \ > + --background \ > + --stdout /dev/null \ > + --stderr /dev/null \ > + --wait 1500 \ > + -- \ > + /usr/bin/mysqld_safe --pid-file=3D$pidfile > + eend $? > +} > + > +stop () { > + ebegin "Stopping mysqld" > + start-stop-daemon --stop --quiet \ > + --pidfile $pidfile --retry 20 > + eend $? > +} --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---