sbcl 2.3.0 rebuild
[arch-packages.git] / mariadb / repos / extra-x86_64 / PKGBUILD
bloba076098e98a08c6d95a796407b727263509d7aef
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.9.4
8 pkgrel=2
9 arch=('x86_64')
10 license=('GPL')
11 url='https://mariadb.org/'
12 makedepends=('boost' 'bzip2' 'cmake' 'cracklib' 'curl' 'jemalloc' 'judy' 'krb5' 'liburing'
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=('1dff08a0f37ea5cf8f00cbd12d40e80759fae7d73184ccf56b5b51acfdcfc054'
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=('liburing' '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   # remove static libraries
120   rm "${pkgdir}"/usr/lib/*.a
122   # remove man pages
123   rm -r "${pkgdir}"/usr/share/man
124   
125   ln -s mariadb_config "$pkgdir"/usr/bin/mariadb-config
126   ln -s mariadb_config "$pkgdir"/usr/bin/mysql_config
127   install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/man/mysql_config.1 "$pkgdir"/usr/share/man/man1/mysql_config.1
128   ln -s mysql_config.1 "$pkgdir"/usr/share/man/man1/mariadb_config.1
129   ln -s mysql_config.1 "$pkgdir"/usr/share/man/man1/mariadb-config.1
131   install -D -m0644 support-files/mariadb.pc "$pkgdir"/usr/share/pkgconfig/mariadb.pc
132   install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/support-files/mysql.m4 "$pkgdir"/usr/share/aclocal/mysql.m4
136 package_mariadb-clients() {
137   pkgdesc='MariaDB client tools'
138   depends=("mariadb-libs=${pkgver}" 'jemalloc')
139   conflicts=('mysql-clients')
140   provides=("mysql-clients=$pkgver")
142   make -C build/client DESTDIR="${pkgdir}" install
143   
144   # install man pages
145   make -C build/man DESTDIR="${srcdir}"/client-man install
146   install -d -m0755 "${pkgdir}"/usr/share/man/man1/
147   for man in $(find "${pkgdir}"/usr/bin/ ! -type d); do
148     install -D -m0644 -t "${pkgdir}"/usr/share/man/man1/ "${srcdir}"/client-man/usr/share/man/man1/"$(basename "${man}")".1
149   done    
152 package_mariadb() {
153   pkgdesc='Fast SQL database server, derived from MySQL'
154   backup=('etc/my.cnf'
155           'etc/my.cnf.d/client.cnf'
156           'etc/my.cnf.d/enable_encryption.preset'
157           'etc/my.cnf.d/mysql-clients.cnf'
158           'etc/my.cnf.d/provider_bzip2.cnf'
159           'etc/my.cnf.d/provider_lz4.cnf'
160           'etc/my.cnf.d/provider_lzma.cnf'
161           'etc/my.cnf.d/s3.cnf'
162           'etc/my.cnf.d/server.cnf'
163           'etc/my.cnf.d/spider.cnf'
164           'etc/security/user_map.conf')
165   install=mariadb.install
166   depends=("mariadb-clients=${pkgver}" 'bzip2' 'libxml2' 'lz4' 'systemd-libs' 'libxml2' 'zstd')
167   optdepends=('cracklib: for cracklib plugin'
168               'curl: for ha_s3 plugin'
169               'galera: for MariaDB cluster with Galera WSREP'
170               'judy: for Open Query GRAPH (OQGraph) computation engine'
171               'perl-dbd-mariadb: for mariadb-hotcopy, mariadb-convert-table-format and mariadb-setpermission'
172               'python-mysqlclient: for myrocks_hotbackup'
173               'xz: lzma provider')
174   conflicts=('mysql')
175   provides=("mysql=$pkgver")
176   options=('emptydirs')
178   cd build
180   make DESTDIR="$pkgdir" install
182   cd "$pkgdir"
184   # no SysV init, please!
185   rm -r etc/logrotate.d
186   rm usr/bin/rcmysql
187   rm usr/share/mysql/{binary-configure,mysql{,d_multi}.server}
189   # move to proper licenses directories
190   install -d usr/share/licenses/mariadb
191   mv usr/share/doc/mariadb/COPYING* usr/share/licenses/mariadb/
193   # move it where one might look for it
194   mv usr/share/{groonga{,-normalizer-mysql},doc/mariadb/}
196   # move to pam directories
197   install -d {etc,usr/lib}/security
198   mv usr/share/user_map.conf etc/security/
199   mv usr/share/pam_user_map.so usr/lib/security/
201   # already installed to real systemd unit directory or useless
202   rm -r usr/share/mysql/systemd/
203   rm -r usr/lib/systemd/system/mariadb@bootstrap.service.d
205   # provided by mariadb-libs
206   rm usr/bin/{mariadb{_,-},mysql_}config
207   rm -r usr/include/
208   rm usr/share/man/man1/{mariadb,mysql}_config.1
209   rm -r usr/share/aclocal
210   rm usr/lib/lib*
211   rm -r usr/lib/pkgconfig
212   rm usr/lib/mysql/plugin/{auth_gssapi_client,caching_sha2_password,client_ed25519,dialog,mysql_clear_password,sha256_password,zstd}.so
214   # provided by mariadb-clients
215   for bin in $(find "${pkgdir}"/../mariadb-clients/usr/bin/ ! -type d); do
216     rm "${pkgdir}"/usr/bin/"$(basename "${bin}")" "${pkgdir}"/usr/share/man/man1/"$(basename "${bin}")".1
217   done
219   # provided by mytop
220   rm usr/bin/mytop
222   # not needed
223   rm -r usr/{mysql-test,sql-bench}
224   rm usr/share/man/man1/mysql-test-run.pl.1
227 package_mytop() {
228   pkgdesc='Top clone for MariaDB'
229   depends=('perl' 'perl-dbd-mariadb' 'perl-term-readkey')
231   install -D -m0755 build/scripts/mytop "$pkgdir"/usr/bin/mytop