OCaml 4.14.0 rebuild
[arch-packages.git] / mariadb / trunk / PKGBUILD
blobb1f2aa28736b2d250592a04c8ef9bd6fba5664c4
1 # Maintainer: BartÅ‚omiej Piotrowski <bpiotrowski@archlinux.org>
2 # Maintainer: Christian Hesse <mail@eworm.de>
4 pkgbase=mariadb
5 pkgname=('mariadb-libs' 'mariadb-clients' 'mariadb' 'mytop')
6 pkgdesc='Fast SQL database server, derived from MySQL'
7 pkgver=10.8.3
8 pkgrel=1
9 arch=('x86_64')
10 license=('GPL')
11 url='https://mariadb.org/'
12 makedepends=('boost' 'bzip2' 'cmake' 'cracklib' 'curl' 'jemalloc' 'judy' 'krb5' 'libaio'
13              'libxcrypt' 'libxml2' 'lz4' 'openssl' 'systemd' 'zlib' 'zstd' 'xz')
14 options=('debug')
15 validpgpkeys=('199369E5404BD5FC7D2FE43BCBCB082A1BB943DB') # MariaDB Package Signing Key <package-signing-key@mariadb.org>
16 # The default links with mirror redirection fail for signatures, specific
17 # mirrors may be out of date every now and then. Let's use the upstream
18 # rsync source via https and hope it does not hurt them too much.
19 # https://mariadb.com/kb/en/library/mirror-sites-for-mariadb/
20 source=("https://rsync.osuosl.org/pub/mariadb/mariadb-${pkgver}/source/mariadb-${pkgver}.tar.gz"{,.asc}
21         '0001-arch-specific.patch')
22 sha256sums=('887eadc55176ac1ead1fccfc89ade4b5990ef192745ad4dcd879acb41c050892'
23             'SKIP'
24             '3289efb3452d199aec872115f35da3f1d6fd4ce774615076690e9bc8afae1460')
26 prepare() {
27   cd $pkgbase-$pkgver/
29   # Arch Linux specific patches:
30   #  * enable PrivateTmp for a little bit more security
31   #  * force preloading jemalloc for memory management
32   #  * make systemd-tmpfiles create MYSQL_DATADIR
33   patch -Np1 < ../0001-arch-specific.patch
36 build() {
37   local _cmake_options=(
38     # build options
39     -DCOMPILATION_COMMENT="Arch Linux"
40     -DCMAKE_BUILD_TYPE=RelWithDebInfo
41     -Wno-dev
43     # file paths
44     # /etc
45     -DINSTALL_SYSCONFDIR=/etc
46     -DINSTALL_SYSCONF2DIR=/etc/my.cnf.d
47     # /run
48     -DINSTALL_UNIX_ADDRDIR=/run/mysqld/mysqld.sock
49     # /usr
50     -DCMAKE_INSTALL_PREFIX=/usr
51     # /usr/bin /usr/include
52     -DINSTALL_SCRIPTDIR=bin
53     -DINSTALL_INCLUDEDIR=include/mysql
54     # /usr/lib
55     -DINSTALL_PLUGINDIR=lib/mysql/plugin
56     -DINSTALL_SYSTEMD_UNITDIR=/usr/lib/systemd/system/
57     -DINSTALL_SYSTEMD_SYSUSERSDIR=/usr/lib/sysusers.d/
58     -DINSTALL_SYSTEMD_TMPFILESDIR=/usr/lib/tmpfiles.d/
59     # /usr/share
60     -DINSTALL_SHAREDIR=share
61     -DINSTALL_SUPPORTFILESDIR=share/mysql
62     -DINSTALL_MYSQLSHAREDIR=share/mysql
63     -DINSTALL_DOCREADMEDIR=share/doc/mariadb
64     -DINSTALL_DOCDIR=share/doc/mariadb
65     -DINSTALL_MANDIR=share/man
66     # /var
67     -DMYSQL_DATADIR=/var/lib/mysql
69     # default settings
70     -DDEFAULT_CHARSET=utf8mb4
71     -DDEFAULT_COLLATION=utf8mb4_unicode_ci
73     # features
74     -DENABLED_LOCAL_INFILE=ON
75     -DPLUGIN_EXAMPLE=NO
76     -DPLUGIN_FEDERATED=NO
77     -DPLUGIN_FEEDBACK=NO
78     -DWITH_EMBEDDED_SERVER=ON
79     -DWITH_EXTRA_CHARSETS=complex
80     -DWITH_JEMALLOC=ON
81     -DWITH_LIBWRAP=OFF
82     -DWITH_PCRE=bundled
83     -DWITH_READLINE=ON
84     -DWITH_SSL=system
85     -DWITH_SYSTEMD=yes
86     -DWITH_UNIT_TESTS=OFF
87     -DWITH_ZLIB=system
88   )
90   mkdir build
91   cd build
93   cmake ../"$pkgbase-$pkgver" "${_cmake_options[@]}"
95   make
98 check() {
99   cd build/mysql-test
101   # Takes *really* long, so disabled by default.
102   #./mtr --parallel=5 --mem --force --max-test-fail=0
105 package_mariadb-libs() {
106   pkgdesc='MariaDB libraries'
107   depends=('libaio' 'libxcrypt' 'libcrypt.so' 'openssl' 'zlib')
108   optdepends=('krb5: for gssapi authentication')
109   conflicts=('libmysqlclient' 'libmariadbclient' 'mariadb-connector-c')
110   provides=('libmariadbclient' 'mariadb-connector-c' 'libmariadb.so' 'libmariadbd.so')
111   replaces=('libmariadbclient')
113   cd build
115   for dir in libmariadb libmysqld libservices include; do
116     make -C "$dir" DESTDIR="$pkgdir" install
117   done
119   ln -s mariadb_config "$pkgdir"/usr/bin/mariadb-config
120   ln -s mariadb_config "$pkgdir"/usr/bin/mysql_config
121   install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/man/mysql_config.1 "$pkgdir"/usr/share/man/man1/mysql_config.1
123   install -D -m0644 support-files/mariadb.pc "$pkgdir"/usr/share/pkgconfig/mariadb.pc
124   install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/support-files/mysql.m4 "$pkgdir"/usr/share/aclocal/mysql.m4
126   cd "$pkgdir"
128   # remove static libraries
129   rm usr/lib/*.a
131   # remove man pages
132   rm -r usr/share/man
135 package_mariadb-clients() {
136   pkgdesc='MariaDB client tools'
137   depends=("mariadb-libs=${pkgver}" 'jemalloc')
138   conflicts=('mysql-clients')
139   provides=("mysql-clients=$pkgver")
141   cd build
143   make -C client DESTDIR="$pkgdir" install
145   # install man pages
146   for man in mysql mysql_plugin mysql_upgrade mysqladmin mysqlbinlog mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap mysqltest; do
147     install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/man/"$man.1" "$pkgdir"/usr/share/man/man1/"$man.1"
148   done
151 package_mariadb() {
152   pkgdesc='Fast SQL database server, derived from MySQL'
153   backup=('etc/my.cnf'
154           'etc/my.cnf.d/client.cnf'
155           'etc/my.cnf.d/enable_encryption.preset'
156           'etc/my.cnf.d/mysql-clients.cnf'
157           'etc/my.cnf.d/provider_bzip2.cnf'
158           'etc/my.cnf.d/provider_lz4.cnf'
159           'etc/my.cnf.d/provider_lzma.cnf'
160           'etc/my.cnf.d/s3.cnf'
161           'etc/my.cnf.d/server.cnf'
162           'etc/my.cnf.d/spider.cnf'
163           'etc/security/user_map.conf')
164   install=mariadb.install
165   depends=("mariadb-clients=${pkgver}" 'bzip2' 'libxml2' 'lz4' 'systemd-libs' 'libxml2' 'zstd')
166   optdepends=('cracklib: for cracklib plugin'
167               'curl: for ha_s3 plugin'
168               'galera: for MariaDB cluster with Galera WSREP'
169               'judy: for Open Query GRAPH (OQGraph) computation engine'
170               'perl-dbd-mariadb: for mariadb-hotcopy, mariadb-convert-table-format and mariadb-setpermission'
171               'python-mysqlclient: for myrocks_hotbackup'
172               'xz: lzma provider')
173   conflicts=('mysql')
174   provides=("mysql=$pkgver")
175   options=('emptydirs')
177   cd build
179   make DESTDIR="$pkgdir" install
181   cd "$pkgdir"
183   # no SysV init, please!
184   rm -r etc/logrotate.d
185   rm usr/bin/rcmysql
186   rm usr/share/mysql/{binary-configure,mysql{,d_multi}.server}
188   # move to proper licenses directories
189   install -d usr/share/licenses/mariadb
190   mv usr/share/doc/mariadb/COPYING* usr/share/licenses/mariadb/
192   # move it where one might look for it
193   mv usr/share/{groonga{,-normalizer-mysql},doc/mariadb/}
195   # move to pam directories
196   install -d {etc,usr/lib}/security
197   mv usr/share/user_map.conf etc/security/
198   mv usr/share/pam_user_map.so usr/lib/security/
200   # already installed to real systemd unit directory or useless
201   rm -r usr/share/mysql/systemd/
202   rm -r usr/lib/systemd/system/mariadb@bootstrap.service.d
204   # provided by mariadb-libs
205   rm usr/bin/{mariadb{_,-},mysql_}config
206   rm -r usr/include/
207   rm usr/share/man/man1/mysql_config.1
208   rm -r usr/share/aclocal
209   rm usr/lib/lib*
210   rm -r usr/lib/pkgconfig
211   rm usr/lib/mysql/plugin/{auth_gssapi_client,caching_sha2_password,client_ed25519,dialog,mysql_clear_password,sha256_password,zstd}.so
213   # provided by mariadb-clients
214   rm usr/bin/mysql{,_plugin,_upgrade,admin,binlog,check,dump,import,show,slap,test}
215   rm usr/bin/mariadb{,-{admin,binlog,check,conv,dump,import,plugin,show,slap,test,upgrade}}
216   rm usr/share/man/man1/mysql{,_plugin,_upgrade,admin,binlog,check,dump,import,show,slap,test}.1
218   # provided by mytop
219   rm usr/bin/mytop
221   # not needed
222   rm -r usr/{mysql-test,sql-bench}
223   rm usr/share/man/man1/mysql-test-run.pl.1
226 package_mytop() {
227   pkgdesc='Top clone for MariaDB'
228   depends=('perl' 'perl-dbd-mariadb' 'perl-term-readkey')
230   install -D -m0755 build/scripts/mytop "$pkgdir"/usr/bin/mytop