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

  ViewVC Help
Powered by ViewVC 1.1.30