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

  ViewVC Help
Powered by ViewVC 1.1.30