summaryrefslogtreecommitdiff
path: root/packages/sys-apps/sydbox/sydbox.exlib
blob: a295d3a671f81a85d6a555048d0058040aff9ed3 (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
# Copyright 2009, 2010, 2011, 2012, 2013 Ali Polatel <alip@exherbo.org>
# Copyright 2015 Wouter van Kesteren <woutershep@gmail.com>
# Distributed under the terms of the GNU General Public License v2

export_exlib_phases src_test

SUMMARY="Sydbox, the other sandbox"
DESCRIPTION="Sydbox is a ptrace based sandbox for Linux."
ever is_scm || DOWNLOADS="https://dev.exherbo.org/distfiles/${PN}/${PNV}.tar.bz2"

LICENCES="GPL-2"
SLOT="0"
MYOPTIONS=""
DEPENDENCIES=""

BUGS_TO="alip@exherbo.org"
REMOTE_IDS="freecode:${PN}"

if ever at_least 1; then

    HOMEPAGE="https://git.exherbo.org/sydbox-1.git"

    # sydbox 1(_pre): has seccomp
    MYOPTIONS+="
    seccomp [[ description = [ Enable seccomp user filter support ] ]]"
    DEPENDENCIES+="
    build:
        seccomp? ( sys-kernel/linux-headers[>=3.5] )"

    DEFAULT_SRC_CONFIGURE_OPTION_ENABLES=( seccomp )

    if ever at_least 1.0.0; then
        # sydbox 1: external pinktrace
        DEPENDENCIES+="
        build+run:
            dev-libs/pinktrace[>=0.9.0]"
    else
        # sydbox 1_pre: internal pinktrace
        MYOPTIONS+="
        doc [[ description = [ Build API documentation of included pinktrace library ] ]]"
        DEPENDENCIES+="
        build:
            doc? ( app-doc/doxygen )"

        DEFAULT_SRC_CONFIGURE_PARAMS=( --enable-ipv6 )
        DEFAULT_SRC_CONFIGURE_OPTION_ENABLES+=( "doc doxygen" )
    fi

else

    HOMEPAGE="https://git.exherbo.org/sydbox.git"

    # sydbox 0: no seccomp, glib, external pinktrace
    DEPENDENCIES+="
    build+run:
        dev-libs/glib:2[>=2.18]
        dev-libs/pinktrace[>=0.1.2]"
fi

sydbox_src_test() {
    if ! esandbox check 2>/dev/null; then
        default
    else
        elog "Not running tests because sydbox doesn't work under sydbox"
        elog "set PALUDIS_DO_NOTHING_SANDBOXY=1 if you want to run the tests"

        if ever at_least 1.0.2; then
            elog "As of sydbox-1.0.2, tests are installed by default."
            elog "You can use the helper utility sydtest to run the tests."
        fi
    fi
}