summaryrefslogtreecommitdiff
blob: d262c8623222ab32ca21db48fdf56836576bbd6e (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/sobexsrv/sobexsrv-1.0.0_pre4.ebuild,v 1.3 2006/04/29 01:00:35 joker Exp $

inherit eutils

MY_P="${P/_pre/pre}"

IUSE="gtk"

DESCRIPTION="Scripting/Secure OBEX Server (for BlueZ Linux)"
SRC_URI="http://www.mulliner.org/bluetooth/${MY_P}.tar.gz"
HOMEPAGE="http://www.mulliner.org/bluetooth/sobexsrv.php"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 sparc ~x86"

DEPEND="dev-libs/openobex
	net-wireless/bluez-libs"

RDEPEND="${DEPEND}
	net-wireless/bluez-utils
	gtk? ( >=dev-python/pygtk-2.2 )"

S="${WORKDIR}/${MY_P}"


pkg_setup() {
	enewgroup sobexsrv
	enewuser sobexsrv -1 -1 /var/spool/sobexsrv sobexsrv
}

src_unpack() {
	unpack ${A}

	cd "${S}/src"
	sed -e 's/^CFLAGS =/CFLAGS +=/' \
	    -e 's/^CC =/CC ?=/' \
	    -i Makefile
}

src_compile() {
	emake || die "emake failed"
}

src_install() {
	make DESTDIR="${D}" install || die "make install failed"
	dodoc AUTHOR CHANGELOG CONFIG README SECURITY TODO

	use gtk || rm "${D}/usr/bin/sobexsrv_handler"

	newinitd "${FILESDIR}/init.d_sobexsrv" sobexsrv
	newconfd "${FILESDIR}/conf.d_sobexsrv" sobexsrv

	keepdir /var/spool/sobexsrv
	fowners sobexsrv:sobexsrv /var/spool/sobexsrv
}

pkg_postinst() {
	echo
	einfo "/usr/bin/sobexsrv is *NOT* installed set-uid root by"
	einfo "default. suid is required for the chroot option (-R)."
	echo
	einfo "Execute the following commands to enable suid:"
	echo
	einfo "chown root:sobexsrv /usr/bin/sobexsrv"
	einfo "chmod 2710 /usr/bin/sobexsrv"
	echo
}