%define _python3ver__ %(fullver=%{__python3} --version | awk '{print $2}';echo ${fullver:0:3})
%define _python3path__ %{_includedir}/%{_python3ver__}m

%{!?_with_selinux__:%global _with_selinux__ 1}
%{!?_with_ruby__:%define _with_ruby__ 1}
%{!?_with_lua__:%define _with_lua__ 1}
%{!?_with_netbeans__:%define _with_netbeans__ 1}

%define vimdir vim82

Name:           vim
Epoch:          2
Version:        8.2
Release:        34
Summary:        Vim is a highly configurable text editor for efficiently creating and changing any kind of text.
License:        Vim and MIT
URL:            http://www.vim.org
Source0:        ftp://ftp.vim.org/pub/vim/unix/vim-8.2.tar.bz2
Source1:	    virc
Source2:	    vimrc

Patch0000:      vim-7.0-fixkeys.patch
Patch0001:      vim-7.4-specsyntax.patch
Patch0002:      vim-7.4-syntax.patch
Patch0003:      vim-7.4-nowarnings.patch
Patch0004:      vim-7.0-rclocation.patch
Patch0005:      vim-7.4-checkhl.patch
Patch0006:      vim-7.4-fstabsyntax.patch
Patch0007:      vim-7.4-syncolor.patch
Patch0009:      vim-7.4-globalsyntax.patch
Patch0010:      vim-7.4-releasestring-1318991.patch
Patch0011:      vim-8.0-copy-paste.patch
Patch0012:      vim-python3-tests.patch
Patch6000:      backport-CVE-2021-3770.patch
Patch6001:      backport-memory-leak-for-retab-with-invalid-argument.patch
Patch6003:      backport-CVE-2021-3778.patch
Patch6004:      backport-CVE-2021-3796.patch
Patch6005:      backport-CVE-2021-3872.patch
Patch6006:      backport-CVE-2021-3875.patch
Patch6007:      backport-CVE-2021-3903.patch
Patch6008:      backport-CVE-2021-3927.patch
Patch6009:      backport-cannot-use-z-when-spell-is-off.patch
Patch6010:      backport-CVE-2021-3928.patch
Patch6011:      backport-CVE-2021-3973.patch
Patch6012:      backport-CVE-2021-3974.patch
Patch6013:      backport-find-test-fails.patch
Patch6014:      backport-no-early-check-if-find-and-sfind-have-an-argument.patch
Patch6015:      backport-CVE-2021-3984.patch
Patch6016:      backport-CVE-2021-4019.patch
Patch6017:      backport-CVE-2021-4069.patch
Patch6018:      backport-missing-error-message.patch
Patch6019:      backport-fix-giving-the-error-0-more-files-to-edit.patch
Patch6020:      backport-add-the-arglist_locked-flag.patch
Patch6021:      backport-CVE-2021-4166.patch
Patch6022:      backport-fix-arglist-test-fails.patch
Patch6023:      backport-CVE-2021-4192.patch
Patch6024:      backport-CVE-2021-4193.patch
Patch6025:      backport-CVE-2022-0213.patch
Patch6026:	backport-CVE-2022-0261.patch
Patch6027:      backport-vim-fix-garbled-characters-display-when-file-name-ma.patch
Patch6028:	backport-CVE-2022-0318.patch
Patch6029:      backport-block-insert-with-double-wide-character-fails.patch
Patch6030:      backport-CVE-2022-0351.patch
Patch6031:      backport-CVE-2022-0408.patch
Patch6032:      backport-CVE-2022-0361.patch
Patch6033:      backport-command-line-editing-not-sufficiently-tested.patch
Patch6034:      backport-CVE-2022-0359.patch
Patch6035:      backport-CVE-2022-0413.patch
Patch6036:      backport-CVE-2022-0368.patch
Patch6037:      backport-CVE-2022-0443.patch      
Patch6038:      backport-invalid-argument-errmsg.patch
Patch6039:      backport-CVE-2022-0417.patch
Patch6040:      backport-invalid-memory-access-with-search-command.patch
Patch6041:      backport-bracketed-paste-can-still-cause-invalid-memory-acces.patch
Patch6042:      backport-CVE-2022-0392.patch
Patch6043:      backport-CVE-2022-0319.patch
Patch6044:      backport-CVE-2022-0554.patch
Patch6045:      backport-crash-when-pasting-too-many-times.patch
Patch6046:      backport-CVE-2022-0572.patch
Patch6047:      backport-CVE-2022-0629.patch
Patch6048:      backport-CVE-2022-0714.patch
Patch6049:      backport-CVE-2022-0729.patch
Patch6050:      backport-CVE-2022-0685.patch
Patch6051:      backport-CVE-2022-0943.patch
Patch6052:      backport-CVE-2022-1616.patch
Patch6053:      backport-CVE-2022-1154.patch
Patch6054:      backport-html-text-objects-are-not-fully-tested.patch
Patch6055:      backport-CVE-2022-1629.patch
Patch6056:      backport-insufficient-code-coverage-for-ex_docmd.c_functions.patch
Patch6057:      backport-CVE-2022-1620.patch
Patch6058:      backport-CVE-2022-1674.patch
Patch6059:      backport-CVE-2022-1621.patch
Patch6060:      backport-spell-test-fails-because-of-new-illegal-byte-check.patch
Patch6061:      backport-CVE-2022-1619.patch
Patch6062:      backport-CVE-2022-1733.patch
Patch6063:      backport-CVE-2022-1735.patch
Patch6064:      backport-CVE-2022-1796.patch
Patch6065:      backport-patch-8.2.0614-get-ml_get-error-when-deleting-a-line.patch
Patch6066:      backport-patch-8.2.0670-cannot-change-window-when-evaluating-.patch
Patch6067:      backport-CVE-2022-1785.patch
Patch6068:      backport-semicolon-search-dose-not-work-in-first-line.patch
Patch6069:      backport-CVE-2022-1927.patch
Patch6070:      backport-after-a-put-the-mark-is-on-the-last-byte.patch
Patch6071:      backport-illegal-memory-access.patch
Patch6072:      backport-CVE-2022-1886.patch
Patch6073:      backport-CVE-2022-1851.patch
Patch6074:      backport-CVE-2022-1898.patch
Patch6075:      backport-CVE-2022-1942.patch
Patch6076:      backport-fix-test-failed.patch
Patch6077:      backport-CVE-2022-1897.patch
Patch6078:      backport-CVE-2022-1968.patch

Patch9000:      bugfix-rm-modify-info-version.patch
Patch9001:      remove-failed-tests-due-to-patch.patch

BuildRequires:  autoconf python-devel python3-devel ncurses-devel gettext perl-devel perl-generators
BuildRequires:  perl(ExtUtils::Embed) perl(ExtUtils::ParseXS) libacl-devel gpm-devel file
BuildRequires:  desktop-file-utils >= 0.2.93 libtool chrpath
%if %{_with_selinux__}
BuildRequires:  libselinux-devel
%endif
%if %{_with_ruby__}
BuildRequires:  ruby-devel ruby
%endif
%if %{_with_lua__}
BuildRequires:  lua-devel
%endif
Requires:       desktop-file-utils
Conflicts:      filesystem < 3

%description
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. Vim is a
highly configurable text editor built to enable efficient text editing.
It is an improved version of the vi editor distributed with most UNIX
systems.

%package common
Summary:        This contains some common files to use vim editor.
Requires:       %{name}-filesystem
Conflicts:      man-pages-fr < 0.9.7-14 man-pages-it < 0.3.0-17 man-pages-pl < 0.24-2 %{name}-minimal < 8.0.1428-4

%description common
This common package contains files that will be needed when you run vim editor. This is also needed by vim-enhaned and vim-X11 packages.

%package minimal
Summary:        This package provides the basic and minimal functionalities of vim editor.
Provides:       vi = %{version}-%{release} %{_bindir}/vi
Conflicts:      %{name}-common < 8.0.1428-4

%description minimal
The minimal package provides a minimal version of vim editor. It will be installed as /usr/bin/vi.

%package enhanced
Summary:        This is a package containing enhanced vim editor.
Requires:       vim-common = %{epoch}:%{version}-%{release} which gpm-libs
Provides:       vim = %{version}-%{release} %{_bindir}/mergetool %{_bindir}/vim
Suggests:       python2 python2-libs python3 python3-libs
Suggests:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Suggests:       perl-libs perl-devel
%if %{_with_ruby__}
Suggests:       ruby-libs ruby
%endif
%if %{_with_lua__}
Suggests:       lua-libs
%endif

%description enhanced
This packages includes some enhancements for the vim editor.

%package filesystem
Summary:        The vim filesystem.
BuildArch:      noarch

%description filesystem
This package contains the vim filesystem.

%package X11
Summary:        Vim for the X Window System i.e.gvim
BuildRequires:  gtk3-devel libX11-devel libSM-devel libXt-devel libXpm-devel libICE-devel libappstream-glib
Requires:       vim-common = %{epoch}:%{version}-%{release} libattr >= 2.4 gtk3 hicolor-icon-theme
Requires:       libICE libSM libX11 libXt cairo gdk-pixbuf2 pango
Provides:       gvim = %{version}-%{release} %{_bindir}/mergetool %{_bindir}/gvim
Suggests:       python2 python2-libs python3 python3-libs
Suggests:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Suggests:       perl-libs perl-devel
%if %{_with_ruby__}
Suggests:       ruby-libs ruby
%endif
%if %{_with_lua__}
Suggests:       lua-libs
%endif

%description X11
This X11 package serves you the ability to use vim with graphics and mouse.

%prep
%autosetup -b 0 -n %{vimdir} -p1

%build
%define _make_cmd__() %{make_build} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir}; cp vim %{?1}; %{!?2:make clean}

export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -I%{_python3path__} -D__linux__ -D_REENTRANT"
export CXXFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -I%{_python3path__} -D__linux__ -D_REENTRANT"

sed -i 's/nawk/awk/g' runtime/tools/mve.awk
cd src; autoconf

cp -f os_unix.h os_unix.h.bak

sed -i 's/vimrc/virc/' os_unix.h
%configure --with-features=small --with-x=no --enable-multibyte --disable-netbeans \
 --disable-pythoninterp --disable-perlinterp --disable-tclinterp --with-tlib=ncurses \
 --enable-gui=no --disable-gpm --exec-prefix=/ \
 --enable-fail-if-missing \
%if %{_with_selinux__}
 --enable-selinux \
%else
 --disable-selinux \
%endif

%{_make_cmd__ vim-minimal}

mv os_unix.h.bak os_unix.h

%configure --with-features=huge --enable-pythoninterp=dynamic --enable-python3interp=dynamic \
 --enable-perlinterp=dynamic --disable-tclinterp --with-x=yes --enable-xim --enable-multibyte \
 --with-tlib=ncurses --enable-gtk3-check --enable-gui=gtk3 \
 --enable-cscope --enable-fail-if-missing \
%if %{_with_netbeans__}
 --enable-netbeans \
%else
 --disable-netbeans \
%endif
%if %{_with_selinux__}
 --enable-selinux \
%else
 --disable-selinux \
%endif
%if %{_with_ruby__}
 --enable-rubyinterp=dynamic \
%else
 --disable-rubyinterp \
%endif
%if %{_with_lua__}
 --enable-luainterp=dynamic \
%else
 --disable-luainterp \
%endif

%{_make_cmd__ vim-X11}

%configure --with-features=huge --enable-pythoninterp=dynamic --enable-python3interp=dynamic \
 --enable-perlinterp=dynamic --disable-tclinterp --with-x=no --enable-gui=no --enable-multibyte \
 --enable-cscope --with-tlib=ncurses \
 --enable-fail-if-missing \
%if %{_with_netbeans__}
 --enable-netbeans \
%else
 --disable-netbeans \
%endif
%if %{_with_selinux__}
 --enable-selinux \
%else
 --disable-selinux \
%endif
%if %{_with_ruby__}
 --enable-rubyinterp=dynamic \
%else
 --disable-rubyinterp \
%endif
%if %{_with_lua__}
 --enable-luainterp=dynamic \
%else
 --disable-luainterp \
%endif

%{_make_cmd__ vim-enhanced noclean}

%install
pushd src
%make_install BINDIR=%{_bindir} VIMRCLOC=%{_sysconfdir} VIMRUNTIMEDIR=%{_datadir}/%{name}/%{vimdir}
make installgtutorbin  DESTDIR=%{buildroot} BINDIR=%{_bindir} VIMRCLOC=%{_sysconfdir} VIMRUNTIMEDIR=%{_datadir}/%{name}/%{vimdir}

install -m755 vim-minimal %{buildroot}%{_bindir}/vi
install -m755 vim-enhanced %{buildroot}%{_bindir}/vim
install -m755 vim-X11 %{buildroot}%{_bindir}/gvim
popd

rm -f README*.info

for dir in {autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor}
do
    install -d %{buildroot}%{_datadir}/%{name}/vimfiles/${dir}
    install -d %{buildroot}%{_datadir}/%{name}/vimfiles/after/${dir}
done

install -m644 %{_builddir}/%{vimdir}/runtime/doc/uganda.txt %{_builddir}/%{vimdir}/LICENSE

install -d %{buildroot}%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps

install -d %{buildroot}%{_metainfodir}
cat > %{buildroot}%{_metainfodir}/gvim.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Richard Hughes <richard@hughsie.com> -->
<!--
EmailAddress: Bram@moolenaar.net>
SentUpstream: 2014-05-22
-->
<application>
  <id type="desktop">gvim.desktop</id>
  <metadata_license>CC0-1.0</metadata_license>
  <project_license>Vim</project_license>
  <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>
  </description>
  <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>
</application>
EOF

%define _linkvi__ %{buildroot}%{_bindir}/{rvi,rview,view,ex}
%define _linkvim__ %{buildroot}%{_bindir}/{rvim,vimdiff}
%define _linkgvim__ %{buildroot}%{_bindir}/{gview,gex,evim,gvimdiff,vimx}
%define _linkcmds__() for file in %{expand:%{_link%{1}__}};do ln -sf %{1} ${file};done;

%{_linkcmds__ vi}
%{_linkcmds__ vim}
%{_linkcmds__ gvim}

pushd %{buildroot}%{_mandir}/man1
sed -i 's,%{buildroot},,' {vim.1,vimtutor.1}
rm -f rvim.1
install -p vim.1 vi.1
ln -sf vi.1.gz rvi.1.gz
ln -sf vim.1.gz vimdiff.1.gz
popd

desktop-file-install --dir %{buildroot}%{_datadir}/applications %{_builddir}/%{vimdir}/runtime/gvim.desktop

appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata.xml

pushd %{buildroot}%{_datadir}/%{name}/%{vimdir}/tutor
ln -sf menu_ja_jp.ujis.vim %{buildroot}%{_datadir}/%{name}/%{vimdir}/lang/menu_ja_jp.eucjp.vim
for files in {tutor.ca,tutor.it,tutor.fr,tutor.es,tutor.de,tutor.sv,tutor.no}
do
    iconv -f CP1252 -t UTF8 ${files} -o ${files}.bak;mv ${files}.bak ${files}
done
iconv -f ISO-8859-2 -t UTF8 tutor.pl -o tutor.pl.bak;mv tutor.pl.bak tutor.pl
iconv -f ISO-8859-2 -t UTF8 tutor.sk -o tutor.sk.bak;mv tutor.sk.bak tutor.sk
iconv -f KOI8R -t UTF8 tutor.ru -o tutor.ru.bak;mv tutor.ru.bak tutor.ru
popd

install -Dpm644 %{SOURCE1} %{buildroot}%{_sysconfdir}/virc
install -pm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/vimrc

pushd %{buildroot}%{_mandir}
for files in `find ??/ -type f`
do
    if [[ "`file ${files}`" == *UTF-8\ Unicode\ text* ]]
    then
        continue
    fi
    iconv -f latin1 -t UTF8 ${files} -o ${files}.bak; mv ${files}.bak ${files}
done
popd

mv %{buildroot}%{_mandir}/ru.UTF-8 %{buildroot}%{_mandir}/ru

install -d %{buildroot}%{_mandir}/man5
for files in %{buildroot}%{_mandir}/{man1/{rvim.1,gvim.1,gex.1,gview.1,vimx.1},man5/vimrc.5}
do
    echo ".so man1/vim.1" > ${files}
done
echo ".so man1/vimdiff.1" > %{buildroot}%{_mandir}/man1/gvimdiff.1
echo ".so man1/vimtutor.1" > %{buildroot}%{_mandir}/man1/gvimtutor.1
echo ".so man1/vi.1" > %{buildroot}%{_mandir}/man5/virc.5
touch %{buildroot}%{_datadir}/%{name}/vimfiles/doc/tags

chrpath -d %{buildroot}%{_bindir}/vim
chrpath -d %{buildroot}%{_bindir}/xxd

mkdir -p %{buildroot}/etc/ld.so.conf.d
echo "{_libdir}/perl5/CORE" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf

pushd runtime
ln -sf ../../%{name}/%{vimdir}/doc docs
popd

%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 || :

%check
export TERM=linux
# Reset the terminal scrolling region left behind by the testsuite
trap "printf '\e[r'" EXIT
LC_ALL=en_US.UTF-8 make -j1 test

%files common
%exclude %{_datadir}/vim/%{vimdir}/macros/maze/maze*.c
%exclude %{_datadir}/vim/%{vimdir}/tools
%exclude %{_datadir}/vim/%{vimdir}/doc/vim2html.pl
%exclude %{_mandir}/{pl.ISO8859-2,it.ISO8859-1,ru.KOI8-R,fr.ISO8859-1,da.ISO8859-1}
%exclude %{_mandir}/{de.ISO8859-1,fr.UTF-8,it.UTF-8,pl.UTF-8,da.UTF-8,de.UTF-8}
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README*
%doc runtime/docs
%config(noreplace) %{_sysconfdir}/vimrc
%{_datadir}/%{name}/%{vimdir}/{rgb.txt,autoload,colors,compiler,pack,doc}
%{_datadir}/%{name}/%{vimdir}/{*.vim,ftplugin,indent,keymap,macros,plugin}
%{_datadir}/%{name}/%{vimdir}/{print,syntax,tutor,spell}
%{_datadir}/%{name}/%{vimdir}/lang/{*.vim,*.txt}
%{_bindir}/xxd
%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
%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/*
%{_mandir}/man1/{gex.*,gview.*,gvim*,rvim.*,vim.*,vimdiff.*}
%{_mandir}/man1/{vimtutor.*,vimx.*,xxd.*}
%{_mandir}/man5/vimrc.*
%config(noreplace) /etc/ld.so.conf.d/*

%files minimal
%config(noreplace) %{_sysconfdir}/virc
%{_bindir}/{ex,vi,view,rvi,rview}
%{_mandir}/man1/{vi.*,ex.*,rvi.*,rview.*,view.*}
%{_mandir}/man5/virc.*

%files enhanced
%{_bindir}/{vim,rvim,vimdiff,vimtutor}
%config(noreplace) /etc/ld.so.conf.d/*

%files filesystem
%dir %{_datadir}/%{name}/vimfiles/after/*
%dir %{_datadir}/%{name}/vimfiles/{autoload,colors,compiler,doc,ftdetect,ftplugin}
%dir %{_datadir}/%{name}/vimfiles/{indent,keymap,lang,plugin,print,spell,syntax,tutor}
%ghost %{_datadir}/%{name}/vimfiles/doc/tags

%files X11
%exclude /%{_datadir}/applications/vim.desktop
%{_datadir}/metainfo/*.appdata.xml
%{_datadir}/applications/*
%{_datadir}/icons/{hicolor,locolor}/*/apps/*
%{_bindir}/{gvimtutor,gvim,gvimdiff,gview,gex}
%{_bindir}/{vimtutor,vimx,evim}
%{_mandir}/man1/evim.*

%changelog
* Sat Jun 18 202 shixuantong <shixuantong@h-partners.com> - 2:8.2-34
- Type:CVE
- ID:CVE-2022-1897 CVE-2022-1968
- SUG:NA
- DESC:fix CVE-2022-1897 CVE-2022-1968

* Wed Jun 15 2022 tianwei <tianwei12@h-partners.com> - 2:8.2-33
- Type:CVE
- ID:CVE-2022-1851 CVE-2022-1898 CVE-2022-1942
- SUG:NA
- DESC:fix CVE-2022-1851 CVE-2022-1898 CVE-2022-1942

* Wed Jun 15 2022 renhongxun <renhongxun@h-partners.com> - 2:8.2-32
- Type:CVE
- ID:CVE-2022-1886
- SUG:NA
- DESC:fix CVE-2022-1886

* Mon Jun 13 2022 renhongxun <renhongxun@h-partners.com> - 2:8.2-31
- Type:CVE
- ID:CVE-2022-1927
- SUG:NA
- DESC:fix CVE-2022-1927

* Thu Jun 09 2022 renhongxun <renhongxun@h-partners.com> - 2:8.2-30
- Type:CVE
- ID:CVE-2022-1785
- SUG:NA
- DESC:fix CVE-2022-1785

* Thu Jun 09 2022 shixuantong <shixuantong@h-partners.com> - 2:8.2-29
- Type:CVE
- ID:CVE-2022-1796
- SUG:NA
- DESC:fix CVE-2022-1796

* Tue May 31 2022 shixuantong <shixuantong@h-partners.com> - 2:8.2-28
- Type:CVE
- ID:CVE-2022-1733 CVE-2022-1735
- SUG:NA
- DESC:fix CVE-2022-1733 CVE-2022-1735

* Sat May 21 2022 shixuantong <shixuantong@h-partners.com> - 2:8.2-27
- Type:CVE
- ID:CVE-2022-1629 CVE-2022-1620 CVE-2022-1674 CVE-2022-1621 CVE-2022-1619
- SUG:NA
- DESC:fix CVE-2022-1629 CVE-2022-1620 CVE-2022-1674 CVE-2022-1621 CVE-2022-1619

* Mon May 16 2022 shixuantong <shixuantong@h-partners.com> - 2:8.2-26
- Type:CVE
- ID:CVE-2022-1154
- SUG:NA
- DESC:fix CVE-2022-1154

* Mon May 09 2022 shangyibin <shangyibin1@h-partners.com> - 2:8.2-25
- Type:CVE
- ID:CVE-2022-1616
- SUG:NA
- DESC:fix CVE-2022-1616

* Thu Mar 24 2022 yuanxin <yuanxin24@h-partners.com> - 2:8.2-24
- Type:CVE
- ID:CVE-2022-0943
- SUG:NA
- DESC:fix CVE-2022-0943

* Sat Mar 19 2022 yuanxin <yuanxin24@h-partners.com> - 2:8.2-23
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:cve patch test cases are rectified

* Wed Mar 09 2022 shixuantong <shixuantong@h-partners.com> - 2:8.2-22
- Type:CVE
- ID:CVE-2022-0685
- SUG:NA
- DESC:fix CVE-2022-0685

* Sat Mar 05 2022 yuanxin <yuanxin24@h-partners.com> - 2:8.2-21
- Type:CVE
- ID:CVE-2022-0714CVE-2022-0729
- SUG:NA
- DESC:fix CVE-2022-0714 CVE-2022-0729

* Mon Feb 28 2022 yuanxin <yuanxin24@h-partners.com> - 2:8.2-20
- Type:CVE
- ID:CVE-2022-0629
- SUG:NA
- DESC:fix CVE-2022-0629

* Fri Feb 25 2022 yuanxin <yuanxin24@h-partners.com> - 2:8.2-19
- Type:CVE
- ID:CVE-2022-0572
- SUG:NA
- DESC:fix CVE-2022-0572

* Tue Feb 22 2022 yuanxin <yuanxin24@h-partners.com> - 2:8.2-18
- Type:CVE
- ID:CVE-2022-0319 CVE-2022-0554
- SUG:NA
- DESC:fix CVE-2022-0319 CVE-2022-0554 

* Wed Feb 16 2022 yuanxin <yuanxin24@h-partners.com> - 2:8.2-17
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add make check

* Wed Feb 09 2022 tianwei <tianwei12@h-partners.com> - 2:8.2-16
- Type:CVE
- ID:CVE-2022-0443 CVE-2022-0392 CVE-2022-0417
- SUG:NA
- DESC:fix CVE-2022-0443 CVE-2022-0392 CVE-2022-0417

* Mon Feb 07 2022 shixuantong <shixuantong@h-partners.com> - 2:8.2-15
- Type:CVE
- ID:CVE-2022-0351 CVE-2022-0361 CVE-2022-0408 CVE-2022-0359 CVE-2022-0368 CVE-2022-0413
- SUG:NA
- DESC:fix CVE-2022-0351 CVE-2022-0361 CVE-2022-0408 CVE-2022-0359 CVE-2022-0368 CVE-2022-0413

* Sun Jan 30 2022 yuanxin<yuanxin24@h-partners.com> - 2:8.2-14
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix garbled character display when file name matches

* Fri Jan 28 2022 guozhaorui<guozhaorui@h-partners.com> - 2:8.2-13
- Type:CVE
- ID:CVE-2022-0261 CVE-2022-0318
- SUG:NA
- DESC:fix CVE-2022-0261 CVE-2022-0318

* Thu Jan 20 2022 guozhaorui<guozhaorui1@huawei.com> - 2:8.2-12
- Type:CVE
- ID:CVE-2022-0213
- SUG:NA
- DESC:fix CVE-2022-0213

* Mon Jan 17 2022 yuanxin<yuanxin24@huawei.com> - 2:8.2-11
- Type:CVE
- ID:CVE-2021-4166 CVE-2021-4192 CVE-2021-4193
- SUG:NA
- DESC:fix CVE-2021-4166 CVE-2021-4192 CVE-2021-4193

* Sat Dec 11 2021 yuanxin<yuanxin24@huawei.com> - 2:8.2-10
- Type:CVE
- ID:CVE-2021-4069
- SUG:NA
- DESC:fix CVE-2021-4069

* Tue Dec 07 2021 shixuantong<shixuantong@huawei.com> - 2:8.2-9
- Type:CVE
- ID:CVE-2021-4019
- SUG:NA
- DESC:fix CVE-2021-4019

* Sat Dec 04 2021 shixuantong<shixuantong@huawei.com> - 2:8.2-8
- Type:CVE
- ID:CVE-2021-3984
- SUG:NA
- DESC:fix CVE-2021-3984

* Tue Nov 30 2021 shixuantong<shixuantong@huawei.com> - 2:8.2-7
- Type:CVE
- ID:CVE-2021-3973 CVE-2021-3974
- SUG:NA
- DESC:fix CVE-2021-3973 CVE-2021-3974

* Sat Nov 13 2021 shixuantong<shixuantong@huawei.com> - 2:8.2-6
- Type:CVE
- ID:CVE-2021-3927 CVE-2021-3927
- SUG:NA
- DESC:fix CVE-2021-3927 CVE-2021-3928

* Sat Oct 30 2021 shixuantong<shixuantong@huawei.com> - 2:8.2-5
- Type:CVE
- ID:CVE-2021-3903
- SUG:NA
- DESC:fix CVE-2021-3903

* Sat Oct 23 2021 shixuantong<shixuantong@huawei.com> - 2:8.2-4
- Type:CVE
- ID:CVE-2021-3872 CVE-2021-3875
- SUG:NA
- DESC:fix CVE-2021-3872 CVE-2021-3875

* Sun Sep 26 2021 shixuantong<shixuantong@huawei.com> - 2:8.2-3
- Type:CVE
- ID:CVE-2021-3778 CVE-2021-3796
- SUG:NA
- DESC:fix CVE-2021-3778 CVE-2021-3796

* Sat Sep 11 2021 shixuantong<shixuantong@huawei.com> - 2:8.2-2
- Type:CVE
- ID:NA
- SUG:NA
- DESC:fix CVE-2021-3770

* Thu Apr 16 2020 chengquan<chengquan3@huawei.com> -2:8.2-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:upgrade software to v8.2

* Sat Feb 29 2020 openEuler Buildteam <buildteam@openeuler.org> - 2:8.1.450-8
- update virc/vimrc to make escape work in insert mode

* Thu Jan 21 2020 openEuler Buildteam <buildteam@openeuler.org> - 2:8.1.450-7
- make vi/vim  easy to uses

* Sun Jan 19 2020 openEuler Buildteam <buildteam@openeuler.org> - 2:8.1.450-6
- fix bug in install files

* Sat Jan 18 2020 openEuler Buildteam <buildteam@openeuler.org> - 2:8.1.450-5
- make vi easy to use

* Thu Jan 9 2020 openEuler Buildteam <buildteam@openeuler.org> - 2:8.1.450-4
- update spec and patch

* Sun Dec 22 2019 openEuler Buildteam <buildteam@openeuler.org> - 2:8.1.450-3
- update vimrc/virc info

* Mon Sep 23 2019 huzhiyu<huzhiyu1@huawei.com> - 2:8.1.450-2
- Package init
