aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/bitlbee/bitlbee_1.0.4.bb
blob: f9661dc485b6db08c465c3aaa5fffad51ee78f1a (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
DESCRIPTION = "Bitlbee is an IRC to IM gateway that support multiple IM protocols."
HOMEPAGE = "http://www.bitlbee.org/"
SECTION = "console/network"
LICENSE = "GPLv2"
DEPENDS = "glib-2.0 gnutls"
PR = "r0"

SRC_URI = "http://get.bitlbee.org/src/${P}.tar.gz \
           file://configure.patch \
           file://init-script"

S = "${WORKDIR}/bitlbee-${PV}"

EXTRA_OECONF = "--prefix=/usr \
                --datadir=/usr/share/bitlbee \
                --etcdir=/etc/bitlbee \
                --oscar=0 \
                --cpu=${TARGET_ARCH}"

do_configure () {
    # NOTE: bitlbee's configure script is not an autotool creation, 
    # so we do not use the default autotools_do_configure.
    ./configure ${EXTRA_OECONF} || die "./configure failed"
}

do_compile () {
    make CC="${CC}" LD="${LD}" || die "make failed"
    
    # make bitlbeed forking server
    cd ${S}/utils
    ${CC} bitlbeed.c -o bitlbeed || die "bitlbeed failed to compile"
}

do_install () {
    # install bitlbee
    install -d ${D}${localstatedir}/lib/bitlbee
    make install DESTDIR=${D} || die "install failed"
    make install-etc DESTDIR=${D} || die "install failed"

    # copy bitlbee forking server
    install ${S}/utils/bitlbeed ${D}${sbindir}/bitlbeed

    # copy init script
    install -d ${D}${sysconfdir}/init.d
    install ${WORKDIR}/init-script ${D}${sysconfdir}/init.d/bitlbee
    sed -i -e "s:BITLBEED_EXEC:${sbindir}/bitlbeed:" ${D}${sysconfdir}/init.d/bitlbee
    sed -i -e "s:BITLBEED_OPTS::" ${D}${sysconfdir}/init.d/bitlbee

    # copy bitlbee utils
    install -d ${D}${datadir}/bitlbee
    cp ${S}/utils/* ${D}${datadir}/bitlbee/
    rm ${D}${datadir}/bitlbee/bitlbeed*
}

pkg_postinst () {
    chown nobody:nogroup ${localstatedir}/lib/bitlbee
    chmod 700 ${localstatedir}/lib/bitlbee
}


SRC_URI[md5sum] = "b92e301930e2322a86b73b1f6c857674"
SRC_URI[sha256sum] = "6f23f37ea641d67e56c61b70d3ac7d404243929c393302ead4758d4ffe6d5b1c"