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