LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File vim.spec of Package vim (Project home:fusion809)

#
# spec file for package vim
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define baseversion 8.0
%define patchlevel 0992
%define vimdir vim80
%define site_runtimepath /usr/share/vim/site
%define make make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/current MAKE="make -e" %{?_smp_mflags}

%if 0%{?fedora}
%define desktop_file 1
%if %{desktop_file}
%define desktop_file_utils_version 0.2.93
%endif

%define withnetbeans 1

%define withruby 1
%define withlua 1
%endif

Name:           vim
Version:        %{baseversion}.%{patchlevel}
Release:        0
Summary:        Vi IMproved
License:        Vim
Group:          Applications/Editors
Url:            http://www.vim.org/

%if 0%{?suse_version} > 1200
BuildRequires:  pkgconfig(xt)
%endif

%if 0%{?suse_version}

# SUSE-specific reqs
BuildRequires:  fdupes
BuildRequires:  gettext-devel
BuildRequires:  perl
BuildRequires:  rsvg-view
BuildRequires:  update-desktop-files
PreReq:         fileutils
PreReq:         sh-utils
%else

# Fedora-specific reqs
BuildRequires:  desktop-file-utils >= %{desktop_file_utils_version}
BuildRequires:  gettext
BuildRequires:  krb5-devel
BuildRequires:  perl-generators
BuildRequires:  pkgconfig
BuildRequires:  python-devel
BuildRequires:  perl(ExtUtils::Embed)
BuildRequires:  perl(ExtUtils::ParseXS)
Requires:       desktop-file-utils
%endif

%if 0%{?fedora}
BuildRequires:  python3-devel
%endif
%if 0%{?rhel}
BuildRequires:  python34-devel
%endif

# Build dependencies common to Fedora and openSUSE
BuildRequires:  autoconf
BuildRequires:  gpm-devel
BuildRequires:  gtk2-devel
BuildRequires:  libacl-devel
BuildRequires:  ncurses-devel

# Optional build deps common to Fedora and openSUSE
%if "%{withruby}" == "1"
BuildRequires:  ruby
BuildRequires:  ruby-devel
%endif
%if "%{withlua}" == "1"
BuildRequires:  lua-devel
%endif

%if 0%{?suse_version}
# SUSE-specific
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Provides:       vi
Provides:       vim-base = %{version}-%{release}
Provides:       vim-enhanced = %{version}-%{release}
Provides:       vim-python = %{version}-%{release}
Obsoletes:      vim-base < %{version}-%{release}
Obsoletes:      vim-enhanced < %{version}-%{release}
Obsoletes:      vim-python < %{version}-%{release}
Provides:       vim_client
Recommends:     vim-data = %{version}-%{release}

%else
# Fedora-specific
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Conflicts:      filesystem < 3
%endif

# Sources
Source:         https://github.com/vim/vim/archive/v%{baseversion}.%{patchlevel}.tar.gz

# Fedora patches
%if 0%{?fedora} || 0%{?rhel}
Source1:        vim.sh
Source2:        vim.csh
Source4:        virc
Source5:        vimrc
Source7:        gvim16.png
Source8:        gvim32.png
Source9:        gvim48.png
Source10:       gvim64.png
Source14:       spec-template
Source15:       spec-template.new
Source16:       macros.vim
Patch2002:      vim-7.0-fixkeys.patch
Patch2003:      vim-7.4-specsyntax.patch
Patch3000:      vim-7.4-syntax.patch
Patch3002:      vim-7.4-nowarnings.patch
Patch3004:      vim-7.0-rclocation.patch
Patch3006:      vim-7.4-checkhl.patch
Patch3007:      vim-7.4-fstabsyntax.patch
Patch3008:      vim-7.4-syncolor.patch
Patch3009:      vim-7.0-specedit.patch
Patch3010:      vim-7.3-manpage-typo-668894-675480.patch
Patch3011:      vim-manpagefixes-948566.patch
Patch3012:      vim-7.4-licensemacro-1151450.patch
Patch3013:      vim-7.4-globalsyntax.patch
Patch3014:      vim-7.4-releasestring-1318991.patch
Patch3015:      vim-8.0-rhbz1365258.patch
Patch3016:      vim-8.0-copy-paste.patch
%endif

# openSUSE patches
%if 0%{?suse_version}
Source3:        suse.vimrc
Source4:        vimrc_example1
Source5:        vimrc_example2
Source8:        suse.gvimrc
Source10:       README.Japanese-XIM
Source13:       vitmp.c
Source14:       vitmp.1
Source15:       vim132
Source18:       missing-vim-client
Source19:       gvim.desktop
Source20:       spec.skeleton
Source23:       apparmor.vim
Source24:       gvim.svg
Source25:       gvim.png
Source99:       %{name}-7.4-rpmlintrc
Patch3:         %{name}-7.4-disable_lang_no.patch
Patch4:         %{name}-7.3-gvimrc_fontset.patch
Patch5:         %{name}-7.4-highlight_fstab.patch
Patch6:         %{name}-7.3-sh_is_bash.patch
Patch7:         %{name}-7.3-filetype_ftl.patch
Patch8:         %{name}-7.3-help_tags.patch
Patch9:         %{name}-7.3-use_awk.patch
Patch10:        %{name}-7.3-name_vimrc.patch
Patch11:        %{name}-7.3-mktemp_tutor.patch
Patch15:        %{name}-7.4-filetype_apparmor.patch
Patch18:        %{name}-7.3-filetype_spec.patch
Patch21:        %{name}-7.3-filetype_changes.patch
Patch22:        %{name}-7.4-filetype_mine.patch
Patch100:       vim73-no-static-libpython.patch
%endif

%description
Vim (Vi IMproved) is an almost compatible version of the UNIX editor
vi. Almost every possible command can be performed using only ASCII
characters. Only the 'Q' command is missing (you do not need it). Many
new features have been added: multilevel undo, command line history,
file name completion, block operations, and editing of binary data.

%if 0%{?suse_version}
# SUSE
%package data
Summary:        Vi IMproved
Group:          Productivity/Editors/Vi
BuildArch:      noarch
# Used to be in vim-plugins package
Obsoletes:      vim-plugin-matchit <= 1.13.2
Provides:       vim-plugin-matchit = 1.13.2

%description data
Vim (Vi IMproved) is an almost compatible version of the UNIX editor
vi. Almost every possible command can be performed using only ASCII
characters. Only the 'Q' command is missing (you do not need it). Many
new features have been added: multilevel undo, command line history,
file name completion, block operations, and editing of binary data.

Vi is available for the AMIGA, MS-DOS, Windows NT, and various versions
of UNIX.

For SUSE Linux, Vim is used as /usr/bin/vi.

Package vim-data contains the runtime files.

%else
# Fedora
%package common
Summary:        The common files needed by any version of the VIM editor
Group:          Applications/Editors
Conflicts:      man-pages-fr < 0.9.7-14
Conflicts:      man-pages-it < 0.3.0-17
Conflicts:      man-pages-pl < 0.24-2
Requires:       %{name}-filesystem

%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.
%endif

%if 0%{?suse_version}
# SUSE
%package -n gvim
Summary:        A GUI for Vi
Group:          Productivity/Editors/Vi
Requires:       gvim_client
Requires:       vim-data
Provides:       gvim-base = %{version}-%{release}
Provides:       gvim-enhanced = %{version}-%{release}
Obsoletes:      gvim-base < %{version}-%{release}
Obsoletes:      gvim-enhanced < %{version}-%{release}
Provides:       gvim_client
Provides:       vi
Provides:       vim_client

%description -n gvim
Copy and modify /usr/share/vim/current/gvimrc to ~/.gvimrc if needed.

Package gvim contains the largest set of features of vim, which is
graphical windows and language interpreter, like python, ruby, or perl.
You need package vim for the help and other documentation too. If you
want less features, you might want to install vim instead.

%else
# Fedora
%package X11
Summary:        The VIM version of the vi editor for the X Window System with the GTK+ 2 toolkit
Group:          Applications/Editors
Requires:       vim-common = %{version}-%{release} libattr >= 2.4 gtk2
Provides:       gvim = %{version}-%{release}
Provides:       mergetool
BuildRequires:  gtk2-devel
BuildRequires:  libSM-devel
BuildRequires:  libXpm-devel
BuildRequires:  libXt-devel
Requires:       hicolor-icon-theme
Requires:       perl-libs

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

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

%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
%package minimal
Summary:        A minimal version of the VIM editor
Group:          Applications/Editors
Provides:       /bin/vi
Provides:       vi = %{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, which is
installed into /bin/vi for use when only the root partition is
present. 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
Group:          Applications/Editors
Requires:       vim-common = %{version}-%{release} which
Provides:       mergetool
Provides:       vim = %{version}-%{release}
Requires:       perl-libs

%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
Group:          Applications/Editors

%Description filesystem
This package provides some directories which are required by other
packages that add vim files, p.e.  additional syntax files or filetypes.
%endif

%prep
%setup -q -n %{name}-%{baseversion}.%{patchlevel}

%if 0%{?suse_version}
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
cp %{SOURCE23} runtime/syntax/apparmor.vim
%patch15 -p1
%patch18 -p1
%patch21 -p1
%patch22 -p1
%patch100 -p1
cp %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE8} %{SOURCE10} .
%else
# fix rogue dependencies from sample code
chmod -x runtime/tools/mve.awk
%patch2002 -p1
%patch2003 -p1
perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk
%patch3000 -p1
%patch3002 -p1
%patch3004 -p1
%patch3006 -p1
%patch3007 -p1
%patch3008 -p1
#patch3009 -p1
%patch3010 -p1
%patch3011 -p1
%patch3012 -p1
%patch3013 -p1
%patch3014 -p1
%patch3015 -p1
%patch3016 -p1
%endif

%build
%if 0%{?suse_version}
export CFLAGS="%{optflags} -Wall -pipe -fno-strict-aliasing"
export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/-D_FORTIFY_SOURCE=1}

export COMMON_OPTIONS="\
    --with-vim-name=vim \
    --with-ex-name=ex \
    --with-view-name=view \
    --enable-cscope \
    --enable-multibyte \
    --with-features=huge \
    --with-compiledby='fusion809' \
%if 0%{?suse_version} > 1210
    --with-tlib=tinfo \
%else
    --with-tlib=ncurses \
%endif
    --with-global-runtime=%{site_runtimepath} \
    --enable-luainterp=dynamic \
    --enable-perlinterp=yes \
    --enable-pythoninterp=dynamic \
    --enable-python3interp=dynamic \
    --enable-rubyinterp=dynamic"

export GUI_OPTIONS="\
    --disable-icon-cache-update \
    --enable-xim \
    --enable-fontset \
    --enable-gui=gtk2"

pushd src
autoconf
popd

# build vim
%configure ${COMMON_OPTIONS} --disable-gui --disable-gpm
sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h
make %{?_smp_mflags}
cp src/vim vim

# build gvim
make distclean
%configure ${COMMON_OPTIONS} ${GUI_OPTIONS}
sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h
make %{?_smp_mflags}

#
# build vitmp
gcc %{optflags} %{SOURCE13} -o vitmp

%else
cd src
autoconf

sed -e "s+VIMRCLOC	= \$(VIMLOC)+VIMRCLOC	= /etc+" Makefile > Makefile.tmp
mv -f Makefile.tmp Makefile

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
cp -f ex_cmds.c ex_cmds.c.save

perl -pi -e "s/vimrc/virc/"  os_unix.h
%configure --prefix=%{_prefix} --with-features=small --with-x=no \
  --enable-multibyte \
  --disable-netbeans \
  --enable-selinux \
  --disable-selinux \
  --disable-pythoninterp --disable-perlinterp --disable-tclinterp \
  --with-tlib=ncurses --enable-gui=no --disable-gpm --exec-prefix=/ \
  --with-compiledby="fusion809" \
  --with-modified-by="fusion809"

make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags}
cp vim minimal-vim
make clean

mv -f os_unix.h.save os_unix.h
mv -f ex_cmds.c.save ex_cmds.c

%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-gtk2-check --enable-gui=gtk2 \
  --with-compiledby="fusion809" --enable-cscope \
  --with-modified-by="fusion809" \
%if "%{withnetbeans}" == "1"
  --enable-netbeans \
%else
  --disable-netbeans \
%endif
  --enable-selinux \
%if "%{withruby}" == "1"
  --enable-rubyinterp=dynamic \
%else
  --disable-rubyinterp \
%endif
%if "%{withlua}" == "1"
  --enable-luainterp=dynamic \
%else
  --disable-luainterp \
%endif
  --enable-termtruecolor

make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags}
cp vim gvim
make clean

%configure --prefix=%{_prefix} --with-features=huge \
 --enable-pythoninterp=dynamic \
 --enable-python3interp=dynamic \
 --enable-perlinterp=dynamic \
 --disable-tclinterp \
 --with-x=no \
 --enable-gui=no --exec-prefix=%{_prefix} --enable-multibyte \
 --enable-cscope --with-modified-by="<bugzilla@redhat.com>" \
 --with-tlib=ncurses \
 --with-compiledby="<bugzilla@redhat.com>" \
%if "%{withnetbeans}" == "1"
  --enable-netbeans \
%else
  --disable-netbeans \
%endif
  --enable-selinux \
%if "%{withruby}" == "1"
  --enable-rubyinterp=dynamic \
%else
  --disable-rubyinterp \
%endif
%if "%{withlua}" == "1"
  --enable-luainterp=dynamic \
%else
  --disable-luainterp \
%endif
  --enable-termtruecolor

make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags}
cp vim enhanced-vim
%endif

%install
%if 0%{?suse_version}
%makeinstall STRIP=:
# create icon directory to have the icons installed and convert them to all hicolor expected sizes.
for size in %{_datadir}/icons/hicolor/*[0-9]x[0-9]*; do
 SIZE=$(echo $size | awk -Fx {'print $2}')
 install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps
 rsvg-convert -h ${SIZE} -w ${SIZE} %{S:24} -o %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps/gvim.png
done
install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps/
install -m 0644 %{SOURCE24} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/gvim.svg
# the last installed binary is gvim. preserve it and
# fix its symlinks. e* was added here as it doesnt make much sense in
# console
mv %{buildroot}%{_bindir}/vim %{buildroot}%{_bindir}/gvim
for f in egvim egview eview evim gex gvi gview gvimdiff rgview rgvim ; do
    ln -s -vf gvim %{buildroot}%{_bindir}/$f
done

# install vim
install -D -m 0755 vim %{buildroot}/bin/vim

# compat symlinks
ln -s -f /bin/vim   %{buildroot}/bin/vi
ln -s -f /bin/vim   %{buildroot}%{_bindir}/vim
ln -s -f /bin/vim   %{buildroot}%{_bindir}/vi
ln -s -f vim        %{buildroot}%{_bindir}/edit
ln -s -f /bin/vim   %{buildroot}/bin/ex

# man pages
ln -s -f vim.1.gz %{buildroot}%{_mandir}/man1/vi.1.gz
ln -s -f vim.1.gz %{buildroot}%{_mandir}/man1/ex.1.gz

# vitmp
install -m 0755 vitmp       %{buildroot}%{_bindir}/vitmp
install -m 0644 %{SOURCE14} %{buildroot}%{_mandir}/man1/vitmp.1
install -m 0755 %{SOURCE15} %{buildroot}%{_datadir}/vim/%vimdir/tools/vim132

# make the vim settings more generic
ln -s -f %vimdir %{buildroot}%{_datadir}/vim/current

# additional files
install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/vimrc
install -D -m 0644 %{SOURCE8} %{buildroot}%{_sysconfdir}/gvimrc

# create site wide runtime directory
mkdir -p -m 0755 %{buildroot}%{site_runtimepath}/after
mkdir -m 0755 %{buildroot}%{site_runtimepath}/autoload
mkdir -m 0755 %{buildroot}%{site_runtimepath}/colors
mkdir -m 0755 %{buildroot}%{site_runtimepath}/doc
mkdir -m 0755 %{buildroot}%{site_runtimepath}/plugin
mkdir -m 0755 %{buildroot}%{site_runtimepath}/syntax
mkdir -m 0755 %{buildroot}%{site_runtimepath}/ftdetect
mkdir -m 0755 %{buildroot}%{site_runtimepath}/after/syntax
mkdir -m 0755 %{buildroot}%{_datadir}/vim/current/skeletons
mkdir -m 0755 %{buildroot}%{_sysconfdir}/skel

# install spec helper
install -m 0644 %{SOURCE20}  %{buildroot}%{_datadir}/vim/current/skeletons/skeleton.spec

# desktop file for gvim
install -D -m 0644 %{SOURCE19} %{buildroot}%{_datadir}/applications/gvim.desktop
%suse_update_desktop_file gvim Utility TextEditor
#
# documentation
cp runtime/doc/uganda.txt LICENSE
install -d -m 0755 %{buildroot}%{_docdir}/{,g}vim/
install -D -m 0644 LICENSE \
    vimrc_example1 vimrc_example2 suse.vimrc \
    README.txt READMEdir/README_src.txt READMEdir/README_unix.txt \
  %{buildroot}%{_docdir}/vim/
# gvim
install -D -m 0644 \
    README.Japanese-XIM runtime/gvimrc_example.vim suse.gvimrc \
  %{buildroot}%{_docdir}/gvim/
#
# stupid helper
install -m 0755 %{SOURCE18} %{buildroot}%{_datadir}/vim/current/tools/missing-vim-client

# remove unecessary duplicate manpages
rm -rf %{buildroot}%{_mandir}/fr.ISO8859-1/
rm -rf %{buildroot}%{_mandir}/fr.UTF-8/
rm -rf %{buildroot}%{_mandir}/pl.ISO8859-2/
rm -rf %{buildroot}%{_mandir}/pl.UTF-8/
rm -rf %{buildroot}%{_mandir}/ru.KOI8-R/
rm -rf %{buildroot}%{_mandir}/it.ISO8859-1/
rm -rf %{buildroot}%{_mandir}/it.UTF-8/

# remove unnecessary files
rm -rf %{buildroot}%{_datadir}/applications/vim.desktop
rm -rf %{buildroot}%{_datadir}/icons/locolor

# and move russian manpages to a place where they can be found
mv %{buildroot}%{_mandir}/ru.UTF-8 %{buildroot}%{_mandir}/ru

# remove some c source files
rm -f %{buildroot}%{_datadir}/vim/%vimdir/tools/*.c
rm -f %{buildroot}%{_datadir}/vim/%vimdir/macros/maze/*.c

# Remove sample server to avoid python dependency
rm %{buildroot}%{_datadir}/vim/%vimdir/tools/demoserver.py

# Create ghost files (see vim.conf)
mkdir -p %{buildroot}/var/run/vi.recover

%fdupes -s %{buildroot}%{_datadir}/vim/%vimdir/lang
%fdupes -s %{buildroot}%{_datadir}/vim/%vimdir/tutor
%fdupes -s %{buildroot}%{_datadir}/vim/%vimdir/ftplugin
%else
rm -rf %{buildroot}
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}
%if %{?fedora}%{!?fedora:0} >= 16 || %{?rhel}%{!?rhel:0} >= 6
cp -f %{SOURCE15} %{buildroot}/%{_datadir}/%{name}/vimfiles/template.spec
%else
cp -f %{SOURCE14} %{buildroot}/%{_datadir}/%{name}/vimfiles/template.spec
%endif
cp runtime/doc/uganda.txt LICENSE
# Those aren't Linux info files but some binary files for Amiga:
rm -f README*.info

cd src
make install DESTDIR=%{buildroot} BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir}
make installgtutorbin  DESTDIR=%{buildroot} BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir}
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps
install -m755 minimal-vim %{buildroot}%{_bindir}/vi
install -m755 enhanced-vim %{buildroot}%{_bindir}/vim
install -m755 gvim %{buildroot}%{_bindir}/gvim
install -p -m644 %{SOURCE7} \
   %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/gvim.png
install -p -m644 %{SOURCE8} \
   %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/gvim.png
install -p -m644 %{SOURCE9} \
   %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/gvim.png
install -p -m644 %{SOURCE10} \
   %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/gvim.png
#cp -f %{SOURCE17} %{buildroot}/%{_datadir}/%{name}/%{vimdir}/ftplugin/spec.vim
#cp -f %{SOURCE18} %{buildroot}/%{_datadir}/%{name}/%{vimdir}/syntax/spec.vim

# 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}/appdata
cat > $RPM_BUILD_ROOT%{_datadir}/appdata/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>
  <url type="homepage">http://www.vim.org/</url>
</application>
EOF

mkdir -p %{_builddir}/%{vimdir}/runtime/

( cd %{buildroot}
  ln -sf vi ./%{_bindir}/rvi
  ln -sf vi ./%{_bindir}/rview
  ln -sf vi ./%{_bindir}/view
  ln -sf 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
  ln -sf vim.1.gz .%{_mandir}/man1/vi.1.gz
  ln -sf vim.1.gz .%{_mandir}/man1/rvi.1.gz
  ln -sf vim.1.gz .%{_mandir}/man1/vimdiff.1.gz
  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
  # 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 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}/profile.d
cp %{SOURCE1} %{buildroot}/%{_sysconfdir}/profile.d/vim.sh
cp %{SOURCE2} %{buildroot}/%{_sysconfdir}/profile.d/vim.csh
chmod 0644 %{buildroot}/%{_sysconfdir}/profile.d/vim.*
install -p -m644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/virc
install -p -m644 %{SOURCE5} %{buildroot}/%{_sysconfdir}/vimrc

mkdir -p %{buildroot}%{_libdir}/%{name}
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
install -p -m644 %{SOURCE16} %{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~
( cd %{buildroot}/%{_mandir}
  for i in `find ??/ -type f`; do
    if [[ "`file $i`" == *UTF-8\ Unicode\ text* ]]; then
      continue
    fi
    bi=`basename $i`
    iconv -f latin1 -t UTF8 $i > %{buildroot}/$bi
    mv -f %{buildroot}/$bi $i
  done
)

# Remove not UTF-8 manpages
for i in pl.ISO8859-2 it.ISO8859-1 ru.KOI8-R fr.ISO8859-1; 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; do
  rm -rf %{buildroot}/%{_mandir}/$i
done

for i in rvim.1 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
mkdir -p %{buildroot}/%{_mandir}/man5
for i in virc.5 vimrc.5; do
  echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man5/$i
done
touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags
%endif

#%check
# vim does quite an extensive test relying on a full fledged terminal
# inside OBS, stdio is redirected to a serial console (where the build log
# is being recorded/extracted. Systemd set non-local tty by default to vt220
# in upcoming versions
#export TERM=linux
# Reset the terminal scrolling region left behind by the testsuite
#trap "printf '\e[r'" EXIT
# Look for "TEST FAILURE" in the build log
#make test

%if 0%{?suse_version}
%post -n gvim
%icon_theme_cache_post

%postun -n gvim
%icon_theme_cache_postun
%else
%post X11
touch --no-create %{_datadir}/icons/hicolor
if [ -x /%{_bindir}/gtk-update-icon-cache ]; then
  gtk-update-icon-cache --ignore-theme-index -q %{_datadir}/icons/hicolor
fi
update-desktop-database &> /dev/null ||:

%postun X11
touch --no-create %{_datadir}/icons/hicolor
if [ -x /%{_bindir}/gtk-update-icon-cache ]; then
  gtk-update-icon-cache --ignore-theme-index -q %{_datadir}/icons/hicolor
fi
update-desktop-database &> /dev/null ||:

# Refresh documentation helptags
%transfiletriggerin common -- %{_datadir}/%{name}/vimfiles/doc
vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null

%transfiletriggerpostun common -- %{_datadir}/%{name}/vimfiles/doc
> %{_datadir}/%{name}/vimfiles/doc/tags
vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null
%endif

%if 0%{?suse_version}
%files
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/vimrc
# symlinks
/bin/vi
/bin/vim
/bin/ex
%{_bindir}/edit
%{_bindir}/ex
%{_bindir}/rview
%{_bindir}/rvim
%{_bindir}/vi
%{_bindir}/vim
%{_bindir}/view
%{_bindir}/vimdiff
# additional binaries
%{_bindir}/vitmp
%{_bindir}/vimtutor
%{_bindir}/gvimtutor
%{_bindir}/xxd
# man pages
%{_mandir}/man1/*
%dir %{_mandir}/fr
%dir %{_mandir}/fr/man1/
%{_mandir}/fr/man1/*
%dir %{_mandir}/it
%dir %{_mandir}/it/man1/
%{_mandir}/it/man1/*
%dir %{_mandir}/ru
%dir %{_mandir}/ru/man1/
%{_mandir}/ru/man1/*
%dir %{_mandir}/pl
%dir %{_mandir}/pl/man1/
%{_mandir}/pl/man1/*
%dir %{_mandir}/ja
%dir %{_mandir}/ja/man1/
%{_mandir}/ja/man1/*
# docs and data file
%doc %{_docdir}/vim
#
%{_datadir}/vim/current
%dir %{_datadir}/vim/
%dir %{_datadir}/vim/%vimdir/
%dir %{_datadir}/vim/%vimdir/autoload/
%dir %{_datadir}/vim/%vimdir/colors/
%dir %{_datadir}/vim/%vimdir/compiler/
%dir %{_datadir}/vim/%vimdir/doc/
%dir %{_datadir}/vim/%vimdir/ftplugin/
%dir %{_datadir}/vim/%vimdir/indent/
%dir %{_datadir}/vim/%vimdir/keymap/
%dir %{_datadir}/vim/%vimdir/lang/
%dir %{_datadir}/vim/%vimdir/macros/
%dir %{_datadir}/vim/%vimdir/pack/
%dir %{_datadir}/vim/%vimdir/plugin/
%dir %{_datadir}/vim/%vimdir/print/
%dir %{_datadir}/vim/%vimdir/spell/
%dir %{_datadir}/vim/%vimdir/syntax/
%dir %{_datadir}/vim/%vimdir/tools/
%dir %{_datadir}/vim/%vimdir/tutor/
%dir %{_datadir}/vim/%vimdir/skeletons/
%dir %{site_runtimepath}
%dir %{site_runtimepath}/autoload/
%dir %{site_runtimepath}/colors/
%dir %{site_runtimepath}/doc/
%dir %{site_runtimepath}/plugin/
%dir %{site_runtimepath}/syntax/
%dir %{site_runtimepath}/ftdetect/
%dir %{site_runtimepath}/after/
%dir %{site_runtimepath}/after/syntax/
#
%{_datadir}/vim/%vimdir/bugreport.vim
%{_datadir}/vim/%vimdir/defaults.vim
%{_datadir}/vim/%vimdir/evim.vim
%{_datadir}/vim/%vimdir/filetype.vim
%{_datadir}/vim/%vimdir/ftoff.vim
%{_datadir}/vim/%vimdir/ftplugin.vim
%{_datadir}/vim/%vimdir/ftplugof.vim
%{_datadir}/vim/%vimdir/indent.vim
%{_datadir}/vim/%vimdir/indoff.vim
%{_datadir}/vim/%vimdir/optwin.vim
%{_datadir}/vim/%vimdir/rgb.txt
%{_datadir}/vim/%vimdir/scripts.vim
%{_datadir}/vim/%vimdir/syntax/syntax.vim
%{_datadir}/vim/%vimdir/skeletons/skeleton.spec
# stupid helper
# THIS BREAKS THE BUILD: %{_datadir}/vim/current/tools/missing-vim-client
%{_datadir}/vim/%vimdir/tools/missing-vim-client

%files data
%defattr(-,root,root,-)
# data files
%{_datadir}/vim/%vimdir/autoload/*
%{_datadir}/vim/%vimdir/colors/*
%{_datadir}/vim/%vimdir/compiler/*
%{_datadir}/vim/%vimdir/doc/*
%{_datadir}/vim/%vimdir/ftplugin/*
%{_datadir}/vim/%vimdir/indent/*
%{_datadir}/vim/%vimdir/keymap/*
%{_datadir}/vim/%vimdir/lang/*
%{_datadir}/vim/%vimdir/macros/*
%{_datadir}/vim/%vimdir/pack/*
%{_datadir}/vim/%vimdir/plugin/*
%{_datadir}/vim/%vimdir/print/*
%{_datadir}/vim/%vimdir/spell/*
%{_datadir}/vim/%vimdir/syntax/*
%exclude %{_datadir}/vim/%vimdir/syntax/syntax.vim
#%{_datadir}/vim/%vimdir/tools/blink.c
%{_datadir}/vim/%vimdir/tools/ccfilter.1
#%{_datadir}/vim/%vimdir/tools/ccfilter.c
%{_datadir}/vim/%vimdir/tools/ccfilter_README.txt
%{_datadir}/vim/%vimdir/tools/efm_filter.pl
%{_datadir}/vim/%vimdir/tools/efm_filter.txt
%{_datadir}/vim/%vimdir/tools/efm_perl.pl
%{_datadir}/vim/%vimdir/tools/mve.awk
%{_datadir}/vim/%vimdir/tools/mve.txt
%{_datadir}/vim/%vimdir/tools/pltags.pl
%{_datadir}/vim/%vimdir/tools/README.txt
%{_datadir}/vim/%vimdir/tools/ref
%{_datadir}/vim/%vimdir/tools/shtags.1
%{_datadir}/vim/%vimdir/tools/shtags.pl
%{_datadir}/vim/%vimdir/tools/unicode.vim
%{_datadir}/vim/%vimdir/tools/vim132
%{_datadir}/vim/%vimdir/tools/vimm
%{_datadir}/vim/%vimdir/tools/vimspell.sh
%{_datadir}/vim/%vimdir/tools/vimspell.txt
%{_datadir}/vim/%vimdir/tools/vim_vs_net.cmd
#%{_datadir}/vim/%vimdir/tools/xcmdsrv_client.c
%{_datadir}/vim/%vimdir/tutor/*
%{_datadir}/vim/%vimdir/delmenu.vim
%{_datadir}/vim/%vimdir/gvimrc_example.vim
%{_datadir}/vim/%vimdir/menu.vim
%{_datadir}/vim/%vimdir/mswin.vim
%{_datadir}/vim/%vimdir/synmenu.vim
%{_datadir}/vim/%vimdir/vimrc_example.vim

%files -n gvim
%defattr(-,root,root,-)
%doc runtime/doc/gui_x11.txt
%ghost %config(missingok) %{_sysconfdir}/gvimrc
%{_bindir}/egview
%{_bindir}/egvim
%{_bindir}/eview
%{_bindir}/evim
%{_bindir}/gex
%{_bindir}/gvi
%{_bindir}/gview
%{_bindir}/gvim
%{_bindir}/gvimdiff
%{_bindir}/rgview
%{_bindir}/rgvim
# menu icon
%{_datadir}/applications/gvim.desktop
%{_datadir}/icons/hicolor/*/apps/gvim.*
%doc %{_docdir}/gvim
%else
%files common
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/vimrc
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README*
%doc runtime/docs
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/vimfiles/template.spec
%dir %{_datadir}/%{name}/%{vimdir}
%{_datadir}/%{name}/%{vimdir}/rgb.txt
%{_datadir}/%{name}/%{vimdir}/autoload
%{_datadir}/%{name}/%{vimdir}/colors
%{_datadir}/%{name}/%{vimdir}/compiler
%{_datadir}/%{name}/%{vimdir}/pack
%{_datadir}/%{name}/%{vimdir}/doc
%{_datadir}/%{name}/%{vimdir}/*.vim
%{_datadir}/%{name}/%{vimdir}/ftplugin
%{_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
%{_datadir}/%{name}/%{vimdir}/spell
%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(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(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(sv) %{_datadir}/%{name}/%{vimdir}/lang/sv
%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/ex.*
%{_mandir}/man1/gex.*
%{_mandir}/man1/gview.*
%{_mandir}/man1/gvim*
%{_mandir}/man1/rvi.*
%{_mandir}/man1/rview.*
%{_mandir}/man1/rvim.*
%{_mandir}/man1/vi.*
%{_mandir}/man1/view.*
%{_mandir}/man1/vim.*
%{_mandir}/man1/vimdiff.*
%{_mandir}/man1/vimtutor.*
%{_mandir}/man1/vimx.*
%{_mandir}/man1/xxd.*
%{_mandir}/man5/vimrc.*
%lang(fr) %{_mandir}/fr/man1/*
%lang(it) %{_mandir}/it/man1/*
%lang(ja) %{_mandir}/ja/man1/*
%lang(pl) %{_mandir}/pl/man1/*
%lang(ru) %{_mandir}/ru/man1/*

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

%files enhanced
%defattr(-,root,root)
%{_bindir}/vim
%{_bindir}/rvim
%{_bindir}/vimdiff
%{_bindir}/vimtutor
%config(noreplace) %{_sysconfdir}/profile.d/vim.*

%files filesystem
%defattr(-,root,root)
%{_rpmconfigdir}/macros.d/macros.vim
%dir %{_libdir}/%{name}
%dir %{_datadir}/%{name}/vimfiles
%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}/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

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

%changelog