-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvim.spec
3621 lines (2658 loc) · 112 KB
/
vim.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%bcond_without gui
%if 0%{?fedora}
%bcond_without default_editor
%bcond_without libsodium_crypt
%else
%bcond_with default_editor
%bcond_with libsodium_crypt
%endif
%define patchlevel 1429
%if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1}
%define WITH_SELINUX 1
%endif
%if %{with gui}
%define desktop_file 1
%else
%define desktop_file 0
%endif
%if %{desktop_file}
%define desktop_file_utils_version 0.2.93
%endif
%define withnetbeans 1
%define withvimspell 0
%define withhunspell 0
%define withlua 1
%if 0%{?flatpak}
%define withperl 0
%define withruby 0
%else
%define withperl 1
%define withruby 1
%endif
# VIm upstream wants to build with FORTIFY_SOURCE=1,
# because higher levels causes crashes of valid code constructs
# and their reimplementation would cost unnecessary maintenance
# https://github.com/vim/vim/pull/3507
%define _fortify_level 1
%define baseversion 9.0
%define vimdir vim90
Summary: The VIM editor
URL: http://www.vim.org/
Name: vim
Version: %{baseversion}.%{patchlevel}
Release: 1%{?dist}
Epoch: 2
License: Vim and MIT
Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2
Source1: virc
Source2: vimrc
Source3: gvim16.png
Source4: gvim32.png
Source5: gvim48.png
Source6: gvim64.png
Source7: spec-template.new
Source8: macros.vim
Source9: vim-default-editor.sh
Source10: vim-default-editor.csh
Source11: vim-default-editor.fish
Source12: view_wrapper
Source13: vi_wrapper
%if %{withvimspell}
Source100: vim-spell-files.tar.bz2
%endif
Patch2000: vim-7.0-fixkeys.patch
Patch2001: vim-7.4-specsyntax.patch
%if %{withhunspell}
Patch2002: vim-7.0-hunspell.patch
BuildRequires: hunspell-devel
%endif
Patch3000: vim-7.3-manpage-typo-668894-675480.patch
Patch3001: vim-manpagefixes-948566.patch
Patch3002: vim-7.4-globalsyntax.patch
# migrate shebangs in script to /usr/bin/python3 and use python2 when necessary
Patch3003: vim-python3-tests.patch
# fips warning (Fedora downstream patch)
Patch3004: vim-crypto-warning.patch
# don't ever set mouse (Fedora downstream patch)
Patch3005: vim-8.0-copy-paste.patch
# uses autoconf in spec file
BuildRequires: autoconf
%if %{desktop_file}
# for /usr/bin/desktop-file-install
BuildRequires: desktop-file-utils >= %{desktop_file_utils_version}
Requires: desktop-file-utils
%endif
# gcc is no longer in buildroot by default
BuildRequires: gcc
# for translations
BuildRequires: gettext
# glibc in F35 bootstraped several conversion formats from
# iconv into a separate package. Vim needs those additional
# formats during compilation.
BuildRequires: glibc-gconv-extra
# for mouse support in console
BuildRequires: gpm-devel
# for setting ACL on created files
BuildRequires: libacl-devel
# selinux support
%if %{WITH_SELINUX}
BuildRequires: libselinux-devel
%endif
# for xchacha20 encryption
%if %{with libsodium_crypt}
BuildRequires: libsodium-devel
%endif
# for lua plugin
%if "%{withlua}" == "1"
BuildRequires: lua-devel
%endif
# uses make
BuildRequires: make
# screen handling library
BuildRequires: ncurses-devel
# for perl plugin
%if "%{withperl}" == "1"
BuildRequires: perl-devel
BuildRequires: perl-generators
BuildRequires: perl(ExtUtils::Embed)
BuildRequires: perl(ExtUtils::ParseXS)
%endif
# for python plugin
BuildRequires: python3-devel
# for ruby plugin
%if "%{withruby}" == "1"
BuildRequires: ruby
BuildRequires: ruby-devel
%endif
%description
VIM (VIsual editor iMproved) is an updated and improved version of the
vi editor. Vi was the first real screen-based editor for UNIX, and is
still very popular. VIM improves on vi by adding new features:
multiple windows, multi-level undo, block highlighting and more.
%package common
Summary: The common files needed by any version of the VIM editor
# conflicts in package because of manpage move (bug #1599663)
# conflicts because of defaults.vim (bug #2026651)
# remove after F36 EOL+after release CentOS Stream > 9
Conflicts: %{name}-minimal < %{epoch}:8.2.3642-2
# shared files between common and minimal
Requires: %{name}-data = %{epoch}:%{version}-%{release}
Requires: %{name}-filesystem
Requires: python3-neovim
# vim-toml was a separate package but the runtime files have been included
# directly in vim since 8.2.3519. The vim-toml package has been retired in
# Fedora, obsolete it so it doesn't get left on users' systems. Added in F38,
# can be removed in F40.
# https://github.com/cespare/vim-toml/commit/2c8983cc391287e5e26e015c3ab9c38de9f9b759
# https://github.com/vim/vim/commit/2286304cdbba53ceb52b3ba2ba4a521b0a2f8d0f
Provides: vim-toml = %{epoch}:%{version}-%{release}
Obsoletes: vim-toml < 0^1.717bd87-4
%description common
VIM (VIsual editor iMproved) is an updated and improved version of the
vi editor. Vi was the first real screen-based editor for UNIX, and is
still very popular. VIM improves on vi by adding new features:
multiple windows, multi-level undo, block highlighting and more. The
vim-common package contains files which every VIM binary will need in
order to run.
If you are installing vim-enhanced or vim-X11, you'll also need
to install the vim-common package.
%package spell
Summary: The dictionaries for spell checking. This package is optional
Requires: vim-common = %{epoch}:%{version}-%{release}
%description spell
This subpackage contains dictionaries for vim spell checking in
many different languages.
%package minimal
Summary: A minimal version of the VIM editor
# conflicts in package because of manpage move (bug #1599663)
# conflicts because of defaults.vim (bug #2026651)
# remove after F36 EOL+after release CentOS Stream > 9
Conflicts: %{name}-common < %{epoch}:8.2.3642-2
Provides: vi
Provides: %{_bindir}/vi
# shared files between common and minimal
Requires: %{name}-data = %{epoch}:%{version}-%{release}
%description minimal
VIM (VIsual editor iMproved) is an updated and improved version of the
vi editor. Vi was the first real screen-based editor for UNIX, and is
still very popular. VIM improves on vi by adding new features:
multiple windows, multi-level undo, block highlighting and more. The
vim-minimal package includes a minimal version of VIM, providing
the commands vi, view, ex, rvi, and rview. NOTE: The online help is
only available when the vim-common package is installed.
%package enhanced
Summary: A version of the VIM editor which includes recent enhancements
# vim bundles libvterm, which is used during build - so we need to provide
# bundled libvterm for catching possible libvterm CVEs
Provides: bundled(libvterm)
Provides: vim
Provides: vim(plugins-supported)
Provides: %{_bindir}/mergetool
Provides: %{_bindir}/vim
Requires: vim-common = %{epoch}:%{version}-%{release}
# required for vimtutor (#395371)
Requires: which
# suggest python3, python2, lua, ruby and perl packages because of their
# embedded functionality in Vim/GVim
%if "%{withlua}" == "1"
Suggests: lua-libs
%endif
%if "%{withperl}" == "1"
Suggests: perl-devel
%endif
Suggests: python3
Suggests: python3-libs
%if "%{withruby}" == "1"
Suggests: ruby
Suggests: ruby-libs
%endif
%description enhanced
VIM (VIsual editor iMproved) is an updated and improved version of the
vi editor. Vi was the first real screen-based editor for UNIX, and is
still very popular. VIM improves on vi by adding new features:
multiple windows, multi-level undo, block highlighting and more. The
vim-enhanced package contains a version of VIM with extra, recently
introduced features like Python and Perl interpreters.
Install the vim-enhanced package if you'd like to use a version of the
VIM editor which includes recently added enhancements like
interpreters for the Python and Perl scripting languages. You'll also
need to install the vim-common package.
%package filesystem
Summary: VIM filesystem layout
BuildArch: noarch
%Description filesystem
This package provides some directories which are required by other
packages that add vim files, p.e. additional syntax files or filetypes.
%if %{with gui}
%package X11
Summary: The VIM version of the vi editor for the X Window System - GVim
# devel of libICE, gtk3, libSM, libX11, libXpm and libXt are needed in buildroot
# so configure script can have correct macros enabled for GUI (#1603272)
# generic gnome toolkit for graphical support
BuildRequires: gtk3-devel
# inter-client exchange library - for X session management protocol
BuildRequires: libICE-devel
# X session management library
BuildRequires: libSM-devel
# core X11 protocol client library
BuildRequires: libX11-devel
# X PixMap library for X11 - for creating images in X PixMap format
BuildRequires: libXpm-devel
# X Toolkit Intrinsics library - working with widgets?
BuildRequires: libXt-devel
# for testing validity of appdata file
BuildRequires: libappstream-glib
# for sound support
BuildRequires: libcanberra-devel
Provides: gvim
Provides: vim(plugins-supported)
Provides: %{_bindir}/mergetool
Provides: %{_bindir}/gvim
# GVIM graphics are based on GTK3
Requires: gtk3
# needed for icons (#226526)
Requires: hicolor-icon-theme
# for getting/setting extended attributes - they are pairs (name:value)
# from inodes (files, dirs etc.)
Requires: libattr >= 2.4
Requires: vim-common = %{epoch}:%{version}-%{release}
# suggest python3, python2, lua, ruby and perl packages because of their
# embedded functionality in Vim/GVim
%if "%{withlua}" == "1"
Suggests: lua-libs
%endif
%if "%{withperl}" == "1"
Suggests: perl-devel
%endif
Suggests: python3
Suggests: python3-libs
%if "%{withruby}" == "1"
Suggests: ruby
Suggests: ruby-libs
%endif
%description X11
VIM (VIsual editor iMproved) is an updated and improved version of the
vi editor. Vi was the first real screen-based editor for UNIX, and is
still very popular. VIM improves on vi by adding new features:
multiple windows, multi-level undo, block highlighting and
more. VIM-X11 is a version of the VIM editor which will run within the
X Window System. If you install this package, you can run VIM as an X
application with a full GUI interface and mouse support by command gvim.
Install the vim-X11 package if you'd like to try out a version of vi
with graphics and mouse capabilities. You'll also need to install the
vim-common package.
%endif
%package data
Summary: Shared data for Vi and Vim
BuildArch: noarch
# moved files from filesystem, common and minimal to data
# remove after F36 EOL+after release of CentOS Stream > 9
Conflicts: %{name}-common < 2:8.2.3642-2
Conflicts: %{name}-filesystem < 2:8.2.3642-2
Conflicts: %{name}-minimal < 2:8.2.3642-2
%description data
The subpackage is used for shipping files and directories, which need to be
shared between vim-minimal and vim-common packages.
%if %{with default_editor}
%package default-editor
Summary: Set vim as the default editor
BuildArch: noarch
Conflicts: system-default-editor
Provides: system-default-editor
Requires: vim-enhanced
%description default-editor
This subpackage contains files needed to set Vim as the default editor.
%endif
%prep
%setup -q -b 0 -n %{vimdir}
# use %%{__python3} macro for defining shebangs in python3 tests
sed -i -e 's,/usr/bin/python3,%{__python3},' %{PATCH3005}
# fix rogue dependencies from sample code
chmod -x runtime/tools/mve.awk
%patch2000 -p1 -b .fixkeys
%patch2001 -p1
%if %{withhunspell}
%patch2002 -p1
%endif
perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk
# install spell files
%if %{withvimspell}
%{__tar} xjf %{SOURCE100}
%endif
%patch3000 -p1
%patch3001 -p1
%patch3002 -p1
%patch3003 -p1 -b .python-tests
%patch3004 -p1 -b .fips-warning
%patch3005 -p1 -b .copypaste
%build
cd src
autoconf
export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2"
export CXXFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2"
cp -f os_unix.h os_unix.h.save
# Configure options:
# --enable-fail-if-missing - we need to fail if configure options aren't satisfied
# --with-features - for setting how big amount of features is enabled
# --enable-multibyte - enabling multibyte editing support - for editing files in languages, which one character
# cannot be represented by one byte - Asian languages, Unicode
# --disable-netbeans - disabling socket interface for integrating Vim into NetBeans IDE
# --enable-selinux - enabling selinux support
# --enable-Ninterp - enabling internal interpreter
# --with-x - yes if we want X11 support (graphical Vim for X11)
# --with-tlib - which terminal library to use
# --disable-gpm - disabling support for General Purpose Mouse - Linux mouse daemon
perl -pi -e "s/vimrc/virc/" os_unix.h
%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/virc\"'" \
--prefix=%{_prefix} --with-features=tiny --with-x=no \
--enable-multibyte \
--disable-netbeans \
%if %{WITH_SELINUX}
--enable-selinux \
%else
--disable-selinux \
%endif
--disable-pythoninterp --disable-perlinterp --disable-tclinterp \
--with-tlib=ncurses --enable-gui=no --disable-gpm --exec-prefix=/ \
--with-compiledby="<[email protected]>" \
--with-modified-by="<[email protected]>" \
--enable-fips-warning \
--enable-fail-if-missing \
--disable-canberra \
--disable-libsodium
%make_build
cp vim minimal-vim
make clean
mv -f os_unix.h.save os_unix.h
%if %{with gui}
# More configure options:
# --enable-xim - enabling X Input Method - international input module for X,
# it is for multibyte languages in Vim with X
# --enable-termtruecolor - use terminal with true colors
%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/vimrc\"'" \
--with-features=huge \
--enable-python3interp=dynamic \
--disable-tclinterp --with-x=yes \
--enable-xim --enable-multibyte \
--with-tlib=ncurses \
--enable-gtk3-check --enable-gui=gtk3 \
--enable-fips-warning \
--with-compiledby="<[email protected]>" --enable-cscope \
--with-modified-by="<[email protected]>" \
%if "%{withnetbeans}" == "1"
--enable-netbeans \
%else
--disable-netbeans \
%endif
%if %{WITH_SELINUX}
--enable-selinux \
%else
--disable-selinux \
%endif
%if "%{withperl}" == "1"
--enable-perlinterp=dynamic \
%else
--disable-perlinterp \
%endif
%if "%{withruby}" == "1"
--enable-rubyinterp=dynamic \
%else
--disable-rubyinterp \
%endif
%if "%{withlua}" == "1"
--enable-luainterp=dynamic \
%else
--disable-luainterp \
%endif
%if %{with libsodium_crypt}
--enable-libsodium \
%else
--disable-libsodium \
%endif
--enable-fail-if-missing \
--enable-canberra
%make_build
cp vim gvim
make clean
%endif
%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/vimrc\"'" \
--prefix=%{_prefix} --with-features=huge \
--enable-python3interp=dynamic \
--disable-tclinterp \
--with-x=no \
--enable-gui=no --exec-prefix=%{_prefix} --enable-multibyte \
--enable-cscope --with-modified-by="<[email protected]>" \
--with-tlib=ncurses \
--enable-fips-warning \
--with-compiledby="<[email protected]>" \
%if "%{withnetbeans}" == "1"
--enable-netbeans \
%else
--disable-netbeans \
%endif
%if %{WITH_SELINUX}
--enable-selinux \
%else
--disable-selinux \
%endif
%if "%{withperl}" == "1"
--enable-perlinterp=dynamic \
%else
--disable-perlinterp \
%endif
%if "%{withruby}" == "1"
--enable-rubyinterp=dynamic \
%else
--disable-rubyinterp \
%endif
%if "%{withlua}" == "1"
--enable-luainterp=dynamic \
%else
--disable-luainterp \
%endif
%if %{with libsodium_crypt}
--enable-libsodium \
%else
--disable-libsodium \
%endif
--enable-fail-if-missing \
--disable-canberra
%make_build
cp vim enhanced-vim
%install
mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{_datadir}/%{name}/vimfiles/{after,autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor}
mkdir -p %{buildroot}/%{_datadir}/%{name}/vimfiles/after/{autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor}
cp -f %{SOURCE7} %{buildroot}/%{_datadir}/%{name}/vimfiles/template.spec
cp runtime/doc/uganda.txt LICENSE
# Those aren't Linux info files but some binary files for Amiga:
rm -f README*.info
cd src
# Adding STRIP=/bin/true, because Vim wants to strip the binaries by himself
# and put the stripped files into correct dirs. Build system (koji/brew)
# does it for us, so there is no need to do it in Vim
%make_install BINDIR=%{_bindir} STRIP=/bin/true
# make install creates vim binary and view symlink, they will be wrappers
# so remove them here
rm -f %{buildroot}%{_bindir}/{vim,view}
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps
mkdir -p %{buildroot}%{_libexecdir}
install -m755 minimal-vim %{buildroot}%{_libexecdir}/vi
install -m755 enhanced-vim %{buildroot}%{_bindir}/vim
install -m755 %{SOURCE12} %{buildroot}%{_bindir}/view
install -m755 %{SOURCE13} %{buildroot}%{_bindir}/vi
%if %{with gui}
make installgtutorbin DESTDIR=%{buildroot} BINDIR=%{_bindir}
install -m755 gvim %{buildroot}%{_bindir}/gvim
install -p -m644 %{SOURCE3} \
%{buildroot}%{_datadir}/icons/hicolor/16x16/apps/gvim.png
install -p -m644 %{SOURCE4} \
%{buildroot}%{_datadir}/icons/hicolor/32x32/apps/gvim.png
install -p -m644 %{SOURCE5} \
%{buildroot}%{_datadir}/icons/hicolor/48x48/apps/gvim.png
install -p -m644 %{SOURCE6} \
%{buildroot}%{_datadir}/icons/hicolor/64x64/apps/gvim.png
# Register as an application to be visible in the software center
#
# NOTE: It would be *awesome* if this file was maintained by the upstream
# project, translated and installed into the right place during `make install`.
#
# See http://www.freedesktop.org/software/appstream/docs/ for more details.
#
mkdir -p $RPM_BUILD_ROOT%{_datadir}/metainfo
cat > $RPM_BUILD_ROOT%{_datadir}/metainfo/gvim.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Richard Hughes <[email protected]> -->
<!--
EmailAddress: [email protected]>
SentUpstream: 2014-05-22
-->
<component type="desktop-application">
<id>org.vim.Vim</id>
<name>GVim</name>
<metadata_license>CC0-1.0</metadata_license>
<project_license>Vim</project_license>
<summary>The VIM version of the vi editor for the X Window System</summary>
<description>
<p>
Vim is an advanced text editor that seeks to provide the power of the
de-facto Unix editor 'Vi', with a more complete feature set.
It's useful whether you're already using vi or using a different editor.
</p>
<p>
Vim is a highly configurable text editor built to enable efficient text
editing.
Vim is often called a "programmer's editor," and so useful for programming
that many consider it an entire IDE. It is not just for programmers, though.
Vim is perfect for all kinds of text editing, from composing email to
editing configuration files.
</p>
<p>
We ship the current Vim stable release - %{baseversion} - with the upstream
patchlevel %{patchlevel} applied, which is combined into version %{version}
used during packaging.
</p>
</description>
<releases>
<release version="%{version}" date="%(date +%F -r %{SOURCE0})" />
</releases>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/zdohnal/vim/zdohnal-screenshot/gvim16_9.png</image>
</screenshot>
</screenshots>
<url type="homepage">http://www.vim.org/</url>
<content_rating type="oars-1.1"/>
</component>
EOF
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*.appdata.xml
for i in gvim.1 gex.1 gview.1 vimx.1; do
echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man1/$i
done
echo ".so man1/vimdiff.1" > %{buildroot}/%{_mandir}/man1/gvimdiff.1
echo ".so man1/vimtutor.1" > %{buildroot}/%{_mandir}/man1/gvimtutor.1
%else
# Remove files included in X11 subpackage, but built by default:
rm %{buildroot}/%{_mandir}/man1/evim.*
rm %{buildroot}/%{_datadir}/applications/{vim,gvim}.desktop
rm %{buildroot}/%{_datadir}/icons/{hicolor,locolor}/*/apps/gvim.png
%endif
( cd %{buildroot}
ln -sf %{_libexecdir}/vi .%{_bindir}/rvi
ln -sf %{_libexecdir}/vi .%{_bindir}/rview
ln -sf %{_libexecdir}/vi .%{_bindir}/ex
ln -sf vim .%{_bindir}/rvim
ln -sf vim .%{_bindir}/vimdiff
perl -pi -e "s,%{buildroot},," .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vimtutor.1
rm -f .%{_mandir}/man1/rvim.1
cp -p .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vi.1
ln -sf vi.1.gz .%{_mandir}/man1/rvi.1.gz
ln -sf vi.1.gz .%{_mandir}/man1/ex.1
ln -sf vi.1.gz .%{_mandir}/man1/view.1
ln -sf vi.1.gz .%{_mandir}/man1/rview.1
ln -sf vim.1.gz .%{_mandir}/man1/vimdiff.1.gz
%if %{with gui}
ln -sf gvim ./%{_bindir}/gview
ln -sf gvim ./%{_bindir}/gex
ln -sf gvim ./%{_bindir}/evim
ln -sf gvim ./%{_bindir}/gvimdiff
ln -sf gvim ./%{_bindir}/vimx
%if "%{desktop_file}" == "1"
desktop-file-install \
--dir %{buildroot}/%{_datadir}/applications \
%{buildroot}/%{_datadir}/applications/gvim.desktop
# --add-category "Development;TextEditor;X-Red-Hat-Base" D\
%else
mkdir -p ./%{_sysconfdir}/X11/applnk/Applications
cp %{buildroot}/%{_datadir}/applications/gvim.desktop ./%{_sysconfdir}/X11/applnk/Applications/gvim.desktop
%endif
%endif
# ja_JP.ujis is obsolete, ja_JP.eucJP is recommended.
( cd ./%{_datadir}/%{name}/%{vimdir}/lang; \
ln -sf menu_ja_jp.ujis.vim menu_ja_jp.eucjp.vim )
)
pushd %{buildroot}/%{_datadir}/%{name}/%{vimdir}/tutor
mkdir conv
iconv -f CP1252 -t UTF8 tutor.ca > conv/tutor.ca
iconv -f CP1252 -t UTF8 tutor.it > conv/tutor.it
#iconv -f CP1253 -t UTF8 tutor.gr > conv/tutor.gr
iconv -f CP1252 -t UTF8 tutor.fr > conv/tutor.fr
iconv -f CP1252 -t UTF8 tutor.es > conv/tutor.es
iconv -f CP1252 -t UTF8 tutor.de > conv/tutor.de
#iconv -f CP737 -t UTF8 tutor.gr.cp737 > conv/tutor.gr.cp737
#iconv -f EUC-JP -t UTF8 tutor.ja.euc > conv/tutor.ja.euc
#iconv -f SJIS -t UTF8 tutor.ja.sjis > conv/tutor.ja.sjis
iconv -f UTF8 -t UTF8 tutor.ja.utf-8 > conv/tutor.ja.utf-8
iconv -f UTF8 -t UTF8 tutor.ko.utf-8 > conv/tutor.ko.utf-8
iconv -f CP1252 -t UTF8 tutor.no > conv/tutor.no
iconv -f ISO-8859-2 -t UTF8 tutor.pl > conv/tutor.pl
iconv -f ISO-8859-2 -t UTF8 tutor.sk > conv/tutor.sk
iconv -f KOI8R -t UTF8 tutor.ru > conv/tutor.ru
iconv -f CP1252 -t UTF8 tutor.sv > conv/tutor.sv
mv -f tutor.ja.euc tutor.ja.sjis tutor.ko.euc tutor.pl.cp1250 tutor.zh.big5 tutor.ru.cp1251 tutor.zh.euc tutor.sr.cp1250 tutor.sr.utf-8 conv/
rm -f tutor.ca tutor.de tutor.es tutor.fr tutor.gr tutor.it tutor.ja.utf-8 tutor.ko.utf-8 tutor.no tutor.pl tutor.sk tutor.ru tutor.sv
mv -f conv/* .
rmdir conv
popd
# Dependency cleanups
chmod 644 %{buildroot}/%{_datadir}/%{name}/%{vimdir}/doc/vim2html.pl \
%{buildroot}/%{_datadir}/%{name}/%{vimdir}/tools/*.pl \
%{buildroot}/%{_datadir}/%{name}/%{vimdir}/tools/vim132
chmod 644 ../runtime/doc/vim2html.pl
mkdir -p %{buildroot}%{_sysconfdir}
install -p -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/virc
install -p -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/vimrc
# if Vim isn't built for Fedora, use redhat augroup
%if 0%{?rhel} >= 7
sed -i -e "s/augroup fedora/augroup redhat/" %{buildroot}/%{_sysconfdir}/vimrc
sed -i -e "s/augroup fedora/augroup redhat/" %{buildroot}/%{_sysconfdir}/virc
%endif
%if %{with default_editor}
mkdir -p %{buildroot}/%{_sysconfdir}/profile.d
install -p -m644 %{SOURCE9} %{buildroot}/%{_sysconfdir}/profile.d/vim-default-editor.sh
install -p -m644 %{SOURCE10} %{buildroot}/%{_sysconfdir}/profile.d/vim-default-editor.csh
mkdir -p %{buildroot}/%{_datadir}/fish/vendor_conf.d/
install -p -m644 %{SOURCE11} %{buildroot}/%{_datadir}/fish/vendor_conf.d/vim-default-editor.fish
mkdir -p %{buildroot}/%{_datadir}/fish/vendor_functions.d/
%endif
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
install -p -m644 %{SOURCE8} %{buildroot}%{_rpmconfigdir}/macros.d/
(cd ../runtime; rm -rf doc; ln -svf ../../vim/%{vimdir}/doc docs;)
rm -f %{buildroot}/%{_datadir}/vim/%{vimdir}/macros/maze/maze*.c
rm -rf %{buildroot}/%{_datadir}/vim/%{vimdir}/tools
rm -rf %{buildroot}/%{_datadir}/vim/%{vimdir}/doc/vim2html.pl
rm -f %{buildroot}/%{_datadir}/vim/%{vimdir}/tutor/tutor.gr.utf-8~
# Remove not UTF-8 manpages
for i in pl.ISO8859-2 it.ISO8859-1 ru.KOI8-R fr.ISO8859-1 da.ISO8859-1 de.ISO8859-1 tr.ISO8859-9; do
rm -rf %{buildroot}/%{_mandir}/$i
done
# use common man1/ru directory
mv %{buildroot}/%{_mandir}/ru.UTF-8 %{buildroot}/%{_mandir}/ru
# Remove duplicate man pages
for i in fr.UTF-8 it.UTF-8 pl.UTF-8 da.UTF-8 de.UTF-8 tr.UTF-8; do
rm -rf %{buildroot}/%{_mandir}/$i
done
# Install symlink for rvim man page
echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man1/rvim.1
mkdir -p %{buildroot}/%{_mandir}/man5
echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man5/vimrc.5
echo ".so man1/vi.1" > %{buildroot}/%{_mandir}/man5/virc.5
touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags
# Refresh documentation helptags
%transfiletriggerin common -- %{_datadir}/%{name}/vimfiles/doc
%{_bindir}/vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null || :
%transfiletriggerpostun common -- %{_datadir}/%{name}/vimfiles/doc
> %{_datadir}/%{name}/vimfiles/doc/tags || :
%{_bindir}/vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null || :
%files common
%config(noreplace) %{_sysconfdir}/vimrc
%{!?_licensedir:%global license %%doc}
%doc README*
%doc runtime/docs
%{_datadir}/%{name}/%{vimdir}/autoload
%{_datadir}/%{name}/%{vimdir}/colors
%{_datadir}/%{name}/%{vimdir}/compiler
%{_datadir}/%{name}/%{vimdir}/pack
%{_datadir}/%{name}/%{vimdir}/doc
%{_datadir}/%{name}/%{vimdir}/*.vim
%exclude %{_datadir}/%{name}/%{vimdir}/defaults.vim
%{_datadir}/%{name}/%{vimdir}/ftplugin
%{_datadir}/%{name}/%{vimdir}/import/dist/vimhelp.vim
%{_datadir}/%{name}/%{vimdir}/indent
%{_datadir}/%{name}/%{vimdir}/keymap
%{_datadir}/%{name}/%{vimdir}/lang/*.vim
%{_datadir}/%{name}/%{vimdir}/lang/*.txt
%dir %{_datadir}/%{name}/%{vimdir}/lang
%{_datadir}/%{name}/%{vimdir}/macros
%{_datadir}/%{name}/%{vimdir}/plugin
%{_datadir}/%{name}/%{vimdir}/print
%{_datadir}/%{name}/%{vimdir}/syntax
%{_datadir}/%{name}/%{vimdir}/tutor
%if ! %{withvimspell}
%{_datadir}/%{name}/%{vimdir}/spell
%endif
%lang(af) %{_datadir}/%{name}/%{vimdir}/lang/af
%lang(ca) %{_datadir}/%{name}/%{vimdir}/lang/ca
%lang(cs) %{_datadir}/%{name}/%{vimdir}/lang/cs
%lang(cs.cp1250) %{_datadir}/%{name}/%{vimdir}/lang/cs.cp1250
%lang(da) %{_datadir}/%{name}/%{vimdir}/lang/da
%lang(de) %{_datadir}/%{name}/%{vimdir}/lang/de
%lang(en_GB) %{_datadir}/%{name}/%{vimdir}/lang/en_GB
%lang(eo) %{_datadir}/%{name}/%{vimdir}/lang/eo
%lang(es) %{_datadir}/%{name}/%{vimdir}/lang/es
%lang(fi) %{_datadir}/%{name}/%{vimdir}/lang/fi
%lang(fr) %{_datadir}/%{name}/%{vimdir}/lang/fr
%lang(ga) %{_datadir}/%{name}/%{vimdir}/lang/ga
%lang(it) %{_datadir}/%{name}/%{vimdir}/lang/it
%lang(ja) %{_datadir}/%{name}/%{vimdir}/lang/ja
%lang(ja.euc-jp) %{_datadir}/%{name}/%{vimdir}/lang/ja.euc-jp
%lang(ja.sjis) %{_datadir}/%{name}/%{vimdir}/lang/ja.sjis
%lang(ko) %{_datadir}/%{name}/%{vimdir}/lang/ko
%lang(ko) %{_datadir}/%{name}/%{vimdir}/lang/ko.UTF-8
%lang(lv) %{_datadir}/%{name}/%{vimdir}/lang/lv
%lang(nb) %{_datadir}/%{name}/%{vimdir}/lang/nb
%lang(nl) %{_datadir}/%{name}/%{vimdir}/lang/nl
%lang(no) %{_datadir}/%{name}/%{vimdir}/lang/no
%lang(pl) %{_datadir}/%{name}/%{vimdir}/lang/pl
%lang(pl.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/pl.UTF-8
%lang(pl.cp1250) %{_datadir}/%{name}/%{vimdir}/lang/pl.cp1250
%lang(pt_BR) %{_datadir}/%{name}/%{vimdir}/lang/pt_BR
%lang(ru) %{_datadir}/%{name}/%{vimdir}/lang/ru
%lang(ru.cp1251) %{_datadir}/%{name}/%{vimdir}/lang/ru.cp1251
%lang(sk) %{_datadir}/%{name}/%{vimdir}/lang/sk
%lang(sk.cp1250) %{_datadir}/%{name}/%{vimdir}/lang/sk.cp1250
%lang(sr) %{_datadir}/%{name}/%{vimdir}/lang/sr
%lang(sv) %{_datadir}/%{name}/%{vimdir}/lang/sv
%lang(tr) %{_datadir}/%{name}/%{vimdir}/lang/tr
%lang(uk) %{_datadir}/%{name}/%{vimdir}/lang/uk
%lang(uk.cp1251) %{_datadir}/%{name}/%{vimdir}/lang/uk.cp1251
%lang(vi) %{_datadir}/%{name}/%{vimdir}/lang/vi
%lang(zh_CN) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN
%lang(zh_CN.cp936) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN.cp936
%lang(zh_TW) %{_datadir}/%{name}/%{vimdir}/lang/zh_TW
%lang(zh_CN.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN.UTF-8
%lang(zh_TW.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/zh_TW.UTF-8
/%{_bindir}/xxd
%{_mandir}/man1/rvim.*
%{_mandir}/man1/vim.*
%{_mandir}/man1/vimdiff.*
%{_mandir}/man1/vimtutor.*
%{_mandir}/man1/xxd.*
%{_mandir}/man5/vimrc.*
%if %{with gui}
%{_mandir}/man1/gex.*
%{_mandir}/man1/gview.*
%{_mandir}/man1/gvim*
%{_mandir}/man1/vimx.*
%endif
%lang(fr) %{_mandir}/fr/man1/*
%lang(da) %{_mandir}/da/man1/*
%lang(de) %{_mandir}/de/man1/*
%lang(it) %{_mandir}/it/man1/*
%lang(ja) %{_mandir}/ja/man1/*
%lang(pl) %{_mandir}/pl/man1/*
%lang(ru) %{_mandir}/ru/man1/*
%lang(tr) %{_mandir}/tr/man1/*
%if %{withvimspell}
%files spell
%dir %{_datadir}/%{name}/%{vimdir}/spell
%{_datadir}/%{name}/vim70/spell/cleanadd.vim
%lang(af) %{_datadir}/%{name}/%{vimdir}/spell/af.*
%lang(am) %{_datadir}/%{name}/%{vimdir}/spell/am.*
%lang(bg) %{_datadir}/%{name}/%{vimdir}/spell/bg.*
%lang(ca) %{_datadir}/%{name}/%{vimdir}/spell/ca.*
%lang(cs) %{_datadir}/%{name}/%{vimdir}/spell/cs.*
%lang(cy) %{_datadir}/%{name}/%{vimdir}/spell/cy.*
%lang(da) %{_datadir}/%{name}/%{vimdir}/spell/da.*
%lang(de) %{_datadir}/%{name}/%{vimdir}/spell/de.*
%lang(el) %{_datadir}/%{name}/%{vimdir}/spell/el.*
%lang(en) %{_datadir}/%{name}/%{vimdir}/spell/en.*
%lang(eo) %{_datadir}/%{name}/%{vimdir}/spell/eo.*
%lang(es) %{_datadir}/%{name}/%{vimdir}/spell/es.*
%lang(fo) %{_datadir}/%{name}/%{vimdir}/spell/fo.*
%lang(fr) %{_datadir}/%{name}/%{vimdir}/spell/fr.*
%lang(ga) %{_datadir}/%{name}/%{vimdir}/spell/ga.*
%lang(gd) %{_datadir}/%{name}/%{vimdir}/spell/gd.*
%lang(gl) %{_datadir}/%{name}/%{vimdir}/spell/gl.*
%lang(he) %{_datadir}/%{name}/%{vimdir}/spell/he.*
%lang(hr) %{_datadir}/%{name}/%{vimdir}/spell/hr.*
%lang(hu) %{_datadir}/%{name}/%{vimdir}/spell/hu.*
%lang(id) %{_datadir}/%{name}/%{vimdir}/spell/id.*
%lang(it) %{_datadir}/%{name}/%{vimdir}/spell/it.*
%lang(ku) %{_datadir}/%{name}/%{vimdir}/spell/ku.*
%lang(la) %{_datadir}/%{name}/%{vimdir}/spell/la.*
%lang(lt) %{_datadir}/%{name}/%{vimdir}/spell/lt.*
%lang(lv) %{_datadir}/%{name}/%{vimdir}/spell/lv.*
%lang(mg) %{_datadir}/%{name}/%{vimdir}/spell/mg.*
%lang(mi) %{_datadir}/%{name}/%{vimdir}/spell/mi.*
%lang(ms) %{_datadir}/%{name}/%{vimdir}/spell/ms.*
%lang(nb) %{_datadir}/%{name}/%{vimdir}/spell/nb.*
%lang(nl) %{_datadir}/%{name}/%{vimdir}/spell/nl.*
%lang(nn) %{_datadir}/%{name}/%{vimdir}/spell/nn.*
%lang(ny) %{_datadir}/%{name}/%{vimdir}/spell/ny.*
%lang(pl) %{_datadir}/%{name}/%{vimdir}/spell/pl.*
%lang(pt) %{_datadir}/%{name}/%{vimdir}/spell/pt.*
%lang(ro) %{_datadir}/%{name}/%{vimdir}/spell/ro.*
%lang(ru) %{_datadir}/%{name}/%{vimdir}/spell/ru.*
%lang(rw) %{_datadir}/%{name}/%{vimdir}/spell/rw.*
%lang(sk) %{_datadir}/%{name}/%{vimdir}/spell/sk.*
%lang(sl) %{_datadir}/%{name}/%{vimdir}/spell/sl.*
%lang(sr) %{_datadir}/%{name}/%{vimdir}/spell/sr.*
%lang(sv) %{_datadir}/%{name}/%{vimdir}/spell/sv.*
%lang(sw) %{_datadir}/%{name}/%{vimdir}/spell/sw.*
%lang(tet) %{_datadir}/%{name}/%{vimdir}/spell/tet.*
%lang(th) %{_datadir}/%{name}/%{vimdir}/spell/th.*
%lang(tl) %{_datadir}/%{name}/%{vimdir}/spell/tl.*
%lang(tn) %{_datadir}/%{name}/%{vimdir}/spell/tn.*
%lang(uk) %{_datadir}/%{name}/%{vimdir}/spell/uk.*
%lang(yi) %{_datadir}/%{name}/%{vimdir}/spell/yi.*
%lang(yi-tr) %{_datadir}/%{name}/%{vimdir}/spell/yi-tr.*
%lang(zu) %{_datadir}/%{name}/%{vimdir}/spell/zu.*
%endif
%files minimal
%config(noreplace) %{_sysconfdir}/virc
%{_bindir}/ex
%{_bindir}/rvi
%{_bindir}/rview
%{_bindir}/vi
%{_bindir}/view
%{_libexecdir}/vi
%{_mandir}/man1/vi.*
%{_mandir}/man1/ex.*
%{_mandir}/man1/rvi.*
%{_mandir}/man1/rview.*
%{_mandir}/man1/view.*
%{_mandir}/man5/virc.*
%files enhanced
%{_bindir}/rvim
%{_bindir}/vim
%{_bindir}/vimdiff
%{_bindir}/vimtutor
%files filesystem
%{_rpmconfigdir}/macros.d/macros.vim
%dir %{_datadir}/%{name}/vimfiles/after
%dir %{_datadir}/%{name}/vimfiles/after/*
%dir %{_datadir}/%{name}/vimfiles/autoload
%dir %{_datadir}/%{name}/vimfiles/colors
%dir %{_datadir}/%{name}/vimfiles/compiler
%dir %{_datadir}/%{name}/vimfiles/doc
%ghost %{_datadir}/%{name}/vimfiles/doc/tags
%dir %{_datadir}/%{name}/vimfiles/ftdetect
%dir %{_datadir}/%{name}/vimfiles/ftplugin
%dir %{_datadir}/%{name}/%{vimdir}/import
%dir %{_datadir}/%{name}/%{vimdir}/import/dist
%dir %{_datadir}/%{name}/vimfiles/indent
%dir %{_datadir}/%{name}/vimfiles/keymap
%dir %{_datadir}/%{name}/vimfiles/lang
%dir %{_datadir}/%{name}/vimfiles/plugin
%dir %{_datadir}/%{name}/vimfiles/print
%dir %{_datadir}/%{name}/vimfiles/spell
%dir %{_datadir}/%{name}/vimfiles/syntax
%dir %{_datadir}/%{name}/vimfiles/tutor
%if %{with gui}
%files X11
%if "%{desktop_file}" == "1"
%{_datadir}/metainfo/*.appdata.xml
/%{_datadir}/applications/*
%exclude /%{_datadir}/applications/vim.desktop
%else
/%{_sysconfdir}/X11/applnk/*/gvim.desktop
%endif
%{_bindir}/gvimtutor
%{_bindir}/gvim
%{_bindir}/gvimdiff
%{_bindir}/gview
%{_bindir}/gex
%{_bindir}/vimtutor
%{_bindir}/vimx
%{_bindir}/evim
%{_mandir}/man1/evim.*
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/*
%dir %{_datadir}/icons/hicolor/*/apps
%{_datadir}/icons/hicolor/*/apps/*
%dir %{_datadir}/icons/locolor
%dir %{_datadir}/icons/locolor/*
%dir %{_datadir}/icons/locolor/*/apps
%{_datadir}/icons/locolor/*/apps/*
%endif
%files data
%license LICENSE
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/%{vimdir}
%{_datadir}/%{name}/%{vimdir}/defaults.vim
%dir %{_datadir}/%{name}/vimfiles
%{_datadir}/%{name}/vimfiles/template.spec
%if %{with default_editor}
%files default-editor