Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37744707
en ru br
Репозитории ALT
S:9.0.1893-alt1
5.1: 7.2.262-alt1
4.1: 7.2.026-alt0.M41.1
4.0: 7.1.315-alt0.M40.1
+updates:7.1.315-alt0.M40.1
3.0: 6.3.086-alt1
www.altlinux.org/Changes

Группа :: Редакторы
Пакет: vim

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

# vim: set ft=spec: -*- rpm-spec -*-
# vim600: set fdm=marker:
# $Id: vim,v 1.66 2005/07/30 11:29:35 raorn Exp $

# {{{ Perl/Python/Ruby/Tcl/MzScheme support

%def_enable perlinterp
%def_enable pythoninterp
%def_enable rubyinterp
%def_enable tclinterp
%def_disable mzschemeinterp
# }}}
# {{{ enable/disable logic
%def_enable gpm

%def_enable gui_athena
%def_enable gui_gtk
%def_enable gui_gtk2
%def_enable gui_motif
%def_enable gui_neXtaw

%global gui %nil
%if_enabled gui_athena
%global gui %gui athena
%endif
%if_enabled gui_gtk
%global gui %gui gtk
%endif
%if_enabled gui_gtk2
%global gui %gui gtk2
%endif
%if_enabled gui_motif
%global gui %gui motif
%endif
%if_enabled gui_neXtaw
%global gui %gui neXtaw
%endif

%if "%gui" != "%nil"
%def_enable gui_any
%endif
# }}}

Name: vim
%define major 6
%define minor 3
#define pre b
%define mainver %major.%minor
%define patchlevel 086
%define buildlevel 1

%define mzvim_version 0.560

Version: %major.%minor%{?patchlevel:%{?pre:.0}.%patchlevel}
Release: alt%{?pre:0.%buildlevel.%pre}%{!?pre:%buildlevel}
Serial: 4
Packager: Vim Development Team <vim at packages.altlinux.org>

%define builddir vim%major%minor%{?pre:%pre}

Summary: VIsual editor iMproved
License: Charityware
Group: Editors
Url: http://www.vim.org

%add_findreq_skiplist %_datadir/vim/*

# Avoid rpm -rf $DOCDIR...

%define _customdocdir %_defaultdocdir/%name-common-%version

# {{{ RPM macros

%define _update_vimhelp_bin %_bindir/update-vimhelp
%define update_vimhelp [ "$1" = 1 -a -x %_update_vimhelp_bin ] && %_update_vimhelp_bin ||:
%define clean_vimhelp [ -x %_update_vimhelp_bin ] && %_update_vimhelp_bin ||:

%define vim_runtime_dir %_datadir/vim/vimfiles
# }}}

# {{{ Sources

Source0: ftp://ftp.vim.org/pub/vim%{?pre:/unstable}/unix/%name-%mainver%{?pre:%pre}.tar.bz2
Source1: ftp://ftp.vim.org/pub/vim%{?pre:/unstable}/extra/%name-%mainver%{?pre:%pre}-lang.tar.gz
Source2: ftp://ftp.vim.org/pub/vim%{?pre:/unstable}/extra/%name-%mainver%{?pre:%pre}-extra.tar.gz
Source3: %name-%mainver-langmap.tar.bz2
Source4: %name-%mainver-langrc.tar.bz2
%ifdef patchlevel
Source5: %name-%mainver%{?pre:%pre}-official-patches-%patchlevel.tar.bz2
%endif
Source6: gvim.menu
Source7: %name-%mainver-system.vimrc
Source8: %name-%mainver-system.gvimrc

Source9: vim-console.alternatives
Source10: vim-enhanced.alternatives
Source11: vim-X11.alternatives

Source12: vim-X11-athena.alternatives
Source13: vim-X11-gtk.alternatives
Source14: vim-X11-gtk2.alternatives
Source15: vim-X11-motif.alternatives
Source16: vim-X11-neXtaw.alternatives

Source17: README.ALT-ru_RU.KOI8-R

%ifdef mzvim_version
# Thanx to ott...
Source18: http://iamphet.nm.ru/scheme/mzvim-%mzvim_version.tar.gz
%endif

# Thanx to wrar...

Source19: http://www.geocities.com/yegappan/vim_faq_help.txt
# }}}

# {{{ Patches

Patch1: vimrc_hebrew.patch
Patch2: vim_vimrc.patch
Patch3: vim_gvimrc.patch
Patch4: vim-6.2-alt-perl56.patch
Patch5: vim-6.3-alt-spec-syntax.patch
Patch6: vim-6.0af-man-path.patch
Patch7: vim-6.0-Makefile.patch
Patch8: vim-6.0-langfont.patch
Patch9: vim6.1-alt-tmpdir.patch
Patch10: vim-6.3-alt-mutt-tempfile-filetype.patch
Patch11: vim-6.3-alt-vimfaq.patch
# }}}

# {{{ Patches for plugins

#Patch20: vim-6.3-alt-plug-std_c.patch
# }}}

# {{{ BuildRequires

# Automatically added by buildreq on Mon Apr 28 2003 and filtered by raorn
# Common requires
BuildPreReq: iconv
BuildPreReq: libacl-devel
BuildPreReq: alternatives >= 0.2.0-alt0.7
BuildPreReq: libattr-devel
%if_enabled gpm
BuildPreReq: libgpm-devel
%endif
BuildPreReq: libtinfo-devel
BuildPreReq: unzip
# man commandline check
BuildPreReq: man
# ctags commandline check
BuildPreReq: ctags
%if_enabled gui_any
BuildPreReq: XFree86-devel
BuildPreReq: xpm-devel
%endif
# gtk+
%if_enabled gui_gtk
BuildPreReq: glib-devel
BuildPreReq: gtk+-devel
%endif
# gtk+2
%if_enabled gui_gtk2
BuildPreReq: glib2-devel
BuildPreReq: libatk-devel
BuildPreReq: libgtk+2-devel
BuildPreReq: libpango-devel
BuildPreReq: pkgconfig
%endif
# motif
%if_enabled gui_motif
BuildPreReq: openmotif-devel
%endif
# neXtaw
%if_enabled gui_neXtaw
BuildPreReq: libneXtaw-devel
%endif
# Perl
%if_enabled perlinterp
BuildPreReq: perl-devel
%endif
# Python
%if_enabled pythoninterp
BuildPreReq: python-devel = %__python_version
%endif
# Ruby
%if_enabled rubyinterp
BuildPreReq: libruby-devel >= 1.8
BuildPreReq: ruby >= 1.8
%endif
# Tcl
%if_enabled tclinterp
BuildPreReq: tcl-devel
%endif
%if_enabled mzschemeinterp
BuildPreReq: plt2
%endif
# }}}

# {{{ Description

%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.  The vim-common package
contains files which every VIM binary will need in order to run.
# }}}

# {{{ vim-common

%package common
Summary: The common files needed by any version of the VIM editor
Group: Editors
PreReq: coreutils
PreReq: vim
PreReq: %_bindir/vim
Requires: mktemp >= 1:1.3.1
Conflicts: vim-minimal < %serial:%version-%release
Conflicts: vim-minimal > %serial:%version-%release

%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 any version of the VIM editor, you'll also need to
the vim-common package installed.
# }}}
# {{{ vim-minimal
%package minimal
Summary: A minimal version of the VIM editor
Group: Editors
PreReq: coreutils
Provides: vi = %serial:%version-%release
Provides: /bin/vi

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

Just install it because you'll need it.
# }}}
# {{{ vim-console
%package console
Summary: A terminal-based, full-featured version of the VIM editor
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.2.0-alt0.7
Requires: vim-common = %serial:%version-%release
Provides: vim = %serial:%version-%release
Provides: %_bindir/vim
Obsoletes: vim-color

%description console
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-console package
contains a version of VIM with extra, recently introduced features like
Python and Perl interpreters.

Install the vim-console package if you'd like to use a full-featured
VIM, but you don't use X11 or don't want to use GUI version of VIM nor want
to use perl/python/ruby/tcl interface.  You'll also need to install the
vim-common package.
# }}}
# {{{ vim-enhanced
%package enhanced
Summary: A terminal-based, full-featured version of the VIM editor
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.2.0-alt0.7
Requires: vim-common = %serial:%version-%release
Provides: vim = %serial:%version-%release
Provides: %_bindir/vim
Obsoletes: vim-color

%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 full-featured
VIM, but you don't use X11 or don't want to use GUI version of VIM.
You'll also need to install the vim-common package.
# }}}
# {{{ vim-X11
%if_enabled gui_any
%package X11
Summary: A full version of VIM editor, including GUI for the X Window System
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.2.0-alt0.7
PreReq: vim-X11-gui
Requires: vim-common = %serial:%version-%release
Provides: vim = %serial:%version-%release
Provides: %_bindir/vim
Obsoletes: vim-color

%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 full version of the VIM editor, including the GUI. You can run it
either in terminal or within the X Window System. This package supersedes
vim-ehnanced package.

Install the vim-X11 package if you'd like to use a full-featured VIM with both
terminal and X11 interface.  You'll also need to install the vim-common
package.
%endif
# }}}
# {{{ vim-X11-athena
%if_enabled gui_athena
%package X11-athena
Summary: A full version of VIM editor, including Xaw GUI for the X Window System
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.2.0-alt0.7
Requires: vim-X11 = %serial:%version-%release
Provides: vim-X11-gui = %serial:%version-%release
Provides: %_bindir/vim-X11
Obsoletes: vim-color

%description X11-athena
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 full version of the VIM editor, including the GUI. You can run it
either in terminal or within the X Window System. This package supersedes
vim-ehnanced package.

Install the vim-X11 package if you'd like to use a full-featured VIM with both
terminal and X11 Xaw interface.  You'll also need to install the vim-X11
package.
%endif
# }}}
# {{{ vim-X11-gtk
%if_enabled gui_gtk
%package X11-gtk
Summary: A full version of VIM editor, including gtk+ GUI for the X Window System
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.2.0-alt0.7
Requires: gtk+ >= 1.2.3
Requires: vim-X11 = %serial:%version-%release
Provides: vim-X11-gui = %serial:%version-%release
Provides: %_bindir/vim-X11
Obsoletes: vim-color

%description X11-gtk
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 full version of the VIM editor, including the GUI. You can run it
either in terminal or within the X Window System. This package supersedes
vim-ehnanced package.

Install the vim-X11 package if you'd like to use a full-featured VIM with both
terminal and X11 gtk+ interface.  You'll also need to install the vim-X11
package.
%endif
# }}}
# {{{ vim-X11-gtk2
%if_enabled gui_gtk2
%package X11-gtk2
Summary: A full version of VIM editor, including gtk+2 GUI for the X Window System
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.2.0-alt0.7
Requires: libgtk+2 >= 2.0
Requires: vim-X11 = %serial:%version-%release
Provides: vim-X11-gui = %serial:%version-%release
Provides: %_bindir/vim-X11
Obsoletes: vim-color

%description X11-gtk2
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 full version of the VIM editor, including the GUI. You can run it
either in terminal or within the X Window System. This package supersedes
vim-ehnanced package.

Install the vim-X11 package if you'd like to use a full-featured VIM with both
terminal and X11 gtk+2 interface.  You'll also need to install the vim-X11
package.
%endif
# }}}
# {{{ vim-X11-motif
%if_enabled gui_motif
%package X11-motif
Summary: A full version of VIM editor, including Motif GUI for the X Window System
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.2.0-alt0.7
Requires: vim-X11 = %serial:%version-%release
Provides: vim-X11-gui = %serial:%version-%release
Provides: %_bindir/vim-X11
Obsoletes: vim-color

%description X11-motif
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 full version of the VIM editor, including the GUI. You can run it
either in terminal or within the X Window System. This package supersedes
vim-ehnanced package.

Install the vim-X11 package if you'd like to use a full-featured VIM with both
terminal and X11 Motif interface.  You'll also need to install the vim-X11
package.
%endif
# }}}
# {{{ vim-X11-neXtaw
%if_enabled gui_neXtaw
%package X11-neXtaw
Summary: A full version of VIM editor, including neXtaw GUI for the X Window System
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.2.0-alt0.7
Requires: vim-X11 = %serial:%version-%release
Provides: vim-X11-gui = %serial:%version-%release
Provides: %_bindir/vim-X11
Obsoletes: vim-color

%description X11-neXtaw
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 full version of the VIM editor, including the GUI. You can run it
either in terminal or within the X Window System. This package supersedes
vim-ehnanced package.

Install the vim-X11 package if you'd like to use a full-featured VIM with both
terminal and X11 neXtaw interface.  You'll also need to install the vim-X11
package.
%endif
# }}}
# {{{ vim-devel
%package devel
Summary: RPM macros needed to build additional VIM plugin packages
Group: Development/Other
Requires: vim-common = %serial:%version-%release
PreReq: /etc/rpm/macros.d

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

This package contains RPM macros needed to build additional VIM plugin
packages.
# }}}

# {{{ prep section

%prep
%setup -q -b1 -b2 -a3 -a4 %{?patchlevel:-a5} %{?mzvim_version:-a 18} -n %builddir
%ifdef patchlevel
(for i in official-patches/%{mainver}%{?pre:%pre}.*; do
  %__patch -p0 <$i || exit 1
done)
%endif

%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1

# VIm FAQ

%__install -p -m644 %SOURCE19 runtime/doc/vim_faq.txt
%patch11 -p1

# {{{ MzScheme support

%ifdef mzvim_version
%__patch -p0 < mzvim
%if_enabled mzschemeinterp
%__mv mzvim.README README_mzscheme.txt
%endif
%endif
# }}}

# Load (g)vimrc file(s) from %_sysconfdir

%__subst 's|^.*#define[[:blank:]]\+SYS_VIMRC_FILE[[:blank:]]\+.*$|#define SYS_VIMRC_FILE "%_sysconfdir/vim/vimrc"|' src/feature.h
%__subst 's|^.*#define[[:blank:]]\+SYS_GVIMRC_FILE[[:blank:]]\+.*$|#define SYS_GVIMRC_FILE "%_sysconfdir/vim/gvimrc"|' src/feature.h
# drop tcl search madness
%__subst 's|\(^.\+tclloc=\).\+$|\1%prefix|' src/auto/configure
# Fix Ruby 1.8 compatibility issue -- already applied to VIM CVS (patch 6.2.066)
#__subst 's|rb_defout|rb_stdout|' src/if_ruby.c
# Fix libpython search path
%__subst 's|vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"|vi_cv_path_python_plibs="-lpython${vi_cv_var_python_version}"|' src/auto/configure

# {{{2 features

# +xterm_save
%__subst 's|^.*#define[[:blank:]]\+FEAT_XTERM_SAVE[[:blank:]]\+.*$|#define FEAT_XTERM_SAVE 1|' src/feature.h
# 2}}}

%__cp -p %SOURCE17 .
# }}}
# {{{ build section
%build
PLTHOME=%_libdir/plt2; export PLTHOME
# minimal
%configure \
--exec-prefix=/ \
--with-features=tiny \
--with-x=no \
--enable-gui=no \
--disable-gpm \
--with-tlib=tinfo \
--with-compiledby="%packager" \
#

%make_build -C src clean
%make_build -C src
%__mv src/vim vim-minimal

common_opts="--with-features=huge \
--enable-cscope \
%{subst_enable gpm} \
--with-global-runtime=%vim_runtime_dir \
--with-tlib=tinfo"

interp_opts="%{subst_enable perlinterp} \
%{subst_enable pythoninterp} \
%{subst_enable rubyinterp} \
%{subst_enable tclinterp} \
%{subst_enable mzschemeinterp}"

# full without GUI and interpreters

#make_build -C src clean
%configure \
$common_opts \
--disable-perlinterp \
--disable-pythoninterp \
--disable-rubyinterp \
--disable-tclinterp \
--disable-mzschemeinterp \
--with-x=no \
--enable-gui=no \
--with-compiledby="%packager" \
#
%make_build -C src clean
%make_build -C src
%__mv src/vim vim-console

# full without GUI

#make_build -C src clean
%configure \
$common_opts \
$interp_opts \
--with-x=no \
--enable-gui=no \
--with-compiledby="%packager" \
#
%make_build -C src clean
%make_build -C src
%__mv src/vim vim-enhanced

%if_enabled gui_any
# full version with GUI
for gui in %{gui}; do
#make_build -C src clean
%configure \
$common_opts \
$interp_opts \
--with-x=yes \
--enable-gui=$gui \
--enable-multibyte \
--enable-xim \
--enable-fontset \
--enable-xsmp \
--with-compiledby="%packager" \
#
%make_build -C src clean
%make_build -C src
%__mv src/vim vim-$gui
done
%endif
# }}}
# {{{ install section
%install
%__mkdir_p %buildroot{%_altdir,%_sysconfdir/{vim,rpm/macros.d},/bin,%_bindir,%_man1dir,%_datadir/vim/bitmaps,%_datadir/vim/ftdetect,%_datadir/vim/langmap,%_datadir/vim/langrc,%_customdocdir}
# {{{2 make install
%make_install install DESTDIR=%buildroot -C src

# Where is our baby?..

%__rm -f %buildroot%_bindir/vim

# Install the minimal version into the /bin

%__install -p -m755 vim-minimal %buildroot/bin/vi
%strip_executable -p -g %buildroot/bin/vi

# ... Here it is!

for ui in console enhanced %{gui}; do
%__install -p -m755 "vim-$ui" "%buildroot%_bindir/vim-$ui"
%strip_executable -p -g "%buildroot%_bindir/vim-$ui"
done
# 2}}}
# {{{2 Set up links for minimal and gui versions
for i in ex rvi rview ; do
%__ln_s -f vi "%buildroot/bin/$i"
done

%if_enabled gui_any
for i in evim eview gview gvim gvimdiff rgview rgvim ; do
%__ln_s -f vim-X11 "%buildroot%_bindir/$i"
done
%endif

%__ln_s -f vim.1 %buildroot%_man1dir/vi.1                                                                                                            
%__ln_s -f vim.1 %buildroot%_man1dir/rvi.1                                                                                                            
# 2}}}
# {{{2 Install documentation
#__mv -f %buildroot%_datadir/vim/doc %buildroot%_customdocdir
#__ln_s -f ../doc/%name-common-%version/doc %buildroot%_datadir/vim
%__ln_s -f ../../vim/doc %buildroot%_customdocdir/doc
# 2}}}

%__install -p -m644 %SOURCE7 %buildroot%_sysconfdir/vim/vimrc
%__install -p -m644 %SOURCE8 %buildroot%_sysconfdir/vim/gvimrc
%__install -p -m644 vimrc_hebrew %buildroot%_datadir/vim

pushd %buildroot%_datadir/vim/tools
   # i need to make a choice :(.
   %__subst 's|#!/usr/bin/nawk|#!/usr/bin/gawk|' mve.awk
   %__subst 's,#!/bin/csh.*.*,#!/bin/sh,' vim132
   %__chmod a-x vimspell* ref*
popd

# {{{2 post-install cleanup

find %buildroot%_datadir/vim \( -name '*.info' -o -name 'README.txt' \) -print0 |
xargs -r0 %__rm -f --

for i in colors compiler ftplugin indent keymap lang macros plugin syntax tools; do
   %__cp -f runtime/$i/README.txt README_$i.txt
done
# 2}}}

# {{{2 Create RPM macros and runtime dirs in buildroot

%__mkdir_p %buildroot%vim_runtime_dir
%__cat <<EOF >%buildroot%_sysconfdir/rpm/macros.d/vim
# Global runtime
%%vim_dir %%_datadir/vim
%%vim_runtime_dir %%vim_dir/vimfiles

# Additional dirs in global runtime

EOF
for d in after bitmaps colors compiler doc ftdetect ftplugin indent keymap lang plugin print syntax ; do
   %__mkdir_p %buildroot%vim_runtime_dir/$d
   %__cat <<EOF >>%buildroot%_sysconfdir/rpm/macros.d/vim
%%vim_${d}_dir %%vim_runtime_dir/$d
EOF
done
%__cat <<EOF >>%buildroot%_sysconfdir/rpm/macros.d/vim

# "after" dirs in global runtime

EOF
for d in compiler ftplugin indent plugin syntax ; do
   %__mkdir_p %buildroot%vim_runtime_dir/after/$d
   %__cat <<EOF >>%buildroot%_sysconfdir/rpm/macros.d/vim
%%vim_after_${d}_dir %%vim_after_dir/$d
EOF
done
%__cat <<EOF >>%buildroot%_sysconfdir/rpm/macros.d/vim

%%vim_script_url() http://www.vim.org/scripts/script.php?script_id=%%1%%nil

# post-install commands

%%_update_vimhelp_bin %%_bindir/update-vimhelp
%%update_vimhelp [ "\$1" = 1 -a -x %%_update_vimhelp_bin ] && %%_update_vimhelp_bin ||:
%%clean_vimhelp [ -x %%_update_vimhelp_bin ] && %%_update_vimhelp_bin ||:
EOF
# 2}}}
# {{{2 update-vimhelp script
%__cat <<EOF >%buildroot%_bindir/update-vimhelp
#! /bin/sh

VIM=%_bindir/vim
DOCDIR=

[ -x "\$VIM" ] || exit 1

if [ -n "\$1" ]; then
 if [ -d "\$1" -a -w "\$1" ]; then
   DOCDIR="\$1"
 fi
else
 if [ -d %vim_runtime_dir/doc -a -w %vim_runtime_dir/doc ]; then
   DOCDIR="%vim_runtime_dir/doc"
 elif [ -d "\$HOME/.vim/doc" -a -w "\$HOME/.vim/doc" ]; then
   DOCDIR="\$HOME/.vim/doc"
 fi
fi

[ -n "\$DOCDIR" ] || exit 1

echo ":helptags \$DOCDIR" | \$VIM -E -s -X -N -n -i NONE -u NONE -U NONE ||:
EOF

%__chmod 755 %buildroot%_bindir/update-vimhelp
# 2}}}
# {{{2 Install the three icons
%if_enabled gui_any
%__install -p -m644 -D runtime/vim16x16.xpm %buildroot%_miconsdir/gvim.xpm
%__install -p -m644 -D runtime/vim32x32.xpm %buildroot%_iconsdir/gvim.xpm
%__install -p -m644 -D runtime/vim48x48.xpm %buildroot%_liconsdir/gvim.xpm
%endif
# 2}}}
# {{{2 Install menu
%if_enabled gui_any
%__install -p -m644 -D %SOURCE6 %buildroot%_menudir/vim-X11
%endif
# 2}}}
# {{{2 Install alternatives files
%__install -p -m644 %SOURCE9  %buildroot%_altdir/vim-console
%__install -p -m644 %SOURCE10  %buildroot%_altdir/vim-enhanced
%if_enabled gui_any
%__install -p -m644 %SOURCE11 %buildroot%_altdir/vim-X11

%__install -p -m644 %SOURCE12 %buildroot%_altdir/vim-X11-athena
%__install -p -m644 %SOURCE13 %buildroot%_altdir/vim-X11-gtk
%__install -p -m644 %SOURCE14 %buildroot%_altdir/vim-X11-gtk2
%__install -p -m644 %SOURCE15 %buildroot%_altdir/vim-X11-motif
%__install -p -m644 %SOURCE16 %buildroot%_altdir/vim-X11-neXtaw
%endif
# 2}}}
# {{{2 Language-specific parts
%find_lang vim
%__install -p -m644 runtime/langrc/* %buildroot%_datadir/vim/langrc
%__install -p -m644 runtime/langmap/*.vim %buildroot%_datadir/vim/langmap
# 2}}}
# }}}

# {{{ triggers

%triggerpostun minimal -- vim-minimal < 6.0.118
[ $2 -gt 0 ] || exit 0
[ -e %_bindir/vi -a -h %_bindir/vi ] && %__rm -f %_bindir/vi ||:

%triggerpostun enhanced -- vim-enhanced < 3:6.1.82-alt7
%register_alternatives vim-enhanced -- vim

%if_enabled gui_any
%triggerpostun X11 -- vim-X11 < 3:6.1.82-alt7, vim-enhanced < 3:6.1.82-alt7
%register_alternatives vim-X11 -- vim
%update_menus

%triggerpostun X11 -- vim-X11 < 3:6.1.126-alt8
%register_alternatives vim-X11 -- vim

%triggerpostun X11 -- vim-common <= 4:6.2.021-alt2
%unregister_alternatives_always vim
%register_alternatives vim-X11 -- vim
%endif

%if_enabled gui_gtk
%triggerpostun X11-gtk -- vim-X11 <= 4:6.2.021-alt2
%register_alternatives vim-X11-gtk -- vim-X11
%endif

%if_enabled gui_gtk2
%triggerpostun X11-gtk2 -- vim-X11 <= 4:6.2.021-alt2
%register_alternatives vim-X11-gtk2 -- vim-X11
%endif

%if_enabled gui_motif
%triggerpostun X11-motif -- vim-X11 <= 4:6.2.021-alt2
%register_alternatives vim-X11-motif -- vim-X11
%endif

%if_enabled gui_athena
%triggerpostun X11-athena -- vim-X11 <= 4:6.2.021-alt2
%register_alternatives vim-X11-athena -- vim-X11
%endif

%if_enabled gui_neXtaw
%triggerpostun X11-neXtaw -- vim-X11 <= 4:6.2.021-alt2
%register_alternatives vim-X11-neXtaw -- vim-X11
%endif

%triggerpostun enhanced -- vim-common <= 4:6.2.021-alt2
%unregister_alternatives_always vim
%register_alternatives vim-enhanced -- vim

%triggerpostun common -- vim-common <= 4:6.2.135-alt2
%clean_vimhelp
# }}}
# {{{ pre/post install scripts
%pre common
if [ -L "%_datadir/vim/doc" ]; then
 d=$(realpath "%_datadir/vim/doc")
 %__rm -f -- "%_datadir/vim/doc"
 %__mv -f -- "$d" "%_datadir/vim/doc"
fi

%post common
%update_vimhelp

%postun common
%clean_vimhelp

# menus and alternatives

%post console
%register_alternatives vim-console -- vim

%preun console
%unregister_alternatives vim-console

%post enhanced
%register_alternatives vim-enhanced -- vim

%preun enhanced
%unregister_alternatives vim-enhanced

%if_enabled gui_any
%post X11
%update_menus
%register_alternatives vim-X11 -- vim

%preun X11
%clean_menus
%unregister_alternatives vim-X11
%endif

%if_enabled gui_gtk
%post X11-gtk
%register_alternatives vim-X11-gtk -- vim-X11

%preun X11-gtk
%unregister_alternatives vim-X11-gtk
%endif

%if_enabled gui_gtk2
%post X11-gtk2
%register_alternatives vim-X11-gtk2 -- vim-X11

%preun X11-gtk2
%unregister_alternatives vim-X11-gtk2
%endif

%if_enabled gui_motif
%post X11-motif
%register_alternatives vim-X11-motif -- vim-X11

%preun X11-motif
%unregister_alternatives vim-X11-motif
%endif

%if_enabled gui_athena
%post X11-athena
%register_alternatives vim-X11-athena -- vim-X11

%preun X11-athena
%unregister_alternatives vim-X11-athena
%endif

%if_enabled gui_neXtaw
%post X11-neXtaw
%register_alternatives vim-X11-neXtaw -- vim-X11

%preun X11-neXtaw
%unregister_alternatives vim-X11-neXtaw
%endif
# }}}

# {{{ vim-common files

%files common -f vim.lang
%doc README*.txt runtime/gvimrc_example.vim runtime/bugreport.vim
%doc runtime/menu.vim runtime/mswin.vim
%doc runtime/termcap runtime/tutor runtime/vimrc_example.vim vimrc_hebrew
%doc README.ALT-ru_RU.KOI8-R
#doc %_customdocdir/doc

%dir %_sysconfdir/vim
%config(noreplace) %_sysconfdir/vim/vimrc
%config(noreplace) %_sysconfdir/vim/gvimrc
%_datadir/vim
%_man1dir/*
%_bindir/ex
%_bindir/view
%_bindir/rvim
%_bindir/rview
%_bindir/vimdiff
%_bindir/vimtutor
%_bindir/xxd
%_bindir/update-vimhelp
# }}}
# {{{ vim-devel files
%files devel
%_sysconfdir/rpm/macros.d/vim
# }}}
# {{{ vim-minimal files
%files minimal
/bin/*
# }}}
# {{{ vim-console files
%files console
%_altdir/vim-console
%_bindir/vim-console
# }}}
# {{{ vim-enhanced files
%files enhanced
%_altdir/vim-enhanced
%_bindir/vim-enhanced
# }}}
# {{{ vim-X11 files
%if_enabled gui_any
%files X11
%_altdir/vim-X11
%_bindir/evim
%_bindir/eview
%_bindir/gvim
%_bindir/gview
%_bindir/gvimdiff
%_bindir/rgvim
%_bindir/rgview
%_iconsdir/*.xpm
%_iconsdir/*/*.xpm
%_menudir/vim-X11
%endif
# }}}
# {{{ vim-X11-athena files
%if_enabled gui_athena
%files X11-athena
%_altdir/vim-X11-athena
%_bindir/vim-athena
%endif
# }}}
# {{{ vim-X11-gtk files
%if_enabled gui_gtk
%files X11-gtk
%_altdir/vim-X11-gtk
%_bindir/vim-gtk
%endif
# }}}
# {{{ vim-X11-gtk2 files
%if_enabled gui_gtk2
%files X11-gtk2
%_altdir/vim-X11-gtk2
%_bindir/vim-gtk2
%endif
# }}}
# {{{ vim-X11-motif files
%if_enabled gui_motif
%files X11-motif
%_altdir/vim-X11-motif
%_bindir/vim-motif
%endif
# }}}
# {{{ vim-X11-neXtaw files
%if_enabled gui_neXtaw
%files X11-neXtaw
%_altdir/vim-X11-neXtaw
%_bindir/vim-neXtaw
%endif
# }}}

# {{{ changelog

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin