/[packages]/updates/5/emacs/current/SPECS/emacs.spec
ViewVC logotype

Contents of /updates/5/emacs/current/SPECS/emacs.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1186819 - (show annotations) (download)
Thu Dec 28 21:39:43 2017 UTC (2 years, 1 month ago) by luigiwalser
File size: 10477 byte(s)
add patch from debian to fix CVE-2017-14482
1 %define _localstatedir /var/lib
2
3 Summary: GNU Emacs text editor with X11 support
4
5 Name: emacs
6 Version: 24.3
7 %define subrel 1
8 Release: %mkrel 10
9 License: GPLv3+
10 Group: Editors
11 URL: http://www.gnu.org/software/emacs/
12
13 Source0: ftp://ftp.gnu.org/pub/gnu/emacs/emacs-%{version}.tar.xz
14 Source2: gnu-mini.png
15 Source3: gnu-normal.png
16 Source4: gnu-large.png
17 Source5: emacs-config
18
19 Patch1: emacs-20.5-loadup.patch
20 Patch6: emacs-snapshot-same-etc-DOC-for-all.patch
21
22 Patch100: emacs-23.3-infofix.patch
23 Patch101: emacs-23.1.92-version.patch
24 Patch111: emacs-24.2-ispell-dictionaries-list-iso-8859-15.patch
25 # update dictionary names for hunspell (from fedora)
26 Patch112: emacs-24.3-hunspell-names.patch
27
28 Patch150: emacs-24.3-CVE-2014-3421.patch
29 Patch151: emacs-24.3-CVE-2014-3422.patch
30 Patch152: emacs-24.3-CVE-2014-3423.patch
31 Patch153: emacs-24.3-CVE-2014-3424.patch
32 Patch154: emacs-24.4-CVE-2017-14482.patch
33
34 BuildRequires: x11-server-common
35 BuildRequires: libx11-devel
36 BuildRequires: gcc
37 BuildRequires: libjpeg-devel
38 BuildRequires: libpng-devel
39 BuildRequires: libtiff-devel
40 BuildRequires: ncurses-devel
41 BuildRequires: ungif-devel
42 BuildRequires: texinfo
43 BuildRequires: xpm-devel
44 BuildRequires: gtk+3-devel
45 BuildRequires: imagemagick-devel
46 BuildRequires: gnutls-devel
47 BuildRequires: libxml2-devel
48 BuildRequires: pkgconfig(librsvg-2.0)
49 BuildRequires: pkgconfig(libotf)
50 BuildRequires: pkgconfig(m17n-flt)
51 BuildRequires: gpm-devel
52
53 Requires(preun): update-alternatives
54 Requires(post): update-alternatives
55
56 Requires: %{name}-common = %{version}
57 Provides: emacs = %{version}-%{release}
58 Provides: emacs-bin emacs-gtk
59
60 Conflicts: emacs-snapshot < %{version}-%{release}
61 Obsoletes: emacs-gtk <= 22.3
62 Obsoletes: emacs-X11 < 22.0.50
63 Provides: emacs-X11 < 22.0.50
64
65 Recommends: hunspell
66
67 %description
68 Emacs is a powerful, customizable, self-documenting, modeless text
69 editor. Emacs contains special code editing features, a scripting
70 language (elisp), and the capability to read mail, news, and more
71 without leaving the editor.
72
73 This package provides an emacs binary with support for X Windows.
74
75 %package el
76 Summary: GNU Emacs Lisp source files
77 Group: Editors
78 Requires: %{name}-common = %{version}
79 Conflicts: emacs-snapshot-el
80 BuildArch: noarch
81
82 %description el
83 The emacs-snapshot-el package contains the emacs elisp sources for
84 many of the elisp programs included with the main Emacs text editor
85 package.
86
87 You need to install this package only if you intend to modify any of
88 the Emacs packages or see some elisp examples.
89
90 %package doc
91 Summary: GNU Emacs documentation
92 Group: Editors
93 Requires: %{name}-common = %{version}
94 BuildArch: noarch
95 Conflicts: emacs-snapshot-doc
96
97 %description doc
98 Documentation for GNU Emacs.
99
100 %package leim
101 Summary: GNU Emacs Lisp code for international input methods
102 Group: Editors
103 BuildArch: noarch
104 Requires: %{name}-common = %{version}
105 Conflicts: emacs-snapshot-leim
106
107 %description leim
108 This package contains Emacs Lisp code for input methods for various
109 international character scripts.
110
111 %package nox
112 Summary: GNU Emacs text editor without support for X11
113 Group: Editors
114 Requires: %{name}-common = %{version}
115 Provides: emacs-bin
116
117 Conflicts: emacs-snapshot-nox
118
119 Requires(preun): update-alternatives
120 Requires(post): update-alternatives
121
122 %description nox
123 Emacs is a powerful, customizable, self-documenting, modeless text
124 editor. Emacs contains special code editing features, a scripting
125 language (elisp), and the capability to read mail, news, and more
126 without leaving the editor.
127
128 This package provides an emacs binary with no X Windows support for
129 running on a terminal.
130
131 %package common
132 Summary: Common files for GNU Emacs
133 Group: Editors
134
135 Obsoletes: gnus-emacs < 5.13.0
136 Provides: gnus-emacs = 5.13.0
137
138 Obsoletes: emacs-cedet < 1.0-0.pre7
139 Provides: emacs-cedet = 1.0-0.pre7
140
141 Conflicts: emacs-speedbar < 1.0
142 Provides: emacs-speedbar = 1.0
143
144 Obsoletes: emacs-tramp < 2.1.18-pre
145 Provides: emacs-tramp = 2.1.18-pre
146
147 Obsoletes: emacs-url
148 Provides: emacs-url
149
150 # (Lev) This doesn't look correct:
151 Obsoletes: emacs-pcomplete <= 2.4.2
152 Provides: emacs-pcomplete = 1.1.1
153
154 Obsoletes: eshell-emacs <= 2.4.2
155 Provides: eshell-emacs = 2.4.2
156
157 Obsoletes: emacs-easypg < 1.0.0
158 Provides: emacs-easypg = 1.0.0
159
160 Obsoletes: emacs-erc < 5.3
161 Provides: emacs-erc = 5.3
162
163 Conflicts: emacs-snapshot-common
164
165 # conflicts due to %%_bindir/{etags,rcs-checkin}
166 Conflicts: xemacs-extras
167
168 %description common
169 Emacs is a powerful, customizable, self-documenting, modeless text
170 editor. Emacs contains special code editing features, a scripting
171 language (elisp), and the capability to read mail, news, and more
172 without leaving the editor.
173
174 This package contains all of the common files needed by emacs-snapshot
175 or emacs-snapshot-nox
176
177 %prep
178 %setup -q
179
180 %__perl -p -i -e 's/ctags/gctags/g' etc/etags.1
181
182 %patch1 -p1 -b .loadup
183 %patch6 -p1
184
185 %patch100 -p1
186 %patch101 -p1 -b .version
187 %patch111 -p1
188 %patch112 -p1 -b .hunspell-name
189
190 %patch150 -p1 -b .CVE-2014-3421
191 %patch151 -p1 -b .CVE-2014-3422
192 %patch152 -p1 -b .CVE-2014-3423
193 %patch153 -p1 -b .CVE-2014-3424
194 %patch154 -p1 -b .CVE-2017-14482
195
196 %build
197 autoreconf -fi -I m4
198
199 PUREDEF="-DNCURSES_OSPEED_T"
200 XPUREDEF="-DNCURSES_OSPEED_T"
201
202 export CFLAGS="$RPM_OPT_FLAGS $PUREDEF -fno-zero-initialized-in-bss"
203
204 %configure2_5x --with-x=no
205 %make bootstrap
206
207 %make distclean
208 # Build binary without X support
209 %configure2_5x --with-x=no --with-gpm
210 %make
211 mv src/emacs src/nox-emacs
212
213 %make distclean
214 # Build binary with X support
215 %configure2_5x --with-x-toolkit=gtk3
216 %make
217
218 %install
219 mkdir -p %{buildroot}/usr
220
221 PATH=$PATH:/sbin
222 ARCHDIR=%{_target_platform}
223 %old_makeinstall sharedstatedir=%{buildroot}/var
224
225 rm -f %{buildroot}%{_bindir}/emacs
226 rm -f %{buildroot}%{_infodir}/dir
227
228 # remove sun specific stuff
229 rm -f %{buildroot}%{_datadir}/emacs/%{version}/etc/{emacstool.1,emacs.1,ctags.1,etags.1,sex.6}
230
231 # rename ctags to gctags
232 mv %{buildroot}%{_mandir}/man1/ctags.1.gz %{buildroot}%{_mandir}/man1/gctags.1.gz
233 mv %{buildroot}%{_bindir}/ctags %{buildroot}%{_bindir}/gctags
234
235 mkdir -p %{buildroot}%{_sysconfdir}/emacs
236 install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/emacs/site-start.el
237 (cd %{buildroot}%{_datadir}/emacs/%{version}/lisp; ln -s ../../../../..%{_sysconfdir}/emacs/site-start.el site-start.el)
238
239 install -d %{buildroot}%{_sysconfdir}/emacs/site-start.d
240
241
242 install -m755 src/nox-emacs %{buildroot}%{_bindir}/emacs-nox
243 chmod -t %{buildroot}%{_bindir}/emacs*
244
245 # create file lists
246
247 #
248 # emacs-doc file list
249 #
250 # 3.22MB of docs from emacs-common to emacs-doc to reduce size (tutorials, news, postscript files, ...)
251 # NB: etc/ps-prin{0,1}.ps are needed by ps-print
252 find %{buildroot}%{_datadir}/emacs/%{version}/etc/ -type f | \
253 egrep 'TUTORIAL\.|NEWS|ONEWS|.ps$'|fgrep -v /etc/ps-prin | \
254 sed "s^%{buildroot}^^" > doc-filelist
255
256 #
257 # emacs-el file list
258 #
259
260 # take every .el and .el.gz which have a corresponding .elc
261 find %{buildroot}%{_datadir}/emacs -name '*.el' -o -name '*.el.gz' | \
262 grep -v /leim/ | while read I; do
263 f=`basename $I .gz`
264 f=`basename $f .el`
265 if [ -e `dirname $I`/$f.elc ]; then
266 echo $I | sed "s^%{buildroot}^^"
267 fi
268 done > el-filelist
269
270 #
271 # emacs-common file list
272 #
273
274 # everything not in previous filelists, and remove a few things listed in %files
275 find %{buildroot}%{_datadir}/emacs/%{version} -type f -print -o -type d -printf "%%%%dir %%p\n" | \
276 grep -v /leim/ | sed "s^%{buildroot}^^" > common-filelist.raw
277 while read I; do
278 grep -qxF $I doc-filelist el-filelist || echo $I
279 done < common-filelist.raw > common-filelist
280
281 find %{buildroot}%{_libexecdir}/emacs -type f -print -o -type d -printf "%%%%dir %%p\n" | \
282 egrep -v 'movemail$|update-game-score$' | sed "s^%{buildroot}^^" >> common-filelist
283
284 # this conflicts with the info package
285 rm -f %{buildroot}%{_infodir}/info.info.gz
286
287 %define info_files ada-mode auth autotype bovine calc ccmode cl dbus dired-x ebrowse ede ediff edt efaq eieio eintr elisp emacs emacs-gnutls emacs-mime epa erc ert eshell eudc flymake forms gnus htmlfontify idlwave mairix-el message mh-e newsticker nxml-mode org pcl-cvs pgg rcirc reftex remember sasl sc semantic ses sieve smtpmail speedbar srecode tramp url vip viper widget wisent woman
288 have_info_files=$(echo $(ls %{buildroot}%{_infodir} | sed -e 's/\.info\.gz$//' | egrep -v -- '-[0-9]+$' | LC_ALL=C sort))
289
290 [ "$have_info_files" = "%info_files" ] || {
291 echo "you must modify the spec file, %%info_files should be: $have_info_files"
292 exit 1
293 }
294
295
296 %post common
297 # --section="GNU Emacs"
298 for f in %{info_files}; do %_install_info $f
299 done
300 :
301
302 %preun
303 for f in %{info_files}; do %_remove_install_info $f
304 done
305 :
306
307 %post nox
308 update-alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-nox 10
309
310 [[ ! -f %{_bindir}/emacs ]] && update-alternatives --auto emacs
311 :
312
313 %postun nox
314 [[ ! -f %{_bindir}/emacs-nox ]] && \
315 /usr/sbin/update-alternatives --remove emacs %{_bindir}/emacs-nox
316 :
317
318 %post
319 /usr/sbin/update-alternatives --install %{_bindir}/emacs emacs %{_bindir}/emacs-%{version} 21
320
321 %postun
322 [[ ! -f %{_bindir}/emacs-%{version} ]] && \
323 /usr/sbin/update-alternatives --remove emacs %{_bindir}/emacs-%{version}|| :
324
325 %files -f common-filelist common
326 %doc BUGS README src/COPYING
327 %{_localstatedir}/games/emacs
328 %dir %{_sysconfdir}/emacs/site-start.d
329 %dir %{_sysconfdir}/emacs
330 %config(noreplace) %{_sysconfdir}/emacs/site-start.el
331 %dir %{_datadir}/emacs
332 %dir %{_datadir}/emacs/site-lisp
333 %{_datadir}/emacs/%{version}/lisp/site-start.el
334 %attr(2755,root,mail) %{_libexecdir}/emacs/%{version}/%{_target_platform}/movemail
335 %attr(4755,games,root) %{_libexecdir}/emacs/%{version}/%{_target_platform}/update-game-score
336 %{_bindir}/emacsclient
337 %{_bindir}/etags
338 %{_bindir}/ebrowse
339 %{_bindir}/grep-changelog
340 %{_bindir}/gctags
341 %{_mandir}/*/*
342 %{_infodir}/*
343
344 %files -f doc-filelist doc
345
346 %files -f el-filelist el
347 %doc src/COPYING
348 %{_datadir}/emacs/%{version}/site-lisp/subdirs.el
349 %{_datadir}/emacs/site-lisp/subdirs.el
350 %{_datadir}/emacs/%{version}/leim/ja-dic/*.el.gz
351 %{_datadir}/emacs/%{version}/leim/quail/*.el.gz
352
353 %files leim
354 %doc src/COPYING
355 %{_datadir}/emacs/%{version}/leim/leim-list.el
356 %dir %{_datadir}/emacs/%{version}/leim/ja-dic
357 %{_datadir}/emacs/%{version}/leim/ja-dic/*.elc
358 %dir %{_datadir}/emacs/%{version}/leim/quail
359 %{_datadir}/emacs/%{version}/leim/quail/*.elc
360
361 %files nox
362 %doc src/COPYING
363 %{_bindir}/emacs-nox
364
365 %files
366 %doc src/COPYING
367 %{_bindir}/emacs-%{version}
368 %{_datadir}/applications/emacs.desktop
369 %{_iconsdir}/hicolor/*/apps/emacs*.png
370 %{_iconsdir}/hicolor/scalable/apps/emacs.svg
371 %{_iconsdir}/hicolor/scalable/mimetypes/emacs-document.svg

  ViewVC Help
Powered by ViewVC 1.1.26