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