APKBUILD 3.75 KB
Newer Older
xming's avatar
xming committed
1
# Contributor: <xmingske@gmail.com>
xming's avatar
xming committed
2
# Maintainer:
xming's avatar
xming committed
3
pkgname=minetest
xming's avatar
xming committed
4 5
pkgver=0.4.13
pkgrel=0
xming's avatar
xming committed
6 7 8
pkgdesc="An infinite-world block sandbox game and a game engine"
url="http://minetest.net/"
arch="all"
Natanael Copa's avatar
Natanael Copa committed
9
install="$pkgname-server.pre-install"
xming's avatar
xming committed
10 11
license="LGPL2.1 CCBY-SA3.0"
depends="$pkgname-common"
Natanael Copa's avatar
Natanael Copa committed
12 13
pkgusers="minetest"
pkggroups="minetest"
xming's avatar
xming committed
14
makedepends="sqlite-dev bzip2-dev openssl-dev irrlicht-dev cmake libvorbis-dev
Natanael Copa's avatar
Natanael Copa committed
15
	libjpeg-turbo-dev libpng-dev openal-soft-dev libogg-dev mesa-dev
xming's avatar
xming committed
16
	sqlite-dev luajit-dev hiredis-dev curl-dev"
xming's avatar
xming committed
17
source="$pkgname-$pkgver.tar.gz::https://codeload.github.com/minetest/${pkgname}/tar.gz/${pkgver}
Natanael Copa's avatar
Natanael Copa committed
18 19 20
	minetest-server.confd
	minetest-server.initd

21
	fix-header-include-namespace.patch
xming's avatar
xming committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
	"
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}" \
xming's avatar
xming committed
44
		-DDISABLE_LUAJIT=0 \
xming's avatar
xming committed
45 46 47
		-DBUILD_CLIENT=1 \
		-DBUILD_SERVER=0 \
		-DENABLE_REDIS=0 \
48
		-DENABLE_CURL=1 \
xming's avatar
xming committed
49 50 51 52 53
		-DRUN_IN_PLACE=0 \
		..
	make || return 1
	mkdir "${_builddir}"/.build_server
	cd "${_builddir}"/.build_server
54 55 56 57
	cmake -DCUSTOM_BINDIR=/usr/bin \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCUSTOM_DOCDIR="/usr/share/doc/minetest" \
		-DCUSTOM_SHAREDIR="/usr/share/minetest" \
Natanael Copa's avatar
Natanael Copa committed
58
		-DDISABLE_LUAJIT=1 \
59 60 61
		-DBUILD_CLIENT=0 \
		-DBUILD_SERVER=1 \
		-DENABLE_REDIS=1 \
62
		-DENABLE_CURL=1 \
63 64 65
		-DRUN_IN_PLACE=0 \
		..
	make || return 1
xming's avatar
xming committed
66 67 68 69
}

common() {
	arch="noarch"
Natanael Copa's avatar
Natanael Copa committed
70 71
	install -o minetest -g minetest -d "$subpkgdir"/var/lib/minetest \
		|| return 1
xming's avatar
xming committed
72
	mkdir -p "${subpkgdir}/usr/share/minetest"
Natanael Copa's avatar
Natanael Copa committed
73 74 75 76
	mv "${pkgdir}/usr/share/minetest/builtin" \
		"${subpkgdir}/usr/share/minetest" || return 1
	mv "${pkgdir}/usr/share/minetest/games" \
		"${subpkgdir}/usr/share/minetest" || return 1
xming's avatar
xming committed
77 78 79 80 81 82 83 84 85 86
}

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

server(){
	mkdir -p "${subpkgdir}/usr/bin"
	cd "${_builddir}"
Natanael Copa's avatar
Natanael Copa committed
87 88 89 90 91 92
	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
xming's avatar
xming committed
93 94 95
	cp bin/minetestserver ${subpkgdir}/usr/bin
}

xming's avatar
xming committed
96
md5sums="e3385b55faeb1164ac5349dd9b21b461  minetest-0.4.13.tar.gz
Natanael Copa's avatar
Natanael Copa committed
97
505dcc499ba84632cc3a5db97e9d56b5  minetest-server.confd
98
3a83f73d259cd3db8ab7f8fb2c8e2ac4  minetest-server.initd
99
c6b548384cbc5ee1bf38e59c91cc0dfc  fix-header-include-namespace.patch"
xming's avatar
xming committed
100
sha256sums="d77ee70c00a923c3ed2355536997f064a95143d0949a7fc92d725d079edef9f7  minetest-0.4.13.tar.gz
Natanael Copa's avatar
Natanael Copa committed
101
b8b02cdb070037fe4a0d01279edb9598ecfaa8bedf66ed991c6a00f2edbc5d7b  minetest-server.confd
102
91caea447ec06656b3620d8f7b7ba3cd4134adad949c21993e4de3b5fa58be6e  minetest-server.initd
103
7032d4de4a9562c5f2929aecacdfcdb54d0cb121c42b852cb682bc072386461c  fix-header-include-namespace.patch"
xming's avatar
xming committed
104
sha512sums="1947d6ec755259c733fedd9d5dbc48904b380dc6e4d0eb665ed4f5522b2db5b8dd963b41bbf73d5dca80a88350fec849dc9f57833d63456a265b22ea54a31ede  minetest-0.4.13.tar.gz
Natanael Copa's avatar
Natanael Copa committed
105
7bca17dc0bd59db9c07c160677498aa09297026104e922bf93b7629c274d0aebd226af60c5e82f49ffe3cc5c1e4448e3798b6c2a44144fc6eca4d3aaed3384bb  minetest-server.confd
106
c27aea87468538b48b5e0a66fa5cdde4fc67f3c00a0e57f359a2f044a31c5617d1b5f3dec72e015537ee3bf126bd1073878c0f4447de67db9be2c4cf21416dd7  minetest-server.initd
107
d64cf27fd7a8d4c8e5c0a571cc72716543f45b81dc2f02ac150369de9ac1a2edb01c6496292022f24b660333033a7b1f80bef56d1bcb0ff97e16a9a8a691d235  fix-header-include-namespace.patch"