aboutsummaryrefslogtreecommitdiffstats
path: root/main/mysql/APKBUILD
blob: 37f42be973ada6dc58883535ac232e5527967db5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mysql
pkgver=5.5.36
pkgrel=1
pkgdesc="A fast SQL database server"
url="http://www.mysql.com/"
pkgusers="mysql"
pkggroups="mysql"
arch="all"
license='GPL'
depends="mysql-common"
depends_dev="openssl-dev zlib-dev"
makedepends="libtool readline-dev openssl-dev ncurses-dev zlib-dev cmake bison perl libaio-dev"
source="ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.5/mysql-$pkgver.tar.gz
	mysql-prefer-dynamic-library.patch
	mysql-va-list.patch
	$pkgname.initd
	"
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-test:mytest
	$pkgname-common $pkgname-client $pkgname-bench"

_builddir="$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 . -DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DDEFAULT_CHARSET=utf8 \
		-DDEFAULT_COLLATION=utf8_general_ci \
		-DENABLED_LOCAL_INFILE=ON \
		-DINSTALL_DOCDIR=share/doc/mysql \
		-DINSTALL_DOCREADMEDIR=share/doc/mysql \
		-DINSTALL_INCLUDEDIR=include/mysql \
		-DINSTALL_INFODIR=share/info \
		-DINSTALL_LAYOUT=RPM \
		-DINSTALL_LIBDIR=lib \
		-DINSTALL_MANDIR=share/man \
		-DINSTALL_MYSQLDATADIR="/var/lib/mysql" \
		-DINSTALL_MYSQLSHAREDIR=share/mysql \
		-DINSTALL_MYSQLTESTDIR=share/mysql-test \
		-DINSTALL_PLUGINDIR=lib/mysql/plugin \
		-DINSTALL_SCRIPTDIR=bin \
		-DINSTALL_SHAREDIR=share/mysql \
		-DINSTALL_SQLBENCHDIR=share \
		-DINSTALL_SUPPORTFILESDIR=share/mysql \
		-DMYSQL_DATADIR="/var/lib/mysql" \
		-DMYSQL_UNIX_ADDR="/var/run/mysqld/mysqld.sock" \
		-DSYSCONFDIR=/etc/mysql \
		-DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \
		-DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 \
		-DWITHOUT_EMBEDDED_SERVER=ON \
		-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
		-DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \
		-DWITH_EXTRA_CHARSETS=complex \
		-DWITH_INNOBASE_STORAGE_ENGINE=1 \
		-DWITH_PARTITION_STORAGE_ENGINE=1 \
		-DWITH_READLINE=ON \
		-DWITH_SSL=system \
		-DWITH_ZLIB=system \
		|| return 1
        make || return 1
}

#		-DWITH_LIBWRAP=ON \
package() {
        cd "$_builddir"
        make DESTDIR="$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/share/mysql-test/lib/My/SafeProcess/my_safe_process \
		"$pkgdir"/usr/bin
	ln -s ../../../../../bin/my_safe_process \
		"$pkgdir"/usr/share/mysql-test/lib/My/SafeProcess/my_safe_process

}

dev(){
	default_dev
	replaces="libmysqlclient"
}

libs() {
	pkgdesc="MySQL client library"
	# some files moved
	replaces="mysql libmysqlclient"
	depends="mysql-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="MySQL common files for both server and client"
	replaces="mysql"
	depends=
	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="The test suite distributed with MySQL"
        mkdir -p "$subpkgdir"/usr/bin || return 1
        mv "$pkgdir"/usr/share/mysql-test \
		"$subpkgdir"/usr/share/ \
		|| return 1
	mv "$pkgdir"/usr/bin/mysql_client_test \
		"$pkgdir"/usr/bin/my_safe_process \
		"$subpkgdir"/usr/bin/ \
		|| return 1
}

client() {
	pkgdesc="client for the MySQL database"
	depends="mysql-common"
	install=""
	local bins="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="MySQL benchmark scripts and data"
	replaces="mysql"
	mkdir -p "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/sql-bench "$subpkgdir"/usr/share/
}

md5sums="b7e236ede512b814ba521c84abc37292  mysql-5.5.36.tar.gz
b2b038b1905fa5b80f6723d0ee2f811f  mysql-prefer-dynamic-library.patch
b08bf0844d4e52ab4a78a825511845fc  mysql-va-list.patch
01fe0055305d8f974c35d0898245014b  mysql.initd"
sha256sums="30f2cde5bf854cf1ef74ecd1ae2f6e5e9ec7d11eb5b50643e1aa91c911c75897  mysql-5.5.36.tar.gz
83d685f6c03d0a1c4811b82ff973e617c3758a72e5d1659b409194221d0cc1c7  mysql-prefer-dynamic-library.patch
9398daa424cf15518566dda6fbf6faed476da902e54e39b7acf222a3f5c7ab2e  mysql-va-list.patch
cbf3c99c41310033ed092b38ae0f55bc74334ce4531a6c82f21feff26f25008d  mysql.initd"
sha512sums="594644e13fa68d96b6081bff488574e5926a449c86274d0045fe4f211200f7a7c80c1b06c7c64bbe9df4753ac6de11cb9de0eb05c0ff40d7508b4eff87ea9684  mysql-5.5.36.tar.gz
2b6dfe1262a68f08f6d9aa53d204b7fb7bb88af2c5d1e8f84bd83529ea0fb2521c2f10fdfb730ecc29c6d0acfca762badbd89a3679a05315572e679e4f3c12b0  mysql-prefer-dynamic-library.patch
cd07298193db594f971adfe0f89939c38975b6aedd9480153920a9f65977f94daddc0bd35c287a81e76aaec52f311ce02517231ae44dea221d77a730749f45dc  mysql-va-list.patch
fccc31e8e67dc21087c4feb3a36d2ac129dccfe6d393172b58834b408faa85ab6f9f70ec423c88ab7613df9ae258a8db990f3c48d69ef2a1906f7e3b4e18c892  mysql.initd"