Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-editors/emacs: ChangeLog emacs-23.3-r4.ebuild emacs-23.3-r3.ebuild
Date: Mon, 09 Jan 2012 10:15:04
Message-Id: 20120109101452.68D892004B@flycatcher.gentoo.org
1 ulm 12/01/09 10:14:52
2
3 Modified: ChangeLog
4 Added: emacs-23.3-r4.ebuild
5 Removed: emacs-23.3-r3.ebuild
6 Log:
7 Fix security flaw in EDE, bug 398227.
8
9 (Portage version: 2.1.10.44/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.461 app-editors/emacs/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs/ChangeLog?rev=1.461&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs/ChangeLog?rev=1.461&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs/ChangeLog?r1=1.460&r2=1.461
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/app-editors/emacs/ChangeLog,v
21 retrieving revision 1.460
22 retrieving revision 1.461
23 diff -u -r1.460 -r1.461
24 --- ChangeLog 8 Jan 2012 21:20:57 -0000 1.460
25 +++ ChangeLog 9 Jan 2012 10:14:52 -0000 1.461
26 @@ -1,6 +1,12 @@
27 # ChangeLog for app-editors/emacs
28 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs/ChangeLog,v 1.460 2012/01/08 21:20:57 ulm Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs/ChangeLog,v 1.461 2012/01/09 10:14:52 ulm Exp $
31 +
32 +*emacs-23.3-r4 (09 Jan 2012)
33 +
34 + 09 Jan 2012; Ulrich Müller <ulm@g.o> -emacs-23.3-r3.ebuild,
35 + +emacs-23.3-r4.ebuild:
36 + Fix security flaw in EDE, bug 398227.
37
38 08 Jan 2012; Ulrich Müller <ulm@g.o> emacs-23.3-r3.ebuild:
39 Restore fallback code in pkg_preinst because of failures with paludis.
40
41
42
43 1.1 app-editors/emacs/emacs-23.3-r4.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs/emacs-23.3-r4.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-editors/emacs/emacs-23.3-r4.ebuild?rev=1.1&content-type=text/plain
47
48 Index: emacs-23.3-r4.ebuild
49 ===================================================================
50 # Copyright 1999-2012 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/app-editors/emacs/emacs-23.3-r4.ebuild,v 1.1 2012/01/09 10:14:52 ulm Exp $
53
54 EAPI=4
55 WANT_AUTOMAKE="none"
56
57 inherit autotools elisp-common eutils flag-o-matic multilib
58
59 DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
60 HOMEPAGE="http://www.gnu.org/software/emacs/"
61 SRC_URI="mirror://gnu/emacs/${P}a.tar.bz2
62 mirror://gentoo/${P}-patches-4.tar.bz2"
63
64 LICENSE="GPL-3 FDL-1.3 BSD as-is MIT W3C unicode PSF-2"
65 SLOT="23"
66 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
67 IUSE="alsa aqua athena dbus gconf gif gpm gtk gzip-el hesiod jpeg kerberos livecd m17n-lib motif png sound source svg tiff toolkit-scroll-bars X Xaw3d xft +xpm"
68 REQUIRED_USE="aqua? ( !X )"
69
70 RDEPEND="sys-libs/ncurses
71 >=app-admin/eselect-emacs-1.2
72 net-libs/liblockfile
73 hesiod? ( net-dns/hesiod )
74 kerberos? ( virtual/krb5 )
75 alsa? ( media-libs/alsa-lib )
76 gpm? ( sys-libs/gpm )
77 dbus? ( sys-apps/dbus )
78 X? (
79 x11-libs/libXmu
80 x11-libs/libXt
81 x11-misc/xbitmaps
82 gconf? ( >=gnome-base/gconf-2.26.2 )
83 gif? ( media-libs/giflib )
84 jpeg? ( virtual/jpeg )
85 png? ( >=media-libs/libpng-1.4:0 )
86 svg? ( >=gnome-base/librsvg-2.0 )
87 tiff? ( media-libs/tiff )
88 xpm? ( x11-libs/libXpm )
89 xft? (
90 media-libs/fontconfig
91 media-libs/freetype
92 x11-libs/libXft
93 m17n-lib? (
94 >=dev-libs/libotf-0.9.4
95 >=dev-libs/m17n-lib-1.5.1
96 )
97 )
98 gtk? ( x11-libs/gtk+:2 )
99 !gtk? (
100 Xaw3d? ( x11-libs/libXaw3d )
101 !Xaw3d? (
102 athena? ( x11-libs/libXaw )
103 !athena? ( motif? ( >=x11-libs/openmotif-2.3:0 ) )
104 )
105 )
106 )"
107
108 DEPEND="${RDEPEND}
109 alsa? ( dev-util/pkgconfig )
110 dbus? ( dev-util/pkgconfig )
111 X? ( dev-util/pkgconfig )
112 gzip-el? ( app-arch/gzip )"
113
114 RDEPEND="${RDEPEND}
115 !<app-editors/emacs-vcs-${PV}
116 >=app-emacs/emacs-common-gentoo-1.3[X?]"
117
118 EMACS_SUFFIX="emacs-${SLOT}"
119 SITEFILE="20${PN}-${SLOT}-gentoo.el"
120 # FULL_VERSION keeps the full version number, which is needed in
121 # order to determine some path information correctly for copy/move
122 # operations later on
123 FULL_VERSION="${PV%%_*}"
124 S="${WORKDIR}/emacs-${FULL_VERSION}"
125
126 src_prepare() {
127 EPATCH_SUFFIX=patch epatch
128 epatch_user
129
130 sed -i \
131 -e "s:/usr/lib/crtbegin.o:$(`tc-getCC` -print-file-name=crtbegin.o):g" \
132 -e "s:/usr/lib/crtend.o:$(`tc-getCC` -print-file-name=crtend.o):g" \
133 "${S}"/src/s/freebsd.h || die "unable to sed freebsd.h settings"
134
135 if ! use alsa; then
136 # ALSA is detected even if not requested by its USE flag.
137 # Suppress it by supplying pkg-config with a wrong library name.
138 sed -i -e "/ALSA_MODULES=/s/alsa/DiSaBlEaLsA/" configure.in \
139 || die "unable to sed configure.in"
140 fi
141 if ! use gzip-el; then
142 # Emacs' build system automatically detects the gzip binary and
143 # compresses el files. We don't want that so confuse it with a
144 # wrong binary name
145 sed -i -e "s/ gzip/ PrEvEnTcOmPrEsSiOn/" configure.in \
146 || die "unable to sed configure.in"
147 fi
148
149 eautoreconf
150 }
151
152 src_configure() {
153 ALLOWED_FLAGS=""
154 strip-flags
155 filter-flags -fstrict-aliasing
156 append-flags $(test-flags -fno-strict-aliasing)
157
158 if use sh; then
159 replace-flags -O[1-9] -O0 #262359
160 elif use ia64; then
161 replace-flags -O[2-9] -O1 #325373
162 else
163 replace-flags -O[3-9] -O2
164 fi
165
166 local myconf
167
168 if use alsa && ! use sound; then
169 einfo "Although sound USE flag is disabled you chose to have alsa,"
170 einfo "so sound is switched on anyway."
171 myconf="${myconf} --with-sound"
172 else
173 myconf="${myconf} $(use_with sound)"
174 fi
175
176 if use X; then
177 myconf="${myconf} --with-x --without-ns"
178 myconf="${myconf} $(use_with gconf)"
179 myconf="${myconf} $(use_with toolkit-scroll-bars)"
180 myconf="${myconf} $(use_with gif) $(use_with jpeg)"
181 myconf="${myconf} $(use_with png) $(use_with svg rsvg)"
182 myconf="${myconf} $(use_with tiff) $(use_with xpm)"
183
184 if use xft; then
185 myconf="${myconf} --with-xft"
186 myconf="${myconf} $(use_with m17n-lib libotf)"
187 myconf="${myconf} $(use_with m17n-lib m17n-flt)"
188 else
189 myconf="${myconf} --without-xft"
190 myconf="${myconf} --without-libotf --without-m17n-flt"
191 use m17n-lib && ewarn \
192 "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
193 fi
194
195 # GTK+ is the default toolkit if USE=gtk is chosen with other
196 # possibilities. Emacs upstream thinks this should be standard
197 # policy on all distributions
198 if use gtk; then
199 einfo "Configuring to build with GIMP Toolkit (GTK+)"
200 myconf="${myconf} --with-x-toolkit=gtk"
201 elif use Xaw3d || use athena; then
202 einfo "Configuring to build with Athena/Lucid toolkit"
203 myconf="${myconf} --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
204 elif use motif; then
205 einfo "Configuring to build with Motif toolkit"
206 myconf="${myconf} --with-x-toolkit=motif"
207 else
208 einfo "Configuring to build with no toolkit"
209 myconf="${myconf} --with-x-toolkit=no"
210 fi
211
212 local f tk=
213 for f in gtk Xaw3d athena motif; do
214 use ${f} || continue
215 [[ ${tk} ]] \
216 && ewarn "USE flag \"${f}\" ignored (superseded by \"${tk}\")"
217 tk="${tk}${tk:+ }${f}"
218 done
219 elif use aqua; then
220 einfo "Configuring to build with Cocoa support"
221 myconf="${myconf} --with-ns --disable-ns-self-contained"
222 myconf="${myconf} --without-x"
223 else
224 myconf="${myconf} --without-x --without-ns"
225 fi
226
227 # According to configure, this option is only used for GNU/Linux
228 # (x86_64 and s390). For Gentoo Prefix we have to explicitly spell
229 # out the location because $(get_libdir) does not necessarily return
230 # something that matches the host OS's libdir naming (e.g. RHEL).
231 local crtdir=$($(tc-getCC) -print-file-name=crt1.o)
232 crtdir=${crtdir%/*}
233
234 econf \
235 --program-suffix=-${EMACS_SUFFIX} \
236 --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
237 --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
238 --with-crt-dir="${crtdir}" \
239 --with-gameuser="${GAMES_USER_DED:-games}" \
240 $(use_with hesiod) \
241 $(use_with kerberos) $(use_with kerberos kerberos5) \
242 $(use_with gpm) \
243 $(use_with dbus) \
244 ${myconf}
245 }
246
247 src_compile() {
248 export SANDBOX_ON=0 # for the unbelievers, see Bug #131505
249 # set last component of emacs-version to (package revision + 1)
250 touch src/emacs-${FULL_VERSION}.${PR#r}
251 emake CC="$(tc-getCC)"
252 }
253
254 src_install () {
255 local i m
256
257 emake install DESTDIR="${D}"
258
259 rm "${ED}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \
260 || die "removing duplicate emacs executable failed"
261 mv "${ED}"/usr/bin/emacs-${EMACS_SUFFIX} "${ED}"/usr/bin/${EMACS_SUFFIX} \
262 || die "moving Emacs executable failed"
263
264 # move man pages to the correct place
265 for m in "${ED}"/usr/share/man/man1/* ; do
266 mv "${m}" "${m%.1}-${EMACS_SUFFIX}.1" || die "mv man failed"
267 done
268
269 # move info dir to avoid collisions with the dir file generated by portage
270 mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
271 || die "moving info dir failed"
272 touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
273 docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
274
275 # avoid collision between slots, see bug #169033 e.g.
276 rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
277 rm -rf "${ED}"/usr/share/{applications,icons}
278 rm "${ED}"/var/lib/games/emacs/{snake,tetris}-scores
279 keepdir /var/lib/games/emacs
280
281 # remove unused <version>/site-lisp dir
282 rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
283
284 local c=";;"
285 if use source; then
286 insinto /usr/share/emacs/${FULL_VERSION}/src
287 # This is not meant to install all the source -- just the
288 # C source you might find via find-function
289 doins src/*.{c,h,m}
290 doins -r src/{m,s}
291 rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/Makefile.c
292 rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/{m,s}/README
293 c=""
294 fi
295
296 sed 's/^X//' >"${T}/${SITEFILE}" <<-EOF
297 X
298 ;;; ${PN}-${SLOT} site-lisp configuration
299 X
300 (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
301 X ${c}(setq find-function-C-source-directory
302 X ${c} "${EPREFIX}/usr/share/emacs/${FULL_VERSION}/src")
303 X (let ((path (getenv "INFOPATH"))
304 X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
305 X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
306 X (and path
307 X ;; move Emacs Info dir before anything else in /usr/share/info
308 X (let* ((p (cons nil (split-string path ":" t))) (q p))
309 X (while (and (cdr q) (not (string-match re (cadr q))))
310 X (setq q (cdr q)))
311 X (setcdr q (cons dir (delete dir (cdr q))))
312 X (setq Info-directory-list (prune-directory-list (cdr p)))))))
313 EOF
314 elisp-site-file-install "${T}/${SITEFILE}" || die
315
316 dodoc README BUGS
317
318 if use aqua; then
319 dodir /Applications/Gentoo
320 rm -rf "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app
321 mv nextstep/Emacs.app \
322 "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app || die
323 elog "Emacs${EMACS_SUFFIX#emacs}.app is in ${EPREFIX}/Applications/Gentoo."
324 elog "You may want to copy or symlink it into /Applications by yourself."
325 fi
326 }
327
328 pkg_preinst() {
329 # move Info dir file to correct name
330 local infodir=/usr/share/info/${EMACS_SUFFIX} f
331 if [[ -f ${ED}${infodir}/dir.orig ]]; then
332 mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
333 else
334 # this should not happen in EAPI 4
335 ewarn "Regenerating Info directory index in ${infodir} ..."
336 rm -f "${ED}"${infodir}/dir{,.*}
337 for f in "${ED}"${infodir}/*; do
338 if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
339 install-info --info-dir="${ED}"${infodir} "${f}" \
340 || die "install-info failed"
341 fi
342 done
343 fi
344 }
345
346 pkg_postinst() {
347 local f
348 for f in "${EROOT}"/var/lib/games/emacs/{snake,tetris}-scores; do
349 [[ -e ${f} ]] || touch "${f}"
350 done
351 chown "${GAMES_USER_DED:-games}" "${EROOT}"/var/lib/games/emacs
352
353 elisp-site-regen
354
355 if use livecd; then
356 # force an update of the emacs symlink for the livecd/dvd,
357 # because some microemacs packages set it with USE=livecd
358 eselect emacs update
359 else
360 eselect emacs update ifunset
361 fi
362
363 if use X; then
364 elog "You need to install some fonts for Emacs."
365 elog "Installing media-fonts/font-adobe-{75,100}dpi on the X server's"
366 elog "machine would satisfy basic Emacs requirements under X11."
367 elog "See also http://www.gentoo.org/proj/en/lisp/emacs/xft.xml"
368 elog "for how to enable anti-aliased fonts."
369 elog
370 fi
371
372 elog "You can set the version to be started by /usr/bin/emacs through"
373 elog "the Emacs eselect module, which also redirects man and info pages."
374 elog "Therefore, several Emacs versions can be installed at the same time."
375 elog "\"man emacs.eselect\" for details."
376 elog
377 elog "If you upgrade from a previous major version of Emacs, then it is"
378 elog "strongly recommended that you use app-admin/emacs-updater to rebuild"
379 elog "all byte-compiled elisp files of the installed Emacs packages."
380 }
381
382 pkg_postrm() {
383 elisp-site-regen
384 eselect emacs update ifunset
385 }