Gentoo Archives: gentoo-commits

From: "Nathan Phillip Brink (binki)" <binki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-irc/unrealircd: unrealircd-3.2.10.2.ebuild ChangeLog
Date: Tue, 03 Dec 2013 05:34:51
Message-Id: 20131203053442.385852004B@flycatcher.gentoo.org
1 binki 13/12/03 05:34:42
2
3 Modified: ChangeLog
4 Added: unrealircd-3.2.10.2.ebuild
5 Log:
6 Bump to unrealircd-3.2.10.2 for security bug #492526 addressing issues in 3.2.10 and 3.2.10.1.
7
8 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 743A52E86BA81050)
9
10 Revision Changes Path
11 1.111 net-irc/unrealircd/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-irc/unrealircd/ChangeLog?rev=1.111&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-irc/unrealircd/ChangeLog?rev=1.111&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-irc/unrealircd/ChangeLog?r1=1.110&r2=1.111
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-irc/unrealircd/ChangeLog,v
20 retrieving revision 1.110
21 retrieving revision 1.111
22 diff -u -r1.110 -r1.111
23 --- ChangeLog 18 Nov 2013 17:06:50 -0000 1.110
24 +++ ChangeLog 3 Dec 2013 05:34:42 -0000 1.111
25 @@ -1,6 +1,13 @@
26 # ChangeLog for net-irc/unrealircd
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-irc/unrealircd/ChangeLog,v 1.110 2013/11/18 17:06:50 binki Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-irc/unrealircd/ChangeLog,v 1.111 2013/12/03 05:34:42 binki Exp $
30 +
31 +*unrealircd-3.2.10.2 (03 Dec 2013)
32 +
33 + 03 Dec 2013; Nathan Phillip Brink <binki@g.o>
34 + +unrealircd-3.2.10.2.ebuild:
35 + Bump to unrealircd-3.2.10.2 for security bug #492526 addressing issues in
36 + 3.2.10 and 3.2.10.1.
37
38 18 Nov 2013; Nathan Phillip Brink <binki@g.o>
39 unrealircd-3.2.10-r1.ebuild, unrealircd-3.2.10.1.ebuild,
40
41
42
43 1.1 net-irc/unrealircd/unrealircd-3.2.10.2.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-irc/unrealircd/unrealircd-3.2.10.2.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-irc/unrealircd/unrealircd-3.2.10.2.ebuild?rev=1.1&content-type=text/plain
47
48 Index: unrealircd-3.2.10.2.ebuild
49 ===================================================================
50 # Copyright 1999-2013 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/net-irc/unrealircd/unrealircd-3.2.10.2.ebuild,v 1.1 2013/12/03 05:34:42 binki Exp $
53
54 EAPI=4
55
56 inherit eutils ssl-cert versionator multilib user
57
58 MY_P=Unreal${PV/_/-}
59
60 DESCRIPTION="An advanced Internet Relay Chat daemon"
61 HOMEPAGE="http://www.unrealircd.com/"
62 SRC_URI="http://www.unrealircd.com/downloads/${MY_P}.tar.gz"
63
64 SLOT="0"
65 LICENSE="GPL-2"
66 KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd ~amd64-linux"
67 IUSE="curl ipv6 +extban-stacking +operoverride operoverride-verify +prefixaq
68 showlistmodes shunnotices ssl topicisnuhost +usermod zlib"
69
70 RDEPEND="ssl? ( dev-libs/openssl )
71 zlib? ( sys-libs/zlib )
72 curl? ( net-misc/curl[adns] )
73 dev-libs/tre
74 >=net-dns/c-ares-1.7"
75 DEPEND="${RDEPEND}
76 >=sys-apps/sed-4
77 virtual/pkgconfig"
78
79 S=${WORKDIR}/Unreal${PV}
80
81 pkg_setup() {
82 enewuser unrealircd
83 }
84
85 src_prepare() {
86 # QA check against bundled pkgs
87 rm extras/*.gz || die
88
89 sed -i \
90 -e "s:ircd\.pid:${EPREFIX}/var/run/unrealircd/ircd.pid:" \
91 -e "s:ircd\.log:${EPREFIX}/var/log/unrealircd/ircd.log:" \
92 -e "s:debug\.log:${EPREFIX}/var/log/unrealircd/debug.log:" \
93 -e "s:ircd\.tune:${EPREFIX}/var/lib/unrealircd/ircd.tune:" \
94 include/config.h \
95 || die "sed failed"
96 }
97
98 src_configure() {
99 econf \
100 --with-listen=5 \
101 --with-dpath="${EPREFIX}"/etc/unrealircd \
102 --with-spath="${EPREFIX}"/usr/bin/unrealircd \
103 --with-nick-history=2000 \
104 --with-sendq=3000000 \
105 --with-bufferpool=18 \
106 --with-permissions=0600 \
107 --with-fd-setsize=1024 \
108 --with-system-cares \
109 --with-system-tre \
110 --enable-dynamic-linking \
111 $(use_enable curl libcurl "${EPREFIX}"/usr) \
112 $(use_enable ipv6 inet6) \
113 $(use_enable prefixaq) \
114 $(use_enable ssl ssl "${EPREFIX}"/usr) \
115 $(use_enable zlib ziplinks "${EPREFIX}"/usr) \
116 $(use_with showlistmodes) \
117 $(use_with topicisnuhost) \
118 $(use_with shunnotices) \
119 $(use_with !operoverride no-operoverride) \
120 $(use_with operoverride-verify) \
121 $(use_with !usermod disableusermod) \
122 $(use_with !extban-stacking disable-extendedban-stacking)
123 }
124
125 src_install() {
126 keepdir /var/{lib,log}/unrealircd
127
128 newbin src/ircd unrealircd
129
130 exeinto /usr/$(get_libdir)/unrealircd/modules
131 doexe src/modules/*.so
132
133 dodir /etc/unrealircd
134 dosym /var/lib/unrealircd /etc/unrealircd/tmp
135
136 insinto /etc/unrealircd
137 doins {badwords.*,help,spamfilter,dccallow}.conf
138 newins doc/example.conf unrealircd.conf
139
140 insinto /etc/unrealircd/aliases
141 doins aliases/*.conf
142
143 local so_suffix=so
144 [[ ${CHOST} == -*mingw* ]] && so_suffix=dll
145 sed -i \
146 -e s:src/modules:"${EPREFIX}"/usr/$(get_libdir)/unrealircd/modules: \
147 -e '/loadmodule.*\.'${so_suffix}'/s;^//;;' \
148 -e s:ircd\\.log:"${EPREFIX}"/var/log/unrealircd/ircd.log: \
149 "${ED}"/etc/unrealircd/unrealircd.conf \
150 || die
151
152 dodoc \
153 Changes Donation Unreal.nfo \
154 ircdcron/{ircd.cron,ircdchk} \
155 || die "dodoc failed"
156 dohtml doc/*.html
157
158 newinitd "${FILESDIR}"/unrealircd.initd unrealircd
159 newconfd "${FILESDIR}"/unrealircd.confd-r1 unrealircd
160
161 # config should be read-only
162 fperms -R 0640 /etc/unrealircd{,/aliases}
163 fperms 0750 /etc/unrealircd{,/aliases}
164 # state is editable but not owned by unrealircd directly
165 fperms 0770 /var/{lib,log}/unrealircd
166 fowners -R root:unrealircd /{etc,var/{lib,log}}/unrealircd
167 }
168
169 pkg_preinst() {
170 # Must pre-create directories; otherwise their permissions are lost
171 # on installation.
172
173 # Usage: _unrealircd_dir_permissions <user> <group> <mode> <dir>[, <dir>…]
174 #
175 # Ensure that directories are created with the correct permissions
176 # before portage tries to merge them to the filesystem because,
177 # otherwise, those directories are installed world-readable.
178 #
179 # If this is a first-time install, create those directories with
180 # correct permissions before installing. Otherwise, update
181 # permissions—but only if we are replacing an unrealircd ebuild at
182 # least as old as net-irc/unrealircd-3.2.10. Portage handles normal
183 # file permissions correctly, so no need for recursive
184 # chmoding/chowning.
185 _unrealircd_dir_permissions() {
186 local user=${1} group=${2} mode=${3} dir v
187 shift 3
188 while dir=${1} && shift; do
189 if [[ ! -d "${EROOT}${dir}" ]]; then
190 ebegin "Creating ${EROOT}${dir} with correct permissions"
191 install -d -m "${mode}" -o "${user}" -g "${group}" "${EROOT}${dir}" || die
192 eend ${?}
193 elif ! [[ ${REPLACING_VERSIONS} ]] || for v in ${REPLACING_VERSIONS}; do
194 # If 3.2.10 ≤ ${REPLACING_VERSIONS}, then we update
195 # existing permissions.
196 version_is_at_least "${v}" 3.2.10 && break
197 done; then
198 ebegin "Correcting permissions of ${EROOT}${dir} left by ${CATEGORY}/${PN}-${v}"
199 chmod "${mode}" "${EROOT}${dir}" \
200 && chown ${user}:${group} "${EROOT}${dir}" \
201 || die "Unable to correct permissions of ${EROOT}${dir}"
202 eend ${?}
203 fi
204 done
205 }
206
207 # unrealircd only needs to be able to read files in /etc/unrealircd.
208 _unrealircd_dir_permissions root unrealircd 0750 etc/unrealircd{,/aliases}
209
210 # unrealircd needs to be able to create files in /var/lib/unrealircd
211 # and /var/log/unrealircd.
212 _unrealircd_dir_permissions root unrealircd 0770 var/{lib,log}/unrealircd
213 }
214
215 pkg_postinst() {
216 # Move docert call from scr_install() to install_cert in pkg_postinst for
217 # bug #201682
218 if use ssl ; then
219 if [[ ! -f "${EROOT}"/etc/unrealircd/server.cert.key ]]; then
220 install_cert /etc/unrealircd/server.cert
221 chown unrealircd "${EROOT}"/etc/unrealircd/server.cert.*
222 chmod 0640 "${EROOT}"/etc/unrealircd/server.cert.*
223 ln -snf server.cert.key "${EROOT}"/etc/unrealircd/server.key.pem
224 fi
225 fi
226
227 local unrealircd_conf="${EROOT}"/etc/unrealircd/unrealircd.conf
228 # Fix up the default cloak keys.
229 if grep -qe '"and another one";$' "${unrealircd_conf}" && grep -qe '"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";$' "${unrealircd_conf}"; then
230 ebegin "Generating cloak-keys"
231 local keys=(
232 $(unrealircd -k 2>&1 | tail -n 3)
233 )
234 [[ -n ${keys[0]} || -n ${keys[1]} || -n ${keys[2]} ]]
235 eend $?
236
237 ebegin "Substituting cloak-keys into ${unrealircd_conf}"
238 sed -i \
239 -e '/cloak-keys/ {
240 n
241 s/"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";/"'"${keys[0]}"'";/
242 n
243 s/"and another one";/"'"${keys[1]}"'";/
244 n
245 s/"and another one";/"'"${keys[2]}"'";/
246 }' \
247 "${unrealircd_conf}"
248 eend $?
249 fi
250
251 elog "UnrealIRCd will not run until you've set up /etc/unrealircd/unrealircd.conf"
252 elog
253 elog "You can find example cron scripts here:"
254 elog " /usr/share/doc/${PF}/ircd.cron.gz"
255 elog " /usr/share/doc/${PF}/ircdchk.gz"
256 elog
257 elog "You can also use /etc/init.d/unrealircd to start at boot"
258 }