PKGBUILDs/community/percona-server/PKGBUILD

196 lines
6.6 KiB
Bash
Raw Normal View History

2016-02-24 14:29:44 +00:00
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2016-05-20 18:20:18 +00:00
# - drop numactl makedepend, don't build with NUMA
2016-03-22 00:17:14 +00:00
# - disable epoll on aarch64
2018-12-31 17:27:54 +00:00
# - patch to fix padding calculation
2016-02-24 14:29:44 +00:00
pkgbase=percona-server
pkgname=('libperconaserverclient' 'percona-server-clients' 'percona-server')
pkgver=8.0.19_10
2020-01-07 19:04:34 +00:00
_boost_ver=1.70.0
2016-02-24 14:29:44 +00:00
_pkgver=${pkgver/_/-}
_myver=${pkgver/_rel*}
pkgrel=1
arch=('x86_64')
2020-03-16 23:39:06 +00:00
makedepends=('cmake' 'zlib' 'lz4' 'zstd' 'libaio' 'systemd-tools' 'pam' 'jemalloc' 'openssl' 'rpcsvc-proto' 'boost' 'doxygen' 'graphviz')
license=('GPL')
2016-11-09 13:29:31 +00:00
url="https://www.percona.com/software/mysql-database/percona-server"
source=("https://www.percona.com/downloads/Percona-Server-${pkgver%.*_*}/Percona-Server-$_pkgver/source/tarball/percona-server-$_pkgver.tar.gz"
2020-01-07 19:04:34 +00:00
"https://dl.bintray.com/boostorg/release/$_boost_ver/source/boost_${_boost_ver//./_}.tar.gz"
2016-02-24 14:29:44 +00:00
'my.cnf'
'mysql-user.conf'
2018-12-31 16:22:21 +00:00
'build-hostname.patch'
'no-werror.patch'
2018-12-31 17:27:54 +00:00
'rocksdb-systemlibs.patch'
2020-03-16 23:39:06 +00:00
'rocksdb-make.patch'
2018-12-31 17:27:54 +00:00
'0001-fix-LF_PINS-padding-calculation.patch')
sha256sums=('b819d81b9cdef497dd5fd1044ddb033d222b986cf610cb5d4bb1fa5010dba580'
2020-01-07 19:04:34 +00:00
'882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9'
'e638a2657085f15b6728f43c1fd6aa551b27608fbf6b435e33afd3606a0cfb0e'
2018-12-31 16:22:21 +00:00
'1537fdbb92dd1c135c1eb9f4d10c44fd02e652db66c933d731990a1196f1397c'
'fe1cb2b079c56ff0f827c7dfb25d004b2190410406820c490dc6152cfe392b70'
2019-08-25 16:40:03 +00:00
'1bbae30fe4c7d8198aaa771a20ca2fbeb6494de9ec4e516e4bab5f1387b3b8bd'
2020-03-16 23:39:06 +00:00
'2ff495d271f99c4d0dba89e8ccde7e6b9789a4ea6b55034de9b9217b47e32c03'
2018-12-31 17:27:54 +00:00
'aa5e960625843b061f47c32b4a267fab1115667b8b7d1ce7ec952efe42eb77af')
2016-02-24 14:29:44 +00:00
prepare() {
cd $pkgbase-$_pkgver
rm -v sql/sql_yacc.{cc,h}
2018-12-31 16:22:21 +00:00
patch -p1 -i "$srcdir"/build-hostname.patch
patch -p1 -i "$srcdir"/no-werror.patch
2019-01-19 00:02:30 +00:00
patch -p1 -i "$srcdir"/rocksdb-systemlibs.patch
2020-03-16 23:39:06 +00:00
patch -p1 -i "$srcdir"/rocksdb-make.patch
2020-03-17 18:12:12 +00:00
for svcfile in mysqld{,@}.service.in; do
echo StateDirectory=mysql mysql-files >> scripts/systemd/$svcfile
echo RuntimeDirectory=mysqld >> scripts/systemd/$svcfile
done
2020-03-16 23:39:06 +00:00
2018-12-31 17:27:54 +00:00
patch -p1 -i "$srcdir"/0001-fix-LF_PINS-padding-calculation.patch
2016-02-24 14:29:44 +00:00
}
build() {
# rm -rf build
mkdir -p build
2016-02-24 14:29:44 +00:00
cd build
2016-07-09 16:43:41 +00:00
[[ $CARCH == "aarch64" ]] && CONFIG="-DHAVE_SYS_EPOLL_H=0"
2016-03-22 00:17:14 +00:00
2016-02-24 14:29:44 +00:00
cmake ../$pkgbase-$_pkgver \
2019-01-15 01:33:02 +00:00
-Wno-dev \
2016-02-24 14:29:44 +00:00
-DBUILD_CONFIG=mysql_release \
2018-12-31 16:22:21 +00:00
-DREPRODUCIBLE_BUILD=ON \
2016-02-24 14:29:44 +00:00
-DCMAKE_INSTALL_PREFIX=/usr \
-DSYSCONFDIR=/etc/mysql \
-DMYSQL_DATADIR=/var/lib/mysql \
-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
2016-02-24 14:29:44 +00:00
-DENABLED_LOCAL_INFILE=ON \
-DINSTALL_INFODIR=share/doc/percona-server \
-DINSTALL_DOCREADMEDIR=share/doc/percona-server \
-DINSTALL_DOCDIR=share/doc/percona-server \
2016-02-24 14:29:44 +00:00
-DINSTALL_MANDIR=share/man \
2019-01-19 00:02:30 +00:00
-DINSTALL_PLUGINDIR=lib/perconaserver/plugin \
2016-02-24 14:29:44 +00:00
-DINSTALL_SCRIPTDIR=bin \
-DINSTALL_INCLUDEDIR=include/perconaserver \
-DINSTALL_SUPPORTFILESDIR=share/mysql \
-DINSTALL_MYSQLSHAREDIR=share/mysql \
2019-01-19 00:02:30 +00:00
-DINSTALL_STATIC_LIBRARIES=OFF \
2016-02-24 14:29:44 +00:00
-DWITH_ZLIB=system \
-DWITH_LZ4=system \
-DWITH_SSL=system \
2016-02-24 14:29:44 +00:00
-DWITH_LIBWRAP=OFF \
-DWITH_MECAB=OFF \
2016-02-24 14:29:44 +00:00
-DWITH_PAM=ON \
-DWITH_EMBEDDED_SERVER=ON \
2016-08-25 18:01:02 +00:00
-DWITH_EMBEDDED_SHARED_LIBRARY=ON \
2016-02-24 14:29:44 +00:00
-DWITH_INNODB_MEMCACHED=ON \
-DWITH_ARCHIVE_STORAGE_ENGINE=ON \
-DWITH_BLACKHOLE_STORAGE_ENGINE=ON \
-DWITH_FEDERATED_STORAGE_ENGINE=ON \
-DWITH_ROCKSDB=ON \
-DTOKU_DEBUG_PARANOID=OFF \
-DWITH_VALGRIND=OFF \
-DUSE_VALGRIND=OFF \
-DDEBUG_EXTNAME=OFF \
-DBUILD_TESTING=OFF \
-DWITH_UNIT_TESTS=OFF \
-DUSE_GTAGS=OFF \
-DUSE_CTAGS=OFF \
-DUSE_ETAGS=OFF \
-DUSE_CSCOPE=OFF \
-DTOKUDB_BACKUP_PLUGIN_VERSION=$_pkgver \
2016-08-25 18:01:02 +00:00
-DWITH_SYSTEMD=1 \
-DWITH_SCALABILITY_METRICS=ON \
-DCMAKE_EXE_LINKER_FLAGS='-ljemalloc' \
2019-08-25 16:40:03 +00:00
-DWITH_BOOST=system \
-DWITH_NUMA=OFF \
2020-01-07 19:04:34 +00:00
-DWITH_BOOST="../boost_${_boost_ver//./_}" \
$CONFIG
2016-02-24 14:29:44 +00:00
make
}
package_libperconaserverclient() {
pkgdesc='Percona Server client libraries'
depends=('zlib' 'openssl')
2016-02-24 14:29:44 +00:00
cd build
2018-12-31 16:22:21 +00:00
for dir in include libmysql libservices; do
2016-02-24 14:29:44 +00:00
make -C $dir DESTDIR="$pkgdir" install
done
2019-01-19 00:02:30 +00:00
# Conflicting files with mariadb-libs
rm -rf "$pkgdir"/usr/lib/{libmysqld.so*,libmysqlclient{,_r}.so*,perconaserver}
2016-02-24 14:29:44 +00:00
install -Dm755 scripts/mysql_config "$pkgdir"/usr/bin/perconaserver_config
install -Dm644 "$srcdir"/$pkgbase-$_pkgver/man/mysql_config.1 "$pkgdir"/usr/share/man/man1/perconaserver_config.1
install -D -m0644 scripts/perconaserverclient.pc "$pkgdir"/usr/lib/pkgconfig/perconaserverclient.pc
install -D -m0644 "$srcdir"/$pkgbase-$_pkgver/support-files/mysql.m4 "$pkgdir"/usr/share/aclocal/perconaserverclient.m4
2016-02-24 14:29:44 +00:00
}
package_percona-server-clients() {
pkgdesc='Percona Server client tools'
depends=('libperconaserverclient' 'zlib' 'lz4' 'jemalloc' 'readline')
2016-02-24 14:29:44 +00:00
conflicts=('mysql-clients')
provides=("mysql-clients=$_myver" "mariadb-clients=$_myver")
cd build
make -C client DESTDIR="$pkgdir" install
# install man pages
install -d "$pkgdir"/usr/share/man/man1
2018-12-31 16:22:21 +00:00
for man in mysql{,admin,check,dump,import,show,slap,pump,binlog,_upgrade}; do
2016-02-24 14:29:44 +00:00
install -m644 "$srcdir"/$pkgbase-$_pkgver/man/$man.1 "$pkgdir"/usr/share/man/man1/$man.1
done
# provided by percona-server
2018-12-31 16:22:21 +00:00
rm "$pkgdir"/usr/bin/mysql{_config_editor,_secure_installation,_ssl_rsa_setup}
2016-02-24 14:29:44 +00:00
}
package_percona-server() {
2018-12-31 16:22:21 +00:00
pkgdesc='Drop-in replacement for MySQL that provides improved performance, diagnostics, instrumentation and MyRocks storage engine'
2016-02-24 14:29:44 +00:00
backup=('etc/mysql/my.cnf')
2019-08-25 16:40:03 +00:00
depends=('libaio' 'systemd-tools' 'pam' 'jemalloc' 'lz4' 'zstd' 'openssl' 'libtirpc' 'curl' 'boost-libs')
2016-02-24 14:29:44 +00:00
optdepends=('perl-dbd-mysql')
conflicts=('mysql')
provides=("mysql=$_myver" "mariadb=$_myver")
options=('emptydirs')
cd build
make DESTDIR="$pkgdir" install
install -Dm644 ../my.cnf "$pkgdir"/etc/mysql/my.cnf
install -Dm644 ../mysql-user.conf "$pkgdir"/usr/lib/sysusers.d/mysql.conf
cd "$pkgdir"
2019-01-15 01:33:02 +00:00
chmod 755 usr
mv usr/usr/lib/* usr/lib
2020-03-16 23:39:06 +00:00
rm -rf usr/{usr,data,run,lib/perconaserver/plugin/debug,lib/tmpfiles.d/mysql.conf}
2016-02-24 14:29:44 +00:00
# Move documentation
if [ -f usr/PATENTS ]; then
mv usr/{PATENTS,README.md} usr/share/doc/$pkgname/
2019-01-15 01:33:02 +00:00
rm usr/COPYING.* usr/{LICENSE,README}.router
2016-02-24 14:29:44 +00:00
fi
# provided by libperconaserverclient
rm usr/bin/mysql_config
rm usr/lib/lib{mysql,perconaserver}*
rm -r usr/include/
rm usr/share/man/man1/mysql_config.1
rm -r usr/share/aclocal usr/lib/pkgconfig
2016-02-24 14:29:44 +00:00
# provided by percona-server-clients
2018-12-31 16:22:21 +00:00
rm usr/bin/mysql{,admin,check,dump,import,show,slap,pump,binlog,test,_upgrade}
rm usr/share/man/man1/mysql{,admin,check,dump,import,show,slap,pump,binlog,_upgrade}.1
2016-02-24 14:29:44 +00:00
# not needed
rm -r usr/mysql-test
2019-01-19 00:02:30 +00:00
rm usr/share/doc/percona-server/{INFO_*,mysql.info,*-test}
2016-02-24 14:29:44 +00:00
}