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