Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 281366 | Differences between
and this patch

Collapse All | Expand All

(-)ejabberd-2.1.0.ebuild.old (-26 / +59 lines)
Lines 10-15 Link Here
10
JABBER_RUN="/var/run/jabber"
10
JABBER_RUN="/var/run/jabber"
11
JABBER_SPOOL="/var/spool/jabber"
11
JABBER_SPOOL="/var/spool/jabber"
12
JABBER_LOG="/var/log/jabber"
12
JABBER_LOG="/var/log/jabber"
13
JABBER_DOC="/usr/share/doc/${PF}"
13
14
14
DESCRIPTION="The Erlang Jabber Daemon"
15
DESCRIPTION="The Erlang Jabber Daemon"
15
HOMEPAGE="http://www.ejabberd.im/"
16
HOMEPAGE="http://www.ejabberd.im/"
Lines 17-23 Link Here
17
LICENSE="GPL-2"
18
LICENSE="GPL-2"
18
SLOT="0"
19
SLOT="0"
19
KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~x86"
20
KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~x86"
20
IUSE="captcha debug mod_irc mod_muc mod_proxy65 mod_pubsub ldap odbc pam ssl web zlib"
21
22
EJABBERD_MODULES="mod_irc mod_muc mod_proxy65 mod_pubsub"
23
IUSE="captcha debug ldap odbc pam ssl web zlib ${EJABBERD_MODULES}"
21
24
22
DEPEND=">=net-im/jabber-base-0.01
25
DEPEND=">=net-im/jabber-base-0.01
23
	>=dev-libs/expat-1.95
26
	>=dev-libs/expat-1.95
Lines 51-58 Link Here
51
}
54
}
52
55
53
src_compile() {
56
src_compile() {
54
57
	emake $(use debug && echo debug=true ejabberd_debug=true) \
55
	emake $(use debug && echo debug=true ejabberd_debug=true) || die "compiling ejabberd core failed"
58
									|| die "compiling ejabberd core failed"
56
}
59
}
57
60
58
src_install() {
61
src_install() {
Lines 64-119 Link Here
64
		SPOOLDIR="${D}${JABBER_SPOOL}" \
67
		SPOOLDIR="${D}${JABBER_SPOOL}" \
65
		install || die "install failed"
68
		install || die "install failed"
66
69
67
	insinto ${JABBER_ETC}
68
69
	if use ssl; then
70
	if use ssl; then
70
		doins "${FILESDIR}/ssl.cnf"
71
		insinto "/etc/ssl"
71
		newins "${FILESDIR}/self-cert-v2.sh" self-cert.sh
72
73
		newins "${FILESDIR}"/ssl.cnf ejabberd.cnf \
74
										|| die "Installing ssl.conf failed"
75
76
		exeinto "${JABBER_DOC}/ssl"
77
78
		cat "${FILESDIR}"/self-cert-v3.sh | \
79
			sed -e "s:@SSL_CERT@:${JABBER_ETC}/ssl.pem:" \
80
				-e "s:@SSL_CONFIG@:/etc/ssl/ejabberd.cnf:" \
81
					> "${T}"/ssl-cert.sh || die "sed for self-cert.sh failed"
82
83
		doexe "${T}/ssl-cert.sh" || die "installing self-cert.sh failed"
72
	fi
84
	fi
73
85
74
	# Pam helper module permissions
86
	# Pam helper module permissions
75
	# http://www.process-one.net/docs/ejabberd/guide_en.html
87
	# http://www.process-one.net/docs/ejabberd/guide_en.html
76
	if use pam; then
88
	if use pam; then
77
		pamd_mimic_system xmpp auth account || die "Cannot create pam.d file"
89
		pamd_mimic_system xmpp auth account || die "Cannot create pam.d file"
78
		fperms 4750 "/usr/$(get_libdir)/erlang/lib/${P}/priv/bin/epam" || die "Cannot adjust epam permissions"
90
91
		fperms 4750 "/usr/$(get_libdir)/erlang/lib/${P}/priv/bin/epam" \
92
									|| die "Cannot adjust epam permissions"
79
	fi
93
	fi
80
94
81
	cd "${WORKDIR}/${P}/doc"
95
	cd "${WORKDIR}/${P}/doc"
82
	dodoc "release_notes_${PV%%_rc*}.txt"
96
	dodoc "release_notes_${PV%%_rc*}.txt" \
97
							|| die "Installing release_notes failed"
98
83
	rm "${D}"/usr/share/doc/"${PF}"/html/*.txt
99
	rm "${D}"/usr/share/doc/"${PF}"/html/*.txt
84
	chmod -x "${D}"/usr/share/doc/"${PF}"/html/*
100
	chmod -x "${D}"/usr/share/doc/"${PF}"/html/* \
101
							|| die "Removing executable bit from htmls failed"
102
103
	exeinto /usr/sbin
85
104
86
	# set up /usr/sbin/ejabberd wrapper
105
	# set up /usr/sbin/ejabberd wrapper
87
	cat "${FILESDIR}/ejabberd-wrapper-3.template" \
106
	cat "${FILESDIR}/ejabberd-wrapper-3.template" \
88
		| sed -e "s/\@libdir\@/$(get_libdir)/g" -e "s/\@version\@/${PV}/g" -e "s/\@doc\@/${PF}/g" \
107
		| sed	-e "s/\@libdir\@/$(get_libdir)/g" \
89
		> "${T}/ejabberd"
108
				-e "s/\@version\@/${PV}/g" \
90
	exeinto /usr/sbin
109
				-e "s/\@doc\@/${PF}/g" \
91
	doexe "${T}/ejabberd" || die
110
					> "${T}/ejabberd"
111
112
	doexe "${T}/ejabberd" || die "Installing ejabberd runscript failed"
92
113
93
	# set up /usr/sbin/ejabberdctl wrapper
114
	# set up /usr/sbin/ejabberdctl wrapper
94
	cat "${FILESDIR}/ejabberdctl-wrapper-3.template" \
115
	cat "${FILESDIR}/ejabberdctl-wrapper-3.template" \
95
		| sed -e "s:\@libdir\@:$(get_libdir):g" -e "s:\@version\@:${PV}:g" \
116
		| sed	-e "s:\@libdir\@:$(get_libdir):g" \
96
		> "${T}/ejabberdctl"
117
				-e "s:\@version\@:${PV}:g" \
97
	doexe "${T}/ejabberdctl"
118
					> "${T}/ejabberdctl"
119
120
	doexe "${T}/ejabberdctl" || die "Installing ejabberctl failed"
98
121
99
	dodir /var/lib/ejabberd
122
	dodir /var/lib/ejabberd
100
	newinitd "${FILESDIR}/${PN}-2.initd" ${PN} || die "Cannot install init.d script"
123
	newinitd "${FILESDIR}/${PN}-2.initd" ${PN} \
101
	newconfd "${FILESDIR}/${PN}-2.confd" ${PN} || die "Cannot install conf.d file"
124
										|| die "Cannot install init.d script"
125
	newconfd "${FILESDIR}/${PN}-2.confd" ${PN} \
126
										|| die "Cannot install conf.d file"
102
127
103
	# fix up the ssl cert paths in /etc/jabber/ejabberd.cfg to use the cert
128
	# fix up the ssl cert paths in /etc/jabber/ejabberd.cfg to use the cert
104
	# that would be generated by /etc/jabber/self-cert.sh
129
	# that would be generated by /etc/jabber/self-cert.sh
105
	sed -i -e "s/\/path\/to\/ssl.pem/\/etc\/jabber\/ssl.pem/g" \
130
	sed -e "s/\/path\/to\/ssl.pem/\/etc\/jabber\/ssl.pem/g" \
106
		"${D}${JABBER_ETC}/ejabberd.cfg" || die "Cannot sed ejabberd.cfg"
131
				-i "${D}${JABBER_ETC}/ejabberd.cfg" \
132
					|| die "Cannot set default cert path into ejabberd.cfg"
107
133
108
	# correct path to captcha script in default ejabberd.cfg
134
	# correct path to captcha script in default ejabberd.cfg
109
	sed -r 's|\{captcha_cmd,[[:space:]]*".+"\}|{captcha_cmd, "/usr/'$(get_libdir)'/erlang/lib/'${P}'/priv/bin/captcha.sh"}|' -i \
135
	local captcha_path="/usr/$(get_libdir)/erlang/lib/${P}/priv/bin/captcha.sh"
110
		"${D}${JABBER_ETC}/ejabberd.cfg" || die "Cannot sed ejabberd.cfg"
136
	local captcha_search='\{captcha_cmd,[[:space:]]*".+"\}'
137
	local captcha_replace="{captcha_cmd, ${captcha_path}}"
138
139
	sed -r "s|${captcha_search}|${captcha_replace}|" -i \
140
				"${D}${JABBER_ETC}/ejabberd.cfg" \
141
					|| die "Cannot set correct captcha path into ejabberd.cfg"
111
142
112
	# if mod_irc is not enabled, comment out the mod_irc in the default
143
	# if mod_irc is not enabled, comment out the mod_irc in the default
113
	# ejabberd.cfg
144
	# ejabberd.cfg
114
	if ! use mod_irc; then
145
	if ! use mod_irc; then
115
		sed -i -e "s/{mod_irc,/%{mod_irc,/" \
146
		sed -e "s/{mod_irc,/%{mod_irc,/" \
116
			"${D}${JABBER_ETC}/ejabberd.cfg" || die "Cannot sed ejabberd.cfg"
147
			-i "${D}${JABBER_ETC}/ejabberd.cfg" \
148
				|| die "Cannot comment out mod_irc module into ejabberd.cfg"
117
	fi
149
	fi
118
}
150
}
119
151
Lines 124-130 Link Here
124
156
125
	if use ssl ; then
157
	if use ssl ; then
126
		if [ ! -e /etc/jabber/ssl.pem ]; then
158
		if [ ! -e /etc/jabber/ssl.pem ]; then
127
			elog "Please edit ${JABBER_ETC}/ssl.cnf and run ${JABBER_ETC}/self-cert.sh"
159
			elog "Please edit ${JABBER_DOC}/ssl/ssl.cnf"
160
			elog "and run ${JABBER_DOC}/ssl/self-cert.sh."
128
			elog "Ejabberd may refuse to start without an SSL certificate"
161
			elog "Ejabberd may refuse to start without an SSL certificate"
129
		fi
162
		fi
130
	fi
163
	fi

Return to bug 281366