Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 582658
Collapse All | Expand All

(-)a/net-im/bitlbee/bitlbee-3.4.2-r1.ebuild (+186 lines)
Line 0 Link Here
1
# Copyright 1999-2016 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Id$
4
5
EAPI=5
6
PYTHON_COMPAT=( python2_7 )
7
8
inherit eutils multilib user python-single-r1 systemd
9
10
if [[ ${PV} == "9999" ]]; then
11
	EGIT_REPO_URI="https://github.com/bitlbee/bitlbee.git"
12
	inherit git-r3
13
else
14
	SRC_URI="http://get.bitlbee.org/src/${P}.tar.gz"
15
	KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
16
fi
17
18
DESCRIPTION="irc to IM gateway that support multiple IM protocols"
19
HOMEPAGE="http://www.bitlbee.org/"
20
21
LICENSE="GPL-2"
22
SLOT="0"
23
IUSE_PROTOCOLS="xmpp msn oscar purple skype twitter yahoo"
24
IUSE="debug +gnutls ipv6 libevent libressl nss otr +plugins selinux test xinetd
25
	${IUSE_PROTOCOLS}"
26
27
COMMON_DEPEND="
28
	>=dev-libs/glib-2.16
29
	purple? ( net-im/pidgin )
30
	libevent? ( dev-libs/libevent:= )
31
	otr? ( >=net-libs/libotr-4 )
32
	gnutls? ( net-libs/gnutls:= )
33
	!gnutls? (
34
		nss? ( dev-libs/nss )
35
		!nss? (
36
			libressl? ( dev-libs/libressl:= )
37
			!libressl? ( dev-libs/openssl:0= )
38
		)
39
	)
40
	"
41
DEPEND="${COMMON_DEPEND}
42
	dev-lang/python
43
	virtual/pkgconfig
44
	selinux? ( sec-policy/selinux-bitlbee )
45
	test? ( dev-libs/check )"
46
47
RDEPEND="${COMMON_DEPEND}
48
	virtual/logger
49
	skype? (
50
		dev-python/skype4py[${PYTHON_USEDEP}]
51
		net-im/skype
52
	)
53
	xinetd? ( sys-apps/xinetd )"
54
55
pkg_pretend() {
56
	if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
57
		local chat_enabled
58
		for flag in "${IUSE_PROTOCOLS}"; do
59
			use $flag && chat_enabled=1
60
		done
61
		if [[ -z "${chat_enabled}" ]]; then
62
			die "Please enable at least one chat protocol."
63
		fi
64
	fi
65
}
66
67
pkg_setup() {
68
	use skype && python-single-r1_pkg_setup
69
70
	enewgroup bitlbee
71
	enewuser bitlbee -1 -1 /var/lib/bitlbee bitlbee
72
}
73
74
src_prepare() {
75
	sed -i \
76
		-e "s@/usr/local/sbin/bitlbee@/usr/sbin/bitlbee@" \
77
		-e "s/nobody/bitlbee/" \
78
		-e "s/}/	disable         = yes\n}/" \
79
		doc/bitlbee.xinetd || die "sed failed in xinetd"
80
81
	sed -i \
82
		-e "s@mozilla-nss@nss@g" \
83
		configure || die "sed failed in configure"
84
85
	use skype && python_fix_shebang protocols/skype/skyped.py
86
87
	[[ ${PV} != "9999" ]] && epatch "${FILESDIR}"/${PN}-3.2.1-configure.patch
88
	epatch "${FILESDIR}"/${PN}-service-user-bitlbee.patch
89
	epatch_user
90
}
91
92
src_configure() {
93
	# setup plugins, protocol, ipv6 and debug
94
	myconf="--jabber=$(usex xmpp 1 0)"
95
	for flag in debug ipv6 plugins ${IUSE_PROTOCOLS/xmpp/} ; do
96
		myconf="${myconf} --${flag}=$(usex ${flag} 1 0)"
97
	done
98
99
	# set otr
100
	if use otr && use plugins ; then
101
		myconf="${myconf} --otr=plugin"
102
	else
103
		if use otr ; then
104
			ewarn "OTR support has been disabled automatically because it"
105
			ewarn "requires the plugins USE flag."
106
		fi
107
		myconf="${myconf} --otr=0"
108
	fi
109
110
	# setup ssl use flags
111
	if use gnutls ; then
112
		myconf="${myconf} --ssl=gnutls"
113
		einfo "Using gnutls for SSL support"
114
	else
115
		ewarn "Only gnutls is officially supported by upstream."
116
		if use nss ; then
117
			myconf="${myconf} --ssl=nss"
118
			einfo "Using nss for SSL support"
119
		else
120
			myconf="${myconf} --ssl=openssl"
121
			einfo "Using openssl for SSL support"
122
		fi
123
	fi
124
125
	# set event handler
126
	if use libevent ; then
127
		myconf="${myconf} --events=libevent"
128
	else
129
		myconf="${myconf} --events=glib"
130
	fi
131
132
	# NOTE: bitlbee's configure script is not an autotool creation,
133
	# so that is why we don't use econf.
134
	./configure \
135
		--prefix=/usr --datadir=/usr/share/bitlbee \
136
		--etcdir=/etc/bitlbee --plugindir=/usr/$(get_libdir)/bitlbee \
137
		--systemdsystemunitdir=$(systemd_get_unitdir) \
138
		--doc=1 --strip=0 ${myconf} || die "econf failed"
139
140
	sed -i \
141
		-e "/^EFLAGS/s:=:&${LDFLAGS} :" \
142
		Makefile.settings || die "sed failed"
143
}
144
145
src_install() {
146
	emake install install-etc install-doc install-dev install-systemd DESTDIR="${D}"
147
148
	keepdir /var/lib/bitlbee
149
	fperms 700 /var/lib/bitlbee
150
	fowners bitlbee:bitlbee /var/lib/bitlbee
151
152
	dodoc doc/{AUTHORS,CHANGES,CREDITS,FAQ,README}
153
154
	if use skype ; then
155
		newdoc protocols/skype/NEWS NEWS-skype
156
		newdoc protocols/skype/README README-skype
157
	fi
158
159
	if use xinetd ; then
160
		insinto /etc/xinetd.d
161
		newins doc/bitlbee.xinetd bitlbee
162
	fi
163
164
	newinitd "${FILESDIR}"/bitlbee.initd-r1 bitlbee
165
	newconfd "${FILESDIR}"/bitlbee.confd-r1 bitlbee
166
167
	exeinto /usr/share/bitlbee
168
	doexe utils/{convert_purple.py,bitlbee-ctl.pl}
169
}
170
171
pkg_postinst() {
172
	chown -R bitlbee:bitlbee "${ROOT}"/var/lib/bitlbee
173
	[[ -d "${ROOT}"/var/run/bitlbee ]] &&
174
		chown -R bitlbee:bitlbee "${ROOT}"/var/run/bitlbee
175
176
	if [[ -z ${REPLACING_VERSIONS} ]]; then
177
		einfo
178
		elog "The bitlbee init script will now attempt to stop all processes owned by the"
179
		elog "bitlbee user, including per-client forks."
180
		elog
181
		elog "Tell the init script not to touch anything besides the main bitlbee process"
182
		elog "by changing the BITLBEE_STOP_ALL variable in"
183
		elog "	/etc/conf.d/bitlbee"
184
		einfo
185
	fi
186
}
(-)a/net-im/bitlbee/bitlbee-9999.ebuild (-31 / +30 lines)
Lines 20-27 HOMEPAGE="http://www.bitlbee.org/" Link Here
20
20
21
LICENSE="GPL-2"
21
LICENSE="GPL-2"
22
SLOT="0"
22
SLOT="0"
23
IUSE="debug gnutls ipv6 +xmpp libevent msn nss +oscar otr +plugins purple selinux
23
IUSE_PROTOCOLS="xmpp msn oscar purple skype twitter yahoo"
24
	skype ssl test twitter +yahoo xinetd libressl"
24
IUSE="debug +gnutls ipv6 libevent libressl nss otr +plugins selinux test xinetd
25
	${IUSE_PROTOCOLS}"
25
26
26
COMMON_DEPEND="
27
COMMON_DEPEND="
27
	>=dev-libs/glib-2.16
28
	>=dev-libs/glib-2.16
Lines 31-37 COMMON_DEPEND=" Link Here
31
	gnutls? ( net-libs/gnutls:= )
32
	gnutls? ( net-libs/gnutls:= )
32
	!gnutls? (
33
	!gnutls? (
33
		nss? ( dev-libs/nss )
34
		nss? ( dev-libs/nss )
34
		!nss? ( ssl? ( !libressl? ( dev-libs/openssl:0= ) libressl? ( dev-libs/libressl:= ) ) )
35
		!nss? (
36
			libressl? ( dev-libs/libressl:= )
37
			!libressl? ( dev-libs/openssl:0= )
38
		)
35
	)
39
	)
36
	"
40
	"
37
DEPEND="${COMMON_DEPEND}
41
DEPEND="${COMMON_DEPEND}
Lines 48-68 RDEPEND="${COMMON_DEPEND} Link Here
48
	)
52
	)
49
	xinetd? ( sys-apps/xinetd )"
53
	xinetd? ( sys-apps/xinetd )"
50
54
51
REQUIRED_USE="|| ( purple xmpp msn oscar yahoo )
55
pkg_pretend() {
52
	msn? ( || ( gnutls nss ssl ) )
56
	if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
53
	xmpp? ( !nss )"
57
		local chat_enabled
54
58
		for flag in "${IUSE_PROTOCOLS}"; do
55
pkg_setup() {
59
			use $flag && chat_enabled=1
56
	if use xmpp && ! use gnutls && ! use ssl ; then
60
		done
57
		einfo
61
		if [[ -z "${chat_enabled}" ]]; then
58
		elog "You have enabled support for Jabber but do not have SSL"
62
			die "Please enable at least one chat protocol."
59
		elog "support enabled.  This *will* prevent bitlbee from being"
63
		fi
60
		elog "able to connect to SSL enabled Jabber servers.  If you need to"
61
		elog "connect to Jabber over SSL, enable ONE of the following use"
62
		elog "flags: gnutls or ssl"
63
		einfo
64
	fi
64
	fi
65
}
65
66
67
pkg_setup() {
66
	use skype && python-single-r1_pkg_setup
68
	use skype && python-single-r1_pkg_setup
67
69
68
	enewgroup bitlbee
70
	enewgroup bitlbee
Lines 83-100 src_prepare() { Link Here
83
	use skype && python_fix_shebang protocols/skype/skyped.py
85
	use skype && python_fix_shebang protocols/skype/skyped.py
84
86
85
	[[ ${PV} != "9999" ]] && epatch "${FILESDIR}"/${PN}-3.2.1-configure.patch
87
	[[ ${PV} != "9999" ]] && epatch "${FILESDIR}"/${PN}-3.2.1-configure.patch
88
	epatch "${FILESDIR}"/${PN}-service-user-bitlbee.patch
86
	epatch_user
89
	epatch_user
87
}
90
}
88
91
89
src_configure() {
92
src_configure() {
90
	# setup plugins, protocol, ipv6 and debug
93
	# setup plugins, protocol, ipv6 and debug
91
	use xmpp && myconf="${myconf} --jabber=1"
94
	myconf="--jabber=$(usex xmpp 1 0)"
92
	for flag in debug ipv6 msn oscar plugins purple skype twitter yahoo ; do
95
	for flag in debug ipv6 plugins ${IUSE_PROTOCOLS/xmpp/} ; do
93
		if use ${flag} ; then
96
		myconf="${myconf} --${flag}=$(usex ${flag} 1 0)"
94
			myconf="${myconf} --${flag}=1"
95
		else
96
			myconf="${myconf} --${flag}=0"
97
		fi
98
	done
97
	done
99
98
100
	# set otr
99
	# set otr
Lines 112-126 src_configure() { Link Here
112
	if use gnutls ; then
111
	if use gnutls ; then
113
		myconf="${myconf} --ssl=gnutls"
112
		myconf="${myconf} --ssl=gnutls"
114
		einfo "Using gnutls for SSL support"
113
		einfo "Using gnutls for SSL support"
115
	elif use ssl ; then
116
		myconf="${myconf} --ssl=openssl"
117
		einfo "Using openssl for SSL support"
118
	elif use nss ; then
119
		myconf="${myconf} --ssl=nss"
120
		einfo "Using nss for SSL support"
121
	else
114
	else
122
		myconf="${myconf} --ssl=bogus"
115
		ewarn "Only gnutls is officially supported by upstream."
123
		einfo "You will not have any encryption support enabled."
116
		if use nss ; then
117
			myconf="${myconf} --ssl=nss"
118
			einfo "Using nss for SSL support"
119
		else
120
			myconf="${myconf} --ssl=openssl"
121
			einfo "Using openssl for SSL support"
122
		fi
124
	fi
123
	fi
125
124
126
	# set event handler
125
	# set event handler
(-)a/net-im/bitlbee/files/bitlbee-service-user-bitlbee.patch (+10 lines)
Line 0 Link Here
1
--- a/init/bitlbee.service.in
2
+++ b/init/bitlbee.service.in
3
@@ -4,6 +4,7 @@
4
 
5
 [Service]
6
 ExecStart=@sbindir@bitlbee -F -n
7
+User=bitlbee
8
 
9
 [Install]
10
 WantedBy=multi-user.target
(-)a/net-im/bitlbee/metadata.xml (-1 / +8 lines)
Lines 2-7 Link Here
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
3
<pkgmetadata>
4
	<maintainer type="person">
4
	<maintainer type="person">
5
		<email>alex_y_xu@yahoo.ca</email>
6
		<name>Alex Xu</name>
7
	</maintainer>
8
	<maintainer type="person">
5
		<email>wired@gentoo.org</email>
9
		<email>wired@gentoo.org</email>
6
		<name>Alex Alexander</name>
10
		<name>Alex Alexander</name>
7
	</maintainer>
11
	</maintainer>
Lines 9-14 Link Here
9
		<email>radhermit@gentoo.org</email>
13
		<email>radhermit@gentoo.org</email>
10
		<name>Tim Harder</name>
14
		<name>Tim Harder</name>
11
	</maintainer>
15
	</maintainer>
16
	<maintainer type="project">
17
		<email>proxy-maint@gentoo.org</email>
18
		<name>Proxy Maintainers</name>
19
	</maintainer>
12
	<use>
20
	<use>
13
		<flag name="libevent">Use libevent for event handling</flag>
21
		<flag name="libevent">Use libevent for event handling</flag>
14
		<flag name="nss">Use NSS for SSL support in MSN and Jabber</flag>
22
		<flag name="nss">Use NSS for SSL support in MSN and Jabber</flag>
15
- 

Return to bug 582658