/[packages]/updates/8/vim/current/SPECS/vim.spec
ViewVC logotype

Contents of /updates/8/vim/current/SPECS/vim.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1251548 - (show annotations) (download)
Tue Aug 14 15:57:07 2018 UTC (5 years, 8 months ago) by tv
Original Path: cauldron/vim/current/SPECS/vim.spec
File size: 15812 byte(s)
new release
1 # Notes / Warning :
2 # - this package is not prefixable
3 # - to update official patches, aka SOURCE4, see README.mga in SOURCE4
4
5 %define python3path %{_includedir}/%{python3}
6
7 %define patchlevel 279
8
9 %define python_version %(rpm -q --qf '%%{epoch}:%%{version}' python)
10 %define ruby_version %(rpm -q --qf '%%{epoch}:%%{version}' ruby)
11
12 # Should we build X11 gui
13 %define buildgui 1
14
15 %{?_with_gui:%global buildgui 1}
16 %{?_without_gui:%global buildgui 0}
17
18 %define title VI editor
19 %define longtitle All-purpose text editor
20
21 %define baseversion 8.1
22 %define vimdir vim81
23
24 Name: vim
25 Version: %{baseversion}.%{patchlevel}
26 Release: %mkrel 1
27 Summary: VIsual editor iMproved
28 Url: http://www.vim.org/
29 License: Charityware
30 Group: Editors
31 # Generated with SOURCES/vim-update.sh
32 Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2
33 # read README.mga prior updating official patches:
34 Source3: README.mga
35 # http://vim.sourceforge.net/scripts/script.php?script_id=98
36 Source56: http://trific.ath.cx/Ftp/vim/syntax/dhcpd.vim
37 # from apparmor-utils package
38 Source57: apparmor.vim
39 Source58: cfengine.vim
40 Source59: nagios.vim
41 # icon rendering is ugly in GNOME3, so, adding a svg icon
42 Source60: gvim.svg
43 # empty rpm spec template
44 Source61: template.spec
45
46 # for updating Source0:
47 Source100: vim-update.sh
48
49 # MDK patches
50 Patch2: vim-5.6a-paths.patch
51 Patch3: vim-8.0-rpm-spec-syntax.patch
52 Patch8: vim-6.0af-man-path.patch
53 Patch10: xxd-locale.patch
54 Patch20: vimrc_hebrew.patch
55 # autoload template when creating new rpm spec files
56 Patch21: vim-8.0-mga-vimrc-spec-template-autoload.patch
57 Patch22: vim-6.1-fix-xterms-comments.patch
58 Patch23: vim-8.0-remove-docs.patch
59 Patch24: vim-8.0-outline-mode.patch
60 Patch26: vim-7.4-changelog-mode.patch
61 Patch28: vim-8.0-po-mode.patch
62 Patch30: vim-8.0-add-dhcpd-syntax.patch
63 Patch31: vim70-CVE-2007-2438.patch
64 Patch32: vim-8.0-highligh-global.diff
65
66 # Fedora patches
67 Patch100: vim-8.0-fortify_warnings-1.patch
68 Patch101: vim-7.4-fstabsyntax.patch
69 Patch3016: vim-8.0-copy-paste.patch
70 # migrate shebangs in script to /usr/bin/python3 and use python2 when necessary
71 Patch3017: vim-python3-tests.patch
72 BuildRequires: pkgconfig(python)
73 BuildRequires: python3-devel
74 BuildRequires: gpm-devel
75 BuildRequires: pkgconfig(ruby)
76 BuildRequires: perl-devel
77 BuildRequires: pkgconfig(tinfo)
78 BuildRequires: acl-devel
79 %if %{buildgui}
80 BuildRequires: gtk3-devel
81 BuildRequires: pkgconfig(ncurses)
82 BuildRequires: pkgconfig(xt)
83 BuildRequires: tcl
84 BuildRequires: pkgconfig(tcl)
85 %endif
86 BuildRequires: pkgconfig(lua)
87
88 %global __requires_exclude perl\\(getopts.pl\\)
89
90 %description
91 VIM (VIsual editor iMproved) is an updated and improved version of the
92 vi editor. Vi was the first real screen-based editor for UNIX, and is
93 still very popular. VIM improves on vi by adding new features:
94 multiple windows, multi-level undo, block highlighting and more.
95
96 %package common
97 Summary: The common files needed by any version of the VIM editor
98 Group: Editors
99 Requires(pre): coreutils
100 Requires(post): coreutils
101 Requires(preun): coreutils
102 Requires(postun): coreutils
103 # <oden> Installation failed: file /usr/share/vim/syntax/asciidoc.vim from install of vim-common-7.4.052-2.mga4.x86_64 conflicts with file from package asciidoc-8.6.8-2.mga3.noarch
104 Conflicts: asciidoc < 8.6.8-4
105
106 %description common
107 VIM (VIsual editor iMproved) is an updated and improved version of the
108 vi editor. Vi was the first real screen-based editor for UNIX, and is
109 still very popular. VIM improves on vi by adding new features:
110 multiple windows, multi-level undo, block highlighting and more. The
111 vim-common package contains files which every VIM binary will need in
112 order to run.
113
114 %package minimal
115 Summary: A minimal version of the VIM editor
116 Group: Editors
117 Provides: vim
118 Requires(post): update-alternatives
119 Requires(postun): update-alternatives
120
121 %description minimal
122 VIM (VIsual editor iMproved) is an updated and improved version of the
123 vi editor. Vi was the first real screen-based editor for UNIX, and is
124 still very popular. VIM improves on vi by adding new features:
125 multiple windows, multi-level undo, block highlighting and more. The
126 vim-minimal package includes a minimal version of VIM, which is
127 installed into /bin/vi for use when only the root partition is
128 present. NOTE: The online help is only available when the vim-common
129 package is installed.
130
131 %package enhanced
132 Summary: A version of the VIM editor which includes recent enhancements
133 Group: Editors
134 Requires: vim-common >= %{version}-%{release}
135 Obsoletes: vim-color
136 Provides: vim
137 Provides: vim-color
138 Requires(post): update-alternatives
139 Requires(postun): update-alternatives
140
141 %description enhanced
142 VIM (VIsual editor iMproved) is an updated and improved version of the
143 vi editor. Vi was the first real screen-based editor for UNIX, and is
144 still very popular. VIM improves on vi by adding new features:
145 multiple windows, multi-level undo, block highlighting and more. The
146 vim-enhanced package contains a version of VIM with extra, recently
147 introduced features like Python and Perl interpreters.
148
149 Install the vim-enhanced package if you'd like to use a version of the
150 VIM editor which includes recently added enhancements like
151 interpreters for the Python and Perl scripting languages. You'll also
152 need to install the vim-common package.
153
154 %if %{buildgui}
155 %package X11
156 Summary: The VIM version of the vi editor for the X Window System
157 Group: Editors
158 Provides: vim
159 Requires: vim-common >= %{version}-%{release}
160 Requires(post): desktop-file-utils
161 Requires(postun): desktop-file-utils
162
163 %description X11
164 VIM (VIsual editor iMproved) is an updated and improved version of the
165 vi editor. Vi was the first real screen-based editor for UNIX, and is
166 still very popular. VIM improves on vi by adding new features:
167 multiple windows, multi-level undo, block highlighting and
168 more. VIM-X11 is a version of the VIM editor which will run within the
169 X Window System. If you install this package, you can run VIM as an X
170 application with a full GUI interface and mouse support by command gvim.
171
172 Install the vim-X11 package if you'd like to try out a version of vi
173 with graphics and mouse capabilities. You'll also need to install the
174 vim-common package.
175 %endif
176
177 %define localedir %{buildroot}%{_datadir}/locale/
178
179 %prep
180 %setup -q -n %{vimdir}
181 # spec plugin
182 rm -f runtime/doc/pi_spec.txt
183 rm -f runtime/ftpplugin/spec.vim
184 cp -a %{SOURCE56} runtime/syntax/
185 cp -a %{SOURCE57} runtime/syntax/
186 cp -a %{SOURCE58} runtime/syntax/
187 cp -a %{SOURCE59} runtime/syntax/
188
189 #mdk patches
190 %patch2 -p1
191 %patch3 -p0 -b .spec
192 %patch8 -p1 -b .manpath
193 %patch10 -p1 -b .xxdloc
194 %patch20 -p1 -b .warly
195 %patch21 -p1 -b .spec-template-autoload
196 %patch22 -p0
197 %patch23 -p0 -b .doc
198 %patch24 -p0
199 %patch26 -p0
200 %patch28 -p1
201 %patch30 -p0
202 %patch32 -p1
203 # Fedora patches
204 %patch100 -p1
205 %patch101 -p1
206 %patch3016 -p1
207 %patch3017 -p1
208
209 perl -pi -e 's|SYS_VIMRC_FILE "\$VIM/vimrc"|SYS_VIMRC_FILE "%_sysconfdir/vim/vimrc"|' src/os_unix.h
210 perl -pi -e 's|SYS_GVIMRC_FILE "\$VIM/gvimrc"|SYS_GVIMRC_FILE "%_sysconfdir/vim/gvimrc"|' src/os_unix.h
211 # disable command echo
212 for i in runtime/{gvimrc_example.vim,vimrc_example.vim,defaults.vim}; do
213 perl -pi -e 's!^set showcmd!set noshowcmd!' $i
214 done
215 perl -pi -e 's|\Qsvn-commit.*.tmp\E|svn-commit*.tmp|' ./runtime/filetype.vim
216
217 %build
218 # ensure xxd works with big files:
219 export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -I%{python3path}"
220 export CXXFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -I%{python3path}"
221
222 %if %{buildgui}
223 # First build: gvim
224 LOCALEDIR=%{localedir} ./configure --prefix=%{_prefix} \
225 --enable-pythoninterp=dynamic \
226 --enable-python3interp=dynamic \
227 --enable-perlinterp \
228 --enable-rubyinterp \
229 --enable-tclinterp \
230 --with-features=huge \
231 --enable-acl --with-x=yes --enable-gui=gtk3 --exec-prefix=%{_prefix}/X11R6 \
232 --enable-gtk3-check \
233 --enable-multibyte --enable-xim --enable-fontset --mandir=%{_mandir} \
234 --libdir=%{_libdir} --with-compiledby="%packager"
235
236 echo "#define MAX_FEAT 1" >> src/config.h
237 echo "#define FEAT_GUI" >> src/config.h
238 # workaround buggy build system:
239 perl -pi -e 's!/usr/include long!/usr/include !' src/auto/config.mk
240
241 %make_build
242 mv src/vim src/gvim
243 make -C src clean
244 %endif
245
246 # Second build: vim-enhanced
247 ./configure --prefix=%{_prefix} \
248 --enable-acl --enable-rubyinterp --enable-tclinterp --enable-pythoninterp=dynamic \
249 --enable-python3interp=dynamic \
250 --enable-perlinterp --with-features=huge \
251 --libdir=%{_libdir} --with-compiledby="%packager" \
252 --with-x=no --enable-gui=no --exec-prefix=%{_prefix}
253
254 %make_build
255 mv src/vim src/vim-enhanced
256 make -C src/ clean
257
258 # Third build: vim-minimal
259 ./configure --prefix=%{_prefix} \
260 --with-features=tiny --disable-tclinterp --disable-cscope --disable-multibyte \
261 --disable-hangulinput --disable-xim --disable-fontset --disable-gui \
262 --disable-acl --disable-pythoninterp --disable-perlinterp \
263 --libdir=%{_libdir} --with-compiledby="%packager" \
264 --with-x=no --enable-gui=no --disable-gpm --exec-prefix=%{_prefix} --with-tlib=tinfo
265
266 %make_build
267 cp src/vim src/vim-minimal
268 %make_build -C src
269
270 cp -al runtime/doc doc
271 # apply os_doc.diff
272 pushd doc
273 rm -f *.1
274 rm -f os_{390,dos,msdos,risc,win32,amiga,mac,os2,beos,mint,qnx,vms}.txt
275 rm -f gui_{w16,w32}.txt
276 rm -f vim2html.pl Makefile *awk
277 popd
278
279 # britton support
280 ln -s tutor.fr runtime/tutor/tutor.br
281 ln -s menu_fr_fr.iso_8859-15.vim runtime/lang/menu_br
282
283 %install
284 perl -pi -e 's!LOCALEDIR=\$\(DEST_LANG\)!LOCALEDIR=\$(DESTDIR)\$\(prefix\)/share/locale!g' src/Makefile
285
286 mkdir -p %{buildroot}{/bin,%{_bindir},%{_datadir}/{vim,locale},%{_mandir}/man1,%{localedir}}
287 %make_install VIMRTDIR=""
288
289
290 make -C src installmacros prefix=%{buildroot}%{_prefix} VIMRTDIR=""
291
292 # fix unreadable files:
293 chmod a+r runtime/{autoload/{tar,netrw}.vim,doc/pi_{netrw,tar}.txt}
294
295 %if %{buildgui}
296 mkdir -p %{buildroot}%{_bindir}
297 install -m 755 src/gvim %{buildroot}%{_bindir}
298 %endif
299
300 install -m 755 src/vim-enhanced %{buildroot}%{_bindir}
301 install -m 755 src/vim-minimal %{buildroot}/bin/vim-minimal
302
303 cd %{buildroot}
304 rm -f ./bin/rvim
305 rm -f ./usr/bin/rview ./usr/bin/rvim ./usr/bin/view
306 for i in ex vimdiff; do
307 ln -sf vim-enhanced ./usr/bin/$i
308 done
309 rm -f ./usr/man/man1/rvim.*
310 rm -f ./usr/share/man/man1/evim.*
311 %if %{buildgui}
312 ln -sf gvim ./usr/bin/gvimdiff
313 ln -sf gvim ./usr/bin/vimx
314 %endif
315 rm -f ./usr/share/vim/*/cmake.vim
316 cd -
317
318 # installing man pages
319 for i in %{buildroot}%{_mandir}/man1/{vi,rvi}; do
320 cp %{buildroot}%{_mandir}/man1/vim.1 $i.1
321 done
322
323 %if %{buildgui}
324 cp %{buildroot}%{_mandir}/man1/vim.1 %{buildroot}%{_mandir}/man1/gvim.1
325 %endif
326
327 ln -sf defaults.vim %{buildroot}/usr/share/vim/vimrc
328
329 cd %{buildroot}/%{_prefix}/share/vim/tools
330 # i need to make a choice :(.
331 rm -f vim132
332 perl -p -i -e 's|#!/usr/bin/nawk|#!/usr/bin/gawk|' mve.awk
333 perl -p -i -e 's|#!/usr/local/bin/perl|#!/usr/bin/perl|' *.pl
334 perl -p -i -e 's|#!/usr/gnu/bin/perl|#!/usr/bin/perl|' *
335 cd -
336
337 # Be short-circuit aware :
338 ln -f runtime/macros/README.txt README_macros.txt
339 ln -f runtime/tools/README.txt README_tools.txt
340 perl -p -i -e "s|#!/usr/local/bin/perl|#!/usr/bin/perl|" runtime/doc/*.pl
341
342 # installing the menu icons & entry
343 %if %{buildgui}
344 install -D -p -m 0644 %{SOURCE60} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/gvim.svg
345
346 # gvim and fontset (from Pablo) 2001/03/19
347 echo 'set guifontset=-*-fixed-medium-r-normal--14-*-*-*-c-*-*-*,-*-*-medium-r-normal--14-*-*-*-c-*-*-*,-*-*-medium-r-normal--14-*-*-*-m-*-*-*,*' > %{buildroot}%{_datadir}/vim/gvimrc
348 %endif
349
350 # fix the paths in the man pages
351 for i in %{buildroot}/usr/share/man/man1/*.1; do
352 perl -p -i -e "s|%{buildroot}||" $i
353 done
354
355 # prevent including twice the doc
356 rm -fr %{buildroot}/usr/share/vim/doc
357 ln -sf ../../../%{_defaultdocdir}/%{name}-common/doc %{buildroot}/usr/share/vim/doc
358
359 %{find_lang} %{name} --with-man --all-name
360
361 find %{buildroot}%{_datadir}/vim/ -name "tutor.*" | egrep -v 'tutor(|\.vim)$' |
362 sed -e 's!^\(.*tutor.\)\(..\)!%lang(\2) \1\2!g' >> %{name}.lang
363
364 find %{buildroot}%{_datadir}/vim/lang -name "menu*" |
365 sed -e 's!^\(.*menu_\)\(..\)\(_\)!%lang(\2) \1\2\3!g' \
366 -e 's!^\(.*menu\)\(_chinese\)!%lang(zh) \1\2!g' \
367 -e 's!^\(.*menu\)\(_czech_\)!%lang(cs) \1\2!g' \
368 -e 's!^\(.*menu\)\(_french\)!%lang(fr) \1\2!g' \
369 -e 's!^\(.*menu\)\(_german\)!%lang(de) \1\2!g' \
370 -e 's!^\(.*menu\)\(_japanes\)!%lang(ja) \1\2!g' \
371 -e 's!^\(.*menu\)\(_polish\)!%lang(pl) \1\2!g' \
372 -e 's!^\(.*menu\)\(_slovak\)!%lang(sk) \1\2!g' \
373 -e 's!^\(.*menu\)\(_spanis\)!%lang(es) \1\2!g' \
374 >> %{name}.lang
375 # add softlinks:
376 find %{buildroot}%{_datadir}/vim/lang -type l >> %{name}.lang
377 # clean file list:
378 sed -i "s^%{buildroot}^^" %{name}.lang
379
380 rm -f %{buildroot}%{_bindir}/vim
381
382 mkdir -p %{buildroot}%{_sysconfdir}/vim/
383 MESSAGE='"Place your systemwide modification here.\n"%{_datadir}/vim/ files will be overwritten on update\n'
384 echo -e "$MESSAGE\nsource %_datadir/vim/vimrc" > %{buildroot}/%{_sysconfdir}/vim/vimrc
385 %if %{buildgui}
386 echo -e "$MESSAGE\nsource %_datadir/vim/gvimrc" > %{buildroot}/%{_sysconfdir}/vim/gvimrc
387 %endif
388
389 # create templates folder
390 mkdir -p %{buildroot}/%{_datadir}/%{name}/vimfiles
391 install -m 0644 %{SOURCE61} %{buildroot}/%{_datadir}/%{name}/vimfiles/
392
393 %post minimal
394 update-alternatives --install /bin/vi vi /bin/vim-minimal 10 \
395 --slave /bin/view view /bin/vim-minimal \
396 --slave /bin/ex ex /bin/vim-minimal \
397 --slave /bin/rvi rvi /bin/vim-minimal \
398 --slave /bin/rview rview /bin/vim-minimal
399 update-alternatives --install /bin/vim vim /bin/vim-minimal 10 \
400 --slave /bin/rvim rvim /bin/vim-minimal
401
402 %postun minimal
403 [ $1 = 0 ] || exit 0
404 update-alternatives --remove vi /bin/vim-minimal
405 update-alternatives --remove vim /bin/vim-minimal
406
407 %triggerpostun minimal -- vim-minimal < 7.3
408 update-alternatives --remove uvi /bin/vim-minimal
409 for i in view ex rvi rview rvim; do
410 update-alternatives --remove $i /bin/$i || :
411 done
412
413 %post enhanced
414 update-alternatives --install /bin/vi vi /usr/bin/vim-enhanced 20 \
415 --slave /bin/view view /usr/bin/vim-enhanced \
416 --slave /bin/ex ex /usr/bin/vim-enhanced \
417 --slave /bin/rvi rvi /usr/bin/vim-enhanced \
418 --slave /bin/rview rview /usr/bin/vim-enhanced
419 update-alternatives --install /bin/vim vim /usr/bin/vim-enhanced 20 \
420 --slave /bin/rvim rvim /usr/bin/vim-enhanced
421
422 %postun enhanced
423 [ $1 = 0 ] || exit 0
424 update-alternatives --remove vi /usr/bin/vim-enhanced
425 update-alternatives --remove vim /usr/bin/vim-enhanced
426
427 %triggerpostun enhanced -- vim-enhanced < 7.3
428 update-alternatives --remove uvi /usr/bin/vim-enhanced
429
430 %files common -f vim.lang
431 %doc README*.txt
432 #%doc --parents mandriva/README*
433 %doc doc
434 %{_datadir}/vim/doc
435 %dir %{_datadir}/vim/
436 %{_datadir}/vim/[^tlg]*
437 %{_datadir}/vim/gvimrc_example.vim
438 %{_datadir}/vim/lang/README.txt
439 %{_datadir}/vim/tools
440 %{_datadir}/vim/tutor/README.*
441 %{_datadir}/vim/tutor/tutor
442 %{_datadir}/vim/tutor/tutor.vim
443 %{_mandir}/man1/vim.1*
444 %{_mandir}/man1/ex.1*
445 %{_mandir}/man1/vi.1*
446 %{_mandir}/man1/view.1*
447 %{_mandir}/man1/rvi.1*
448 %{_mandir}/man1/rview.1*
449 %{_mandir}/man1/vimdiff.1*
450 %{_mandir}/man1/vimtutor.1*
451 %{_mandir}/man1/rvim.1*
452 %{_bindir}/vimtutor
453 %{_bindir}/xxd
454 %{_mandir}/man1/xxd.1*
455 %dir %{_sysconfdir}/vim/
456 %config(noreplace) %{_sysconfdir}/vim/*
457
458 %files minimal
459 %doc README*.txt
460 /bin/vim-minimal
461
462 %files enhanced
463 %doc README*.txt
464 %{_bindir}/ex
465 %{_bindir}/vimdiff
466 %{_bindir}/vim-enhanced
467
468 %if %{buildgui}
469 %files X11
470 %doc README*.txt
471 %{_bindir}/gvim
472 %{_bindir}/gvimdiff
473 %{_bindir}/vimx
474 %{_mandir}/man1/gvim.1*
475 %{_iconsdir}/hicolor/*/apps/gvim.*
476 %{_iconsdir}/locolor/*/apps/*
477 %{_datadir}/applications/*.desktop
478 %{_datadir}/vim/gvimrc
479 %endif

  ViewVC Help
Powered by ViewVC 1.1.30