Skip to content

Commit 8009ff2

Browse files
author
Andrei Zavada
committed
copy APKBUILD, with instruction on how to use it
1 parent b052781 commit 8009ff2

File tree

6 files changed

+121
-0
lines changed

6 files changed

+121
-0
lines changed

rel/pkg/alpine/abuild/APKBUILD

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Contributor: Andrei Zavada <[email protected]>
2+
# Maintainer: Andrei Zavada <[email protected]>
3+
pkgname=riak
4+
pkgver="3.0.9.1"
5+
pkgtag="riak_kv-3.0.9.1-DEV"
6+
pkgrel=0
7+
pkgdesc="Riak is a distributed KV database"
8+
9+
arch="all"
10+
license="Apache 2.0"
11+
depends="bash"
12+
makedepends="" # "erlang-22"
13+
checkdepends=""
14+
install="riak.post-install riak.post-deinstall"
15+
subpackages=""
16+
source="
17+
https://github.com/hmmr/riak/archive/refs/tags/$pkgtag.tar.gz
18+
riak.initd
19+
riak.confd
20+
"
21+
builddir="$srcdir/"
22+
23+
build() {
24+
cd riak-$pkgtag
25+
make rel-alpine
26+
rm -rf rel/riak/lib/eleveldb-riak_kv-3.0.0/c_src/snappy-1.0.4/testdata
27+
:
28+
}
29+
30+
check() {
31+
# Replace with proper check command(s)
32+
:
33+
}
34+
35+
package() {
36+
reldir="$srcdir/riak-$pkgtag/rel/riak"
37+
mkdir -p "$pkgdir/usr/bin"
38+
mkdir -p "$pkgdir/usr/sbin"
39+
mkdir -p "$pkgdir/usr/lib/riak"
40+
mkdir -p "$pkgdir/var/lib/riak"
41+
mkdir -p "$pkgdir/var/log/riak"
42+
mkdir -p "$pkgdir/etc/riak"
43+
mkdir -p "$pkgdir/run/riak"
44+
for f in riak-admin riak-chkconfig riak-debug riak-repl; do
45+
cp "$reldir/bin/$f" "$pkgdir/usr/bin"
46+
done
47+
cp "$reldir/usr/bin/riak" "$pkgdir/usr/sbin"
48+
install "$reldir/etc/riak.conf" "$pkgdir/etc/riak/riak.conf"
49+
cp -R "$reldir"/bin "$pkgdir/usr/lib/riak"
50+
cp -R "$reldir"/etc/* "$pkgdir/etc/riak"
51+
cp -R "$reldir"/erts-* "$pkgdir/usr/lib/riak"
52+
cp -R "$reldir"/share "$pkgdir/usr/lib/riak"
53+
cp -R "$reldir"/releases "$pkgdir/usr/lib/riak"
54+
cp -R "$reldir"/lib "$pkgdir/usr/lib/riak"
55+
cp -R "$reldir"/data/* "$pkgdir/var/lib/riak"
56+
57+
install -m755 -D "$srcdir"/$pkgname.initd \
58+
"$pkgdir"/etc/init.d/$pkgname
59+
install -m644 -D "$srcdir"/$pkgname.confd \
60+
"$pkgdir"/etc/conf.d/$pkgname
61+
}
62+
63+
sha512sums="
64+
447e7567332db841aca0ff8d79cf621919b7740a5d5225e448ca0492077e5161bf3270cae8bf7ab856163492e26064eacf67ff94764beb2ac6efccb5b4bd7851 riak_kv-3.0.9.1-DEV.tar.gz
65+
53cd6ebd074a049d5a67541f987c7b46c0c81a7812ec60e0ce0748db36d387398fe6545a5cf1c098511f0a54c26d3ba1d10abc3a2c2e7edbe99cf476313de09e riak.initd
66+
a067fe1b6fdd5757cd407d0640e2194ded3eb8f23e0d5d0dffe8f4c23209bd40d108e4fab6690fe6de36feefee6b56c218ca80bfebcf838a6ca68ecf5964b2dd riak.confd
67+
"

rel/pkg/alpine/abuild/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Packaging Riak for Alpine Linux
2+
3+
Alpine Linux is a minimalistic Gentoo-inspired, source-based distribution.
4+
5+
Packaging instructions for Alpine cannot be placed in
6+
rel/pkg/alpine/Makefile without bending too many rules and
7+
conventions. Rather, following their
8+
[wiki](https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package),
9+
the idea is to place the contents of this directory in your abuild
10+
dir, and execute `abuild` in it.
11+
12+
Riak could not be built with the version of OTP currently available in
13+
Alpine (from the "community" repository) is 24. You will need to build
14+
and install version 22 manually (other versions may or may not work),
15+
or write an abuild for it.

rel/pkg/alpine/abuild/riak.confd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Sample conf.d file for alpine linux
2+
3+
#
4+
# Specify daemon options here.
5+
#
6+
7+
opts=""
8+
user="riak"
9+
group="riak"

rel/pkg/alpine/abuild/riak.initd

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/sbin/openrc-run
2+
3+
name="$SVCNAME"
4+
command="/usr/sbin/$SVCNAME"
5+
command_args="start"
6+
command_background="yes"
7+
8+
pidfile="/run/riak/$name.pid"
9+
10+
depend() {
11+
need net
12+
after firewall
13+
}
14+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
deluser riak 2>/dev/null
4+
delgroup riak 2>/dev/null
5+
6+
rm -r /var/log/riak
7+
rm -rf /var/lib/riak
8+
rm -r /var/run/riak
9+
rm -r /etc/riak
10+
11+
exit 0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
addgroup -S riak 2>/dev/null
4+
adduser -S -D -H -s /bin/false -G riak -g riak riak 2>/dev/null
5+

0 commit comments

Comments
 (0)