Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1493865
 поиск   регистрация   авторизация 
 
Группа :: Редакторы
Пакет: vim

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

# vim: set ft=spec: -*- rpm-spec -*-
# vim600: set fdm=marker:

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

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

%def_enable minimal

%def_enable devel

%def_enable gui_athena
%def_disable gui_gnome2
%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_gnome2
%global gui %gui gnome2
%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"
%force_enable gui_any
%endif
# }}}

Name: vim
%define oname vim
%define major 7
%define minor 0
# Note to self - don't use xYY pre without cvsdate
#define pre g
#define cvsdate 20060327
%define mainver %major.%minor
# Note to self - don't use patchlevel with pre
%define patchlevel 099
%define buildlevel 1

# vimspell interface version

%define vimspell_version 50.1

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

%define builddir %{!?cvsdate:%oname%major%minor%{?pre:%pre}}%{?cvsdate:%oname%major}

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

%add_findreq_skiplist %_datadir/vim/*

# Avoid rm -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

%ifndef cvsdate
Source0: ftp://ftp.vim.org/pub/vim%{?pre:/unstable}/unix/%oname-%mainver%{?pre:%pre}.tar.bz2
Source1: ftp://ftp.vim.org/pub/vim%{?pre:/unstable}/extra/%oname-%mainver%{?pre:%pre}-lang.tar.gz
Source2: ftp://ftp.vim.org/pub/vim%{?pre:/unstable}/extra/%oname-%mainver%{?pre:%pre}-extra.tar.gz
%else
Source0: %oname%major-%cvsdate.tar.bz2
%endif
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.desktop
Source7: %name-%mainver-system.vimrc
Source8: %name-%mainver-system.gvimrc

Source9: vim-enhanced.alternatives
Source10: vim-console.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: vim-X11-gnome2.alternatives

Source19: README.ALT-ru_RU.KOI8-R

# Thanx to wrar...

Source20: http://www.geocities.com/yegappan/vim_faq_help.txt

Source100: vim-7.0-alt-filetypes.vim
# }}}

# {{{ Patches

Patch: vim-7.0.097-20060910-runtime.diff

Patch1: vimrc_hebrew.patch
Patch2: vim-7.0-alt-spec-syntax.patch
Patch3: vim-6.0-Makefile.patch
Patch4: vim-7.0g-alt-vimfaq.patch
Patch5: vim-7.0-alt-localized-man-locations.patch
Patch6: vim-7.0-alt-early-ftdetect.patch
# }}}

# {{{ BuildRequires

# Automatically added by buildreq on Mon Apr 28 2003 and filtered by raorn
# Common requires
BuildPreReq: libalternatives-devel
BuildPreReq: iconv
BuildPreReq: libacl-devel
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
# Common X11
%if_enabled gui_any
BuildPreReq: XFree86-devel xpm-devel
BuildPreReq: menu-devel
%endif
# Athena
%if_enabled gui_athena
#BuildPreReq:
%endif
# GNOME2
%if_enabled gui_gnome2
# NOT TESTED!!!
#BuildPreReq: ORBit2-devel glib2-devel gnome-vfs2-devel libGConf2-devel libart_lgpl-devel libatk-devel libbonobo2-devel libbonoboui-devel libcairo-devel libgnome-devel libgnome-keyring-devel libgnomecanvas-devel libgnomeui-devel libgtk+2-devel libpango-devel libpopt-devel libxml2-devel pkgconfig zlib-devel
%endif
# gtk+
%if_enabled gui_gtk
BuildPreReq: glib-devel gtk+-devel pkgconfig
%endif
# gtk+2
%if_enabled gui_gtk2
BuildPreReq: glib2-devel gtk+-devel libatk-devel libgtk+2-devel libpango-devel 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
BuildConflicts: python-dev < 2.3.4-alt1
BuildConflicts: python-devel-static
%endif
# Ruby
%if_enabled rubyinterp
BuildPreReq: libruby-devel >= 1.8
BuildPreReq: ruby >= 1.8
%endif
# Tcl
%if_enabled tclinterp
BuildPreReq: tcl-devel >= 8.4.0-alt1
%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: %name
PreReq: %_bindir/vim
Requires: mktemp >= 1:1.3.1
Provides: vimspell-interface = %vimspell_version
%if_enabled minimal
Conflicts: %name-minimal < %serial:%version-%release
Conflicts: %name-minimal > %serial:%version-%release
%endif
%if %oname != %name
Conflicts: %oname-common < %serial:%version-%release
Conflicts: %oname-common > %serial:%version-%release
Provides: %oname-common = %serial:%version-%release
%endif
# Bundled plugins:
Provides: vim-plugin-netrw = 102.vim
Obsoletes: vim-plugin-netrw <= 102
Provides: vim-plugin-vimruby = 20060619.vim
Obsoletes: vim-plugin-vimruby <= 20060619
Provides: vim-plugin-vimball = 17.vim
Obsoletes: vim-plugin-vimball <= 17
Provides: vim-plugin-tar-ftplugin = 10.vim
Obsoletes: vim-plugin-tar-ftplugin <= 10
Provides: vim-plugin-zip-ftplugin = 11.vim
Obsoletes: vim-plugin-zip-ftplugin <= 11

%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.
# }}}
# {{{ vimtutor
%package -n vimtutor
Summary: VIM tutor
Group: Editors
PreReq: %name-common = %serial:%version-%release
Requires: %_bindir/vim

%description -n vimtutor
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 VIM tutor.
# }}}
# {{{ vim-spell
%package spell-source
Summary: vimspell dictionary sources
Group: Development/Other
Requires: %name-devel = %serial:%version-%release

%description spell-source
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 vimspell sources for building additional dictionaries.
# }}}
# {{{ 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-enhanced
%package enhanced
Summary: A terminal-based, full-featured version of the VIM editor
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.0.6
Requires: %name-common = %serial:%version-%release
Provides: %name = %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-console
%package console
Summary: A terminal-based, full-featured version of the VIM editor
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.0.6
Requires: %name-common = %serial:%version-%release
Provides: %name = %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-X11
%package X11
Summary: A full version of VIM editor, including GUI for the X Window System
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.0.6
PreReq: %name-X11-gui
Requires: %name-common = %serial:%version-%release
Provides: %name = %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.
# }}}
# {{{ vim-X11-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.0.6
Requires: %name-X11 = %serial:%version-%release
Provides: %name-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.
# }}}
# {{{ vim-X11-gnome2
%package X11-gnome2
Summary: A full version of VIM editor, including GNOME GUI for the X Window System
Group: Editors
PreReq: coreutils
PreReq: alternatives >= 0.0.6
Requires: %name-X11 = %serial:%version-%release
Provides: %name-X11-gui = %serial:%version-%release
Provides: %_bindir/vim-X11
Obsoletes: vim-color

%description X11-gnome2
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 GNOME interface.  You'll also need to install the vim-X11
package.
# }}}
# {{{ vim-X11-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.0.6
Requires: gtk+ >= 1.2.3
Requires: %name-X11 = %serial:%version-%release
Provides: %name-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.
# }}}
# {{{ vim-X11-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.0.6
Requires: libgtk+2 >= 2.0
Requires: %name-X11 = %serial:%version-%release
Provides: %name-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.
# }}}
# {{{ vim-X11-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.0.6
Requires: %name-X11 = %serial:%version-%release
Provides: %name-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.
# }}}
# {{{ vim-X11-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.0.6
Requires: %name-X11 = %serial:%version-%release
Provides: %name-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.
# }}}
# {{{ vim-devel
%package devel
Summary: RPM macros needed to build additional VIM plugin packages
Group: Development/Other
Conflicts: %name-common < %serial:%version-%release
Conflicts: %name-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 %{!?cvsdate:-b1 -b2} -a3 -a4 %{?patchlevel:-a5} -n %builddir
%ifdef patchlevel
pushd official-patches/
md5sum -c MD5SUMS
popd
for i in official-patches/%{mainver}%{?pre:%pre}.*; do
  %__patch -p0 <$i || exit 1
done
# Official runtime
%patch -p0
%endif

%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1

# VIm FAQ

%__install -p -m644 %SOURCE20 runtime/doc/vim_faq.txt

# 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
# Compressed documentation
#__subst 's|^.*#[[:blank:]]*define[[:blank:]]\+DFLT_HELPFILE[[:blank:]]\+.*$|#define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt.gz"|' src/feature.h

# {{{2 features

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

%__cp -p %SOURCE19 .

VIMSPELLVERSION=`grep '^[[:blank:]]*#define[[:blank:]]\+VIMSPELLVERSION[[:blank:]]\+[[:digit:]]\+[[:blank:]]*$' src/spell.c | sed -e 's/^[[:blank:]]*#define[[:blank:]]\+VIMSPELLVERSION[[:blank:]]\+\([[:digit:]]\+\)[[:blank:]]*$/\1/'`
VIMSUGVERSION=`grep '^[[:blank:]]*#define[[:blank:]]\+VIMSUGVERSION[[:blank:]]\+[[:digit:]]\+[[:blank:]]*$' src/spell.c | sed -e 's/^[[:blank:]]*#define[[:blank:]]\+VIMSUGVERSION[[:blank:]]\+\([[:digit:]]\+\)[[:blank:]]*$/\1/'`
if [ "$VIMSPELLVERSION.$VIMSUGVERSION" != "%vimspell_version" ]; then
 echo "FATAL: %%vimspell_version (%vimspell_version) does not match source ($VIMSPELLVERSION.$VIMSUGVERSION)"
 exit 1
fi
# }}}
# {{{ build section
%build
# SMP-incompatible
%define __nprocs 1
PLTHOME=%_libdir/plt2; export PLTHOME
QTDIR=%_libdir/qt3; export QTDIR
# {{{ minimal
%if_enabled minimal
%configure \
--exec-prefix=/ \
--with-features=tiny \
--with-x=no \
--enable-gui=no \
--disable-gpm \
--disable-rpath \
--with-tlib=tinfo \
--with-compiledby="%packager" \
#

%make_build -C src clean all
%__mv src/vim vim-minimal
%endif
# }}}

common_opts="--with-features=huge \
--disable-rpath \
--enable-cscope \
%{subst_enable gpm} \
--enable-multibyte \
--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

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

# {{{ full without GUI

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

# {{{ full version with GUI

%if_enabled gui_any
for gui in %{gui}; do
%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 all
%__mv src/vim "vim-$gui"
done
%endif
# }}}
# STFU make install
touch src/vim
# }}}
# {{{ install section
%install
%__mkdir_p %buildroot{%_altdir,%_sysconfdir/{vim,rpm/macros.d},/bin,%_bindir,%_man1dir,%_datadir/vim/{ftdetect,langmap,langrc},%_customdocdir,%_usrsrc/vimspell}
# {{{2 make install
%make_install install DESTDIR=%buildroot -C src
%__rm -rf %buildroot%_mandir/ru

# Where is our baby?..

%__rm -f %buildroot%_bindir/vim

%if_enabled minimal
# Install the minimal version into the /bin
%__install -p -m755 vim-minimal %buildroot/bin/vi
%strip_executable -p -g %buildroot/bin/vi
%endif

# ... 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
%if_enabled gui_any
for ui in %{gui}; do
%__ln_s "vim-$ui" "%buildroot%_bindir/gvim-$ui"
done
%endif
# 2}}}
# {{{2 Set up links for minimal and gui versions
%if_enabled minimal
for i in ex rvi rview ; do
%__ln_s -f vi "%buildroot/bin/$i"
done
%endif

%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

# 2}}}

# {{{2 Install documentation
%__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
# ALT-specific filetype
%__install -p -m644 %SOURCE100 %buildroot%_datadir/vim/ftdetect/00-altlinux.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 autoload colors compiler ftplugin indent keymap lang macros plugin spell syntax tools tutor; do
   %__cp -f runtime/$i/README.txt README_$i.txt
done
%__cp -f official-patches/README README_patches.txt
# 2}}}

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

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

# Spell files are in vim_dir

%%vim_spell_dir %%vim_dir/spell
%%vim_spell_source_dir %_usrsrc/vimspell
%%mkvimspell(L:a) %%{!-L:%%{!-a:%%{error:mkvimspell: neither language nor -a is specified} }}%%{-L:env LANG="%%{-L*}"} %_bindir/vim-console -E -X -N -n -i NONE -u NONE -U NONE -c 'mkspell! %%{-a:-ascii} %%*' -c q
# VIMSPELLVERSION.VIMSUGVERSION
%%vimspell_version %vimspell_version

%%vim_runtime_dir %%vim_dir/vimfiles
# Additional dirs in global runtime
EOF
%endif
for d in after autoload colors compiler doc ftdetect ftplugin indent keymap lang plugin print syntax ; do
   %__mkdir_p %buildroot%vim_runtime_dir/$d
%if_enabled devel
   %__cat <<EOF >>%buildroot%_sysconfdir/rpm/macros.d/vim
%%vim_${d}_dir %%vim_runtime_dir/$d
EOF
%endif
done
%if_enabled devel
%__cat <<EOF >>%buildroot%_sysconfdir/rpm/macros.d/vim

# "after" dirs in global runtime

EOF
%endif
for d in compiler ftplugin indent plugin syntax ; do
   %__mkdir_p %buildroot%vim_runtime_dir/after/$d
%if_enabled devel
   %__cat <<EOF >>%buildroot%_sysconfdir/rpm/macros.d/vim
%%vim_after_${d}_dir %%vim_after_dir/$d
EOF
%endif
done
%if_enabled devel
%__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
%endif
# 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 spell-source
%__cp -a runtime/spell/[a-z][a-z] %buildroot%_usrsrc/vimspell
%__cp -a runtime/spell/[a-z][a-z].vim %buildroot%_usrsrc/vimspell
%__cp -a runtime/spell/*.aap %buildroot%_usrsrc/vimspell
%__cp -a runtime/spell/fixdup %buildroot%_usrsrc/vimspell
# 2}}}
# {{{2 Install icons
%if_enabled gui_any
%__install -p -m644 -D runtime/vim16x16.png %buildroot%_miconsdir/gvim.png
%__install -p -m644 -D runtime/vim32x32.png %buildroot%_iconsdir/gvim.png
%__install -p -m644 -D runtime/vim48x48.png %buildroot%_liconsdir/gvim.png
%endif
# 2}}}
# {{{2 Install menu
%if_enabled gui_any
%__mkdir_p %buildroot%_menudir
%__install -p -m644 -D %SOURCE6 %buildroot%_datadir/applications/gvim.desktop
%Md2m \
%name-X11 \
"Applications/Editors" \
%buildroot%_datadir/applications/gvim.desktop \
%buildroot%_menudir/vim-X11
%endif
# 2}}}
# {{{2 Install alternatives files
%__install -p -m644 %SOURCE9  %buildroot%_altdir/vim-enhanced
%__install -p -m644 %SOURCE10  %buildroot%_altdir/vim-console
%if_enabled gui_any
%__install -p -m644 %SOURCE11 %buildroot%_altdir/vim-X11

%if_enabled gui_athena
%__install -p -m644 %SOURCE12 %buildroot%_altdir/vim-X11-athena
%endif
%if_enabled gui_gnome2
%__install -p -m644 %SOURCE17 %buildroot%_altdir/vim-X11-gnome2
%endif
%if_enabled gui_gtk
%__install -p -m644 %SOURCE13 %buildroot%_altdir/vim-X11-gtk
%endif
%if_enabled gui_gtk2
%__install -p -m644 %SOURCE14 %buildroot%_altdir/vim-X11-gtk2
%endif
%if_enabled gui_motif
%__install -p -m644 %SOURCE15 %buildroot%_altdir/vim-X11-motif
%endif
%if_enabled gui_neXtaw
%__install -p -m644 %SOURCE16 %buildroot%_altdir/vim-X11-neXtaw
%endif
%endif
# 2}}}
# {{{2 Language-specific parts
%__rm -f vim.lang
%find_lang --with-man --append --output vim.lang /vim /ex /rview /rvim /view /vimdiff /vimtutor /xxd
%__rm -f vim-X11.lang
%find_lang --with-man --append --output vim-X11.lang /evim /eview /gvim /gview /gvimdiff /rgvim /rgview
%__install -p -m644 runtime/langrc/* %buildroot%_datadir/vim/langrc
%__install -p -m644 runtime/langmap/*.vim %buildroot%_datadir/vim/langmap
# 2}}}
# }}}

# {{{ triggers

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

%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 enhanced
%register_alternatives vim-enhanced -- vim

%preun enhanced
%unregister_alternatives vim-enhanced

%post console
%register_alternatives vim-console -- vim

%preun console
%unregister_alternatives vim-console

%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_gnome2
%post X11-gnome2
%register_alternatives vim-X11-gnome2 -- vim-X11

%preun X11-gnome2
%unregister_alternatives vim-X11-gnome2
%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
# Note to self: NEVER try to use %%doc in subpackages
%doc README*.txt runtime/gvimrc_example.vim
%doc runtime/termcap runtime/vimrc_example.vim vimrc_hebrew
%doc README.ALT-ru_RU.KOI8-R

%dir %_sysconfdir/vim
%config(noreplace) %_sysconfdir/vim/vimrc
%config(noreplace) %_sysconfdir/vim/gvimrc
# {{{2 $VIMRUNTIME
%dir %_datadir/vim
%_datadir/vim/autoload
%_datadir/vim/colors
%_datadir/vim/compiler
%dir %_datadir/vim/doc
%doc %_datadir/vim/doc/*.txt
%doc %_datadir/vim/doc/tags
%_datadir/vim/ftdetect
%_datadir/vim/ftplugin
%_datadir/vim/indent
%_datadir/vim/keymap
%_datadir/vim/lang
%_datadir/vim/langmap
%_datadir/vim/langrc
%_datadir/vim/macros
%_datadir/vim/plugin
%_datadir/vim/print
%dir %_datadir/vim/spell
%_datadir/vim/spell/cleanadd.vim
%_datadir/vim/syntax
%_datadir/vim/tools
%_datadir/vim/vimfiles
%_datadir/vim/*.vim
%_datadir/vim/vimrc_hebrew
# 2}}}
%_bindir/ex
%_bindir/view
%_bindir/rvim
%_bindir/rview
%_bindir/vimdiff
%_bindir/xxd
%_bindir/update-vimhelp
%_man1dir/vim.1*
%_man1dir/ex.1*
%_man1dir/rview.1*
%_man1dir/rvim.1*
%_man1dir/view.1*
%_man1dir/vimdiff.1*
%_man1dir/vimtutor.1*
%_man1dir/xxd.1*
# }}}
# {{{ vimtutor
%files -n vimtutor
%_bindir/vimtutor
%_datadir/vim/tutor
# }}}
# {{{ vim-spell files
%files spell-source
%dir %_usrsrc/vimspell
%_usrsrc/vimspell/[a-z][a-z]
%_usrsrc/vimspell/[a-z][a-z].vim
%_usrsrc/vimspell/*.aap
%_usrsrc/vimspell/fixdup
# }}}
# {{{ vim-devel files
%if_enabled devel
%files devel
%_sysconfdir/rpm/macros.d/vim
%endif
# }}}
# {{{ vim-minimal files
%if_enabled minimal
%files minimal
/bin/*
%endif
# }}}
# {{{ 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 -f vim-X11.lang
%_altdir/vim-X11
%_bindir/evim
%_bindir/eview
%_bindir/gvim
%_bindir/gview
%_bindir/gvimdiff
%_bindir/rgvim
%_bindir/rgview
%_iconsdir/gvim.png
%_miconsdir/gvim.png
%_liconsdir/gvim.png
%_menudir/vim-X11
%_datadir/applications/gvim.desktop
%_man1dir/evim.1*
%_man1dir/eview.1*
%_man1dir/gvim.1*
%_man1dir/gview.1*
%_man1dir/gvimdiff.1*
%_man1dir/rgvim.1*
%_man1dir/rgview.1*
%endif
# }}}
# {{{ vim-X11-athena files
%if_enabled gui_athena
%files X11-athena
%_altdir/vim-X11-athena
%_bindir/vim-athena
%_bindir/gvim-athena
%endif
# }}}
# {{{ vim-X11-gnome2 files
%if_enabled gui_gnome2
%files X11-gnome2
%_altdir/vim-X11-gnome2
%_bindir/vim-gnome2
%_bindir/gvim-gnome2
%endif
# }}}
# {{{ vim-X11-gtk files
%if_enabled gui_gtk
%files X11-gtk
%_altdir/vim-X11-gtk
%_bindir/vim-gtk
%_bindir/gvim-gtk
%endif
# }}}
# {{{ vim-X11-gtk2 files
%if_enabled gui_gtk2
%files X11-gtk2
%_altdir/vim-X11-gtk2
%_bindir/vim-gtk2
%_bindir/gvim-gtk2
%endif
# }}}
# {{{ vim-X11-motif files
%if_enabled gui_motif
%files X11-motif
%_altdir/vim-X11-motif
%_bindir/vim-motif
%_bindir/gvim-motif
%endif
# }}}
# {{{ vim-X11-neXtaw files
%if_enabled gui_neXtaw
%files X11-neXtaw
%_altdir/vim-X11-neXtaw
%_bindir/vim-neXtaw
%_bindir/gvim-neXtaw
%endif
# }}}

# {{{ changelog

%changelog

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

 
design & coding: Vladimir Lettiev aka crux © 2004-2005