summaryrefslogtreecommitdiffstats
path: root/testing/monkey/APKBUILD
blob: 32082b7ccffb8144254e1b844036a05fc37cb73a (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
# Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>

pkgname=monkey
pkgver=1.0.1
pkgrel=0
pkgdesc='A fast and lightweight HTTP server designed for embedded devices.'
url='http://monkey-project.com/'
license='GPL2'
arch='all'
makedepends='bash'
subpackages="$pkgname-doc"
source="http://monkey-project.com/releases/1.0/$pkgname-$pkgver.tar.gz
        strsignal.patch
        monkey.initd
        monkey.confd"

prepare() {
    cd "$srcdir"/$pkgname-$pkgver

    # Use POSIX-compliant strsignal instead SYS_SIGLIST
    patch -Np0 -i "$srcdir"/strsignal.patch || return 1

    # Don't install the banana script, use OpenRC daemon instead
    sed -i '/install -m 755 bin\/banana/d' configure || return 1
    rm man/banana.1 || return 1

    # Run monkey as http user
    sed -i '737s/nobody/http/' configure || return 1
}


build() {
    cd "$srcdir"/$pkgname-$pkgver

    ./configure \
        --prefix=/usr \
        --bindir=/usr/bin \
        --sysconfdir=/etc/$pkgname \
        --mandir=/usr/share/man \
        --datadir=/var/www \
        --logdir=/var/log/$pkgname \
        --plugdir=/usr/lib/$pkgname \
    || return 1

    make || return 1
}

package() {
    cd "$srcdir"/$pkgname-$pkgver
    make DESTDIR=$pkgdir install || return 1

    install -D -m0755 "$srcdir"/monkey.initd \
                      "$pkgdir"/etc/init.d/monkey || return 1
    install -D -m0644 "$srcdir"/monkey.confd \
                      "$pkgdir"/etc/conf.d/monkey || return 1
}

md5sums="5e08e4089e8b41ea90b0c98d6ca6433e  monkey-1.0.1.tar.gz
4e99ccbfbd00b17023c7b82e466c7aee  strsignal.patch
6630131d3ea75dbbf1033a4acc8cf983  monkey.initd
71805f446a12d747c52e18b8ac4b4704  monkey.confd"