aboutsummaryrefslogtreecommitdiffstats
path: root/main/minetest/APKBUILD
blob: 164e25108d23af48b9f0b53f6e1da55aab7c1cc4 (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
# Contributor: <xmingske@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=minetest
pkgver=0.4.11
pkgrel=2
pkgdesc="An infinite-world block sandbox game and a game engine"
url="http://minetest.net/"
arch="all"
install="$pkgname-server.pre-install"
license="LGPL2.1 CCBY-SA3.0"
depends="$pkgname-common"
pkgusers="minetest"
pkggroups="minetest"
makedepends="sqlite-dev bzip2-dev openssl-dev irrlicht-dev cmake libvorbis-dev
	libjpeg-turbo-dev libpng-dev openal-soft-dev libogg-dev mesa-dev
	sqlite-dev lua5.1-dev hiredis-dev"
source="$pkgname-$pkgver.tar.gz::https://codeload.github.com/minetest/${pkgname}/tar.gz/${pkgver}
	minetest-server.confd
	minetest-server.initd

	shared-lua.patch
	shared-irrlicht.patch
	"
subpackages="$pkgname-doc $pkgname-common $pkgname-server"

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

prepare() {
	local pf
	cd "${_builddir}"
	for pf in $source; do
		case $pf in
		*.patch) msg $pf; patch -p1 -i "$srcdir"/${pf} || return 1;;
		esac
	done
}

build() {
	mkdir "${_builddir}"/.build_client
	cd "${_builddir}"/.build_client
	cmake -DCUSTOM_BINDIR=/usr/bin \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCUSTOM_DOCDIR="/usr/share/doc/${pkgname}" \
		-DCUSTOM_SHAREDIR="/usr/share/${pkgname}" \
		-DDISABLE_LUAJIT=1 \
		-DBUILD_CLIENT=1 \
		-DBUILD_SERVER=0 \
		-DENABLE_REDIS=0 \
		-DENABLE_CURL=0 \
		-DRUN_IN_PLACE=0 \
		..
	make || return 1
	mkdir "${_builddir}"/.build_server
	cd "${_builddir}"/.build_server
	cmake -DCUSTOM_BINDIR=/usr/bin \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCUSTOM_DOCDIR="/usr/share/doc/minetest" \
		-DCUSTOM_SHAREDIR="/usr/share/minetest" \
		-DDISABLE_LUAJIT=1 \
		-DBUILD_CLIENT=0 \
		-DBUILD_SERVER=1 \
		-DENABLE_REDIS=1 \
		-DENABLE_CURL=0 \
		-DRUN_IN_PLACE=0 \
		..
	make || return 1
}

common() {
	arch="noarch"
	install -o minetest -g minetest -d "$subpkgdir"/var/lib/minetest \
		|| return 1
	mkdir -p "${subpkgdir}/usr/share/minetest"
	mv "${pkgdir}/usr/share/minetest/builtin" \
		"${subpkgdir}/usr/share/minetest" || return 1
	mv "${pkgdir}/usr/share/minetest/games" \
		"${subpkgdir}/usr/share/minetest" || return 1
}

package() {
	cd "${_builddir}"/.build_client
	make DESTDIR="${pkgdir}" install || return 1
}

server(){
	mkdir -p "${subpkgdir}/usr/bin"
	cd "${_builddir}"
	install -m644 -D $pkgname.conf.example \
		"$subpkgdir"/etc/$pkgname/$pkgname.conf || return 1
	install -D -m755 "$srcdir"/minetest-server.initd \
		"$subpkgdir"/etc/init.d/minetest-server || return 1
	install -D -m644 "$srcdir"/minetest-server.confd \
		"$subpkgdir"/etc/conf.d/minetest-server || return 1
	cp bin/minetestserver ${subpkgdir}/usr/bin
}

md5sums="c84858129b822a246f4b66a4a425d0fb  minetest-0.4.11.tar.gz
505dcc499ba84632cc3a5db97e9d56b5  minetest-server.confd
3a83f73d259cd3db8ab7f8fb2c8e2ac4  minetest-server.initd
9abfd27a3f46b4b004ed9418eef8820a  shared-lua.patch
83ef89fa320627dffa464f113c3169e6  shared-irrlicht.patch"
sha256sums="aefcd25589be923e5a9f4343f5062984438ee6f1dd617bce1ae6eef9b71e4240  minetest-0.4.11.tar.gz
b8b02cdb070037fe4a0d01279edb9598ecfaa8bedf66ed991c6a00f2edbc5d7b  minetest-server.confd
91caea447ec06656b3620d8f7b7ba3cd4134adad949c21993e4de3b5fa58be6e  minetest-server.initd
444d406183c3e5c6139386bfc870faef7062067a2a1cb3250c3ef41f02ff9b94  shared-lua.patch
12d03fb8f9523028dacd5fd45d74dfe901b6d659698cf90aafa8f164018f28cc  shared-irrlicht.patch"
sha512sums="8dcc531d41c86b9c66723a35d3dd8757e6f7c79a609330fcd826c8f83929ea957ab6eecbb3bbc1fef532fdcacd61928a359b4296d39f445ce901a389a8e4c63c  minetest-0.4.11.tar.gz
7bca17dc0bd59db9c07c160677498aa09297026104e922bf93b7629c274d0aebd226af60c5e82f49ffe3cc5c1e4448e3798b6c2a44144fc6eca4d3aaed3384bb  minetest-server.confd
c27aea87468538b48b5e0a66fa5cdde4fc67f3c00a0e57f359a2f044a31c5617d1b5f3dec72e015537ee3bf126bd1073878c0f4447de67db9be2c4cf21416dd7  minetest-server.initd
0716ea12458533b5687d84ac6b3047d8b257b9c1ccef807586dee7ef392ffbd19157e04a63c67ce3d3f221111c5ff12c02e8f9b224a31a7653ebd3f073487e79  shared-lua.patch
d737d076db32bf62df73f6568f7423511ee27573c08fb975c8d876f7cd56a8f942804ed667b9988f3048cb1efdb52fca0ae9a4f1ff1e912607c7d3765b6149e7  shared-irrlicht.patch"