aboutsummaryrefslogtreecommitdiffstats
path: root/testing/rabbitmq-server/APKBUILD
blob: d809620bb499fa8492ab53911257bd58364ef210 (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: Nathan Johnson <nathan@nathanjohnson.info>
# Maintainer: Nathan Johnson <nathan@nathanjohnson.info>
pkgname=rabbitmq-server
pkgver=3.6.5
_realver=${pkgver//\./_}
pkgrel=0
pkgdesc="RabbitMQ is an open source multi-protocol messaging broker."
url="http://www.rabbitmq.com/"
arch="noarch"
license="MPL 1.1"
depends="erlang erlang-tools erlang-runtime-tools erlang-stdlib
	logrotate erlang-ssl erlang-crypto erlang-parsetools
	erlang-mnesia erlang-sasl erlang-inets erlang-syntax-tools
	erlang-eldap erlang-xmerl erlang-os-mon"
depends_dev=""
makedepends="$depends_dev erlang-dev python2 py2-simplejson xmlto libxslt
	rsync zip gawk grep erlang-compiler erlang-erl-docgen
	erlang-edoc socat"
install="$pkgname.pre-install $pkgname.post-deinstall"
pkgusers="rabbitmq"
pkggroups="rabbitmq"
subpackages="$pkgname-doc"
source="
	rabbitmq-server.initd
	rabbitmq-server.logrotate
	https://github.com/rabbitmq/${pkgname}/releases/download/rabbitmq_v${_realver}/${pkgname}-${pkgver}.tar.xz
	grep.patch
"

builddir="$srcdir/${pkgname}-${pkgver}"
build() {
	cd "$builddir"
	make dist manpages
}

package() {
	cd "$builddir"

	make install install-bin install-man DESTDIR="$pkgdir" PREFIX=/usr \
		RMQ_ROOTDIR="/usr/lib/rabbitmq" MANDIR=/usr/share/man

	mkdir -p "$pkgdir"/var/lib/rabbitmq/mnesia
	mkdir -p "$pkgdir"/var/log/rabbitmq

	#Copy all necessary lib files etc.
	install -p -m755 -D "$builddir"/scripts/rabbitmq-server.ocf \
		"$pkgdir"/usr/lib/ocf/resource.d/rabbitmq/rabbitmq-server || return 1
	install -p -m755 -D "$builddir"/scripts/rabbitmq-server-ha.ocf \
		"$pkgdir"/usr/lib/ocf/resource.d/rabbitmq/rabbitmq-server-ha \
		|| return 1
	install -p -m644 -D "$srcdir/"$pkgname.logrotate \
		"$pkgdir"/etc/logrotate.d/rabbitmq-server || return 1
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1
	mkdir -p "$pkgdir"/usr/sbin

	# This is lifted / adapted from the official upstream spec file.
	# I'd prefer a patch file, but this is probably a little easier
	# to manage since this is how they do it upstream.  inb4eww
	sed -e 's|@SU_RABBITMQ_SH_C@|su rabbitmq -s /bin/sh -c|' \
	-e 's|@STDOUT_STDERR_REDIRECTION@||' \
	< "$builddir"/scripts/rabbitmq-script-wrapper \
	> "$pkgdir"/usr/sbin/rabbitmqctl

	chmod 0755 "$pkgdir"/usr/sbin/rabbitmqctl
	for script in rabbitmq-server rabbitmq-plugins; do
		cp -a "$pkgdir"/usr/sbin/rabbitmqctl \
		   "$pkgdir"/usr/sbin/$script;
	done

	mkdir -p "$pkgdir"/usr/share/doc/"$pkgname"
	cp -a "$builddir"/LICENSE* "$pkgdir"/usr/share/doc/"$pkgname"/
	cp -a "$builddir"/docs/* "$pkgdir"/usr/share/doc/"$pkgname"/

	chmod 755 "$pkgdir"/var/lib/rabbitmq
	chmod 750 "$pkgdir"/var/lib/rabbitmq/mnesia
	chmod 755 "$pkgdir"/var/log/rabbitmq
	chown -R $pkgusers:$pkggroups "$pkgdir"/var/lib/rabbitmq
	chown -R $pkgusers:$pkggroups "$pkgdir"/var/log/rabbitmq
}

md5sums="12287613dfb924d4cde19202de6eb313  rabbitmq-server.initd
f24af11867cddc5a17fefa8bf4276d52  rabbitmq-server.logrotate
e9f96b5763a89a246f53250e46c2796b  rabbitmq-server-3.6.5.tar.xz
5f37a357fbc66ab013f3aa889c2fcd80  grep.patch"
sha256sums="b1ffe4a47550474c7a5b8ab47f4cd40549b84ede361302fa58863f27f17be3ec  rabbitmq-server.initd
9cce79e90835317b9704ecdf44e7dbc71803a17c85c1402f2bb4b2edb0232ab2  rabbitmq-server.logrotate
9550433ca8aaf5130bf5235bb978c44d3c4694cbd09d97114b3859f4895788ec  rabbitmq-server-3.6.5.tar.xz
57d2bd63473d2cacf9f5a0b5d9523becaa9b30fc0d6419b7daa975e99ae53aa7  grep.patch"
sha512sums="a8bb02a7cae1f8720e5c7aaabfe6a2c0e731cffbe0d8f99bdcb6597daa654dc49e6d41943974601435700cf469eaa8286dc91a3255a6b9023754c3861fbb5cd9  rabbitmq-server.initd
b8655cb048ab3b32001d4e6920bb5366696f3a5da75c053605e9b270e771c548e36858dca8338813d34376534515bba00af5e6dd7b4b1754a0e64a8fb756e3f3  rabbitmq-server.logrotate
50751a25b39a96a8b0665c9316d8a603050807597f932e0b3cc74f63fbd73a5668865ad7e7c58de5bef80295a5a3c472731446e4e07c530812a6275703ce2388  rabbitmq-server-3.6.5.tar.xz
18e30c7e5bfd0290321e98ae91023bf74393caccb410ab886a2a8154d15bf30ced68e393ae5318fdc045fdf444759bb775cd8be4ee7b5abb692e0e34e2c6d3c5  grep.patch"