aboutsummaryrefslogtreecommitdiffstats
path: root/main/mysql/APKBUILD
blob: e9f2da3d62f9d8319a066af7920c2056a127a09a (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mysql
pkgver=5.5.10
pkgrel=0
pkgdesc="A fast SQL database server"
url="http://www.mysql.com/"
pkgusers="mysql"
pkggroups="mysql"
arch="all"
license='GPL'
depends=
makedepends="libtool readline-dev openssl-dev ncurses-dev zlib-dev cmake bison perl libaio-dev"
source="ftp://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.5/$pkgname-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.mycnf
	"
subpackages="$pkgname-doc $pkgname-dev $pkgname-test libmysqlclient $pkgname-client"

_builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	cd $_builddir
}

build() {
	cd $_builddir
	cmake . -DCMAKE_BUILD=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DMYSQL_DATADIR=/var/lib/mysql \
		-DSYSCONFDIR=/etc/mysql \
		-DINSTALL_INFODIR=share/mysql/docs \
		-DINSTALL_MANDIR=share/man \
		-DINSTALL_PLUGINDIR=/usr/lib/mysql/plugin \
		-DINSTALL_SCRIPTDIR=bin \
		-DINSTALL_INCLUDEDIR=include/mysql \
		-DINSTALL_DOCREADMEDIR=share/mysql \
		-DINSTALL_SUPPORTFILESDIR=share/mysql \
		-DINSTALL_MYSQLSHAREDDIR=share/mysql \
		-DINSTALL_SHAREDIR=share/mysql \
		-DWITH_READLINE=ON \
		-DWITH_ZLIB=system \
		-DWITH_SSL=system \
		-DWITH_LIBWRAP=ON \
		-DDEFAULT_CHARSET=utf-8 \
		-DDEFAULT_COLLATION=utf-8_general_ci \
		-DWITH_EXTRA_CHARSETS=complex \
		-DWITHOUT_EMBEDDED_SERVER=ON \
		-DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
		-DENABLED_LOCAL_INFILE=ON \
		-DWITH_PARTITION_STORAGE_ENGINE=1 \
		-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
		-DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \
		-DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 \
		-DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \
		-DWITH_INNOBASE_STORAGE_ENGINE=1 \
		|| return 1
        make || return 1
}

package() {
        cd $_builddir
        make -j1 DESTDIR="$pkgdir/" install || return 1
        install -Dm 755 "$startdir"/$pkgname.initd $pkgdir/etc/init.d/$pkgname \
		|| return 1
        install -Dm 644 "$startdir"/$pkgname.mycnf $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() {
	pkgdesc="MySQL client library"
	# some files moved
	replaces="mysql"
	mkdir -p "$subpkgdir"/usr/lib/mysql || return 1
	mv "$pkgdir"/usr/lib/libmysqlclient.so* \
		"$pkgdir"/usr/lib/libmysqlclient_r.so* \
		"$subpkgdir"/usr/lib/mysql || return 1
}

test() {
        mkdir -p "$subpkgdir"/usr || return 1
        mv "$pkgdir"/usr/mysql-test "$subpkgdir"/usr/ || return 1
}

client() {
	pkgdesc="client for the MySQL database"
	install=""
	local bins="myisam_ftdump mysql mysqlaccess mysqladmin mysqlbug
	mysqlcheck mysql_client_test 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
}

md5sums="ee604aff531ff85abeb10cf332c1355a  mysql-5.5.10.tar.gz
25d08b02bff6aa379dc45859b7a3f28a  mysql.initd
15a7e3ddd6a40bf5a1eb3a8c69d9c34c  mysql.mycnf"