summaryrefslogtreecommitdiffstats
path: root/main/mysql/APKBUILD
blob: 05f818bbb9ce07465c8aee06bd1bb3eb849e291b (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mysql
pkgver=5.1.53
pkgrel=0
pkgdesc="A fast SQL database server"
url="http://www.mysql.com/"
pkgusers="mysql"
pkggroups="mysql"
arch="x86 x86_64"
license='GPL'
depends=
makedepends="libtool readline-dev openssl-dev ncurses-dev zlib-dev"
source="http://ftp.sunet.se/pub/unix/databases/relational/mysql/Downloads/MySQL-5.1/mysql-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.mycnf
	"
subpackages="$pkgname-doc $pkgname-dev $pkgname-test libmysqlclient $pkgname-client"

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

prepare() {
	cd $_builddir
	sed -i -e 's/-lnsl //g' configure.in
	sed -i -e 's/-lnsl //g' configure
}

build() {
	cd $_builddir
	./configure --prefix=/usr --libexecdir=/usr/sbin \
		--localstatedir=/var/lib/mysql \
		--disable-assembler \
		--with-pthread \
		--without-libwrap \
		--without-pstack \
		--without-docs \
		--without-embedded-server \
		--with-ssl \
		--without-debug \
		--with-unix-socket-path=/var/run/mysqld/mysqld.sock \
		--with-plugins=partition,archive,blackhole,csv,federated,heap,innobase,innodb_plugin,ndbcluster \
		--mandir=/usr/share/man \
		|| return 1
        make
}

package() {
        cd $_builddir
        make -j1 DESTDIR="$pkgdir/" install
        install -Dm 755 "$startdir"/$pkgname.initd $pkgdir/etc/init.d/$pkgname
        install -Dm 644 "$startdir"/$pkgname.mycnf $pkgdir/etc/mysql/my.cnf
        install -dDo mysql $pkgdir/var/log/mysql
        install -dDo mysql $pkgdir/var/run/mysqld
}

libmysqlclient() {
	pkgdesc="MySQL client library"
	# some files moved
	replaces="mysql"
	mkdir -p "$subpkgdir"/usr/lib/mysql
	mv "$pkgdir"/usr/lib/mysql/libmysqlclient.so* \
		"$pkgdir"/usr/lib/mysql/libmysqlclient_r.so* \
		"$subpkgdir"/usr/lib/mysql
	# make symlinks
	cd "$subpkgdir"/usr/lib
	for i in mysql/*; do
		ln -s "$i" "${i##*/}"
	done
}

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

client() {
	pkgdesc="client for the MySQL database"
	install=""
	local bins="myisam_ftdump mysql mysqlaccess mysqladmin mysqlbug mysqlcheck
	mysql_client_test mysqldump mysqldumpslow mysql_explain_log mysql_find_rows
	mysql_fix_extensions mysqlimport mysqlshow mysql_tableinfo mysqltestmanagerc
	mysqltestmanager-pwgen mysql_waitpid"
	
	mkdir -p "$subpkgdir"/usr/bin/

	for i in $bins; do
		mv "$pkgdir"/usr/bin/${i} "$subpkgdir"/usr/bin/
	done
}

md5sums="e5e7c5b0b5c382489e6a66778703bc46  mysql-5.1.53.tar.gz
25d08b02bff6aa379dc45859b7a3f28a  mysql.initd
15a7e3ddd6a40bf5a1eb3a8c69d9c34c  mysql.mycnf"