diff --git a/README.md b/README.md index 79e6633..72aade7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # vim +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. + diff --git a/vim-patches.sh b/vim-patches.sh new file mode 100644 index 0000000..f3319bf --- /dev/null +++ b/vim-patches.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# by Silvan Calarco + +VIM_VERSION=$1 + +if [ -z "$VIM_VERSION" ]; then + echo "Usage: $0 " + exit 2 +fi + +rm -rf vim-$VIM_VERSION +mkdir vim-$VIM_VERSION +cd vim-$VIM_VERSION +MAJVER=`echo $VIM_VERSION | cut -d. -f1-2` +wget ftp://ftp.vim.org/pub/vim/patches/$MAJVER/$MAJVER.* +tar -cz $MAJVER.* > ../vim-$VIM_VERSION-patchset.tar.gz +rm -rf vim-$VIM_VERSION diff --git a/vim.spec b/vim.spec new file mode 100644 index 0000000..0e0704e --- /dev/null +++ b/vim.spec @@ -0,0 +1,295 @@ +%define majversion %(echo %version | cut -d. -f 1-2) +## *AUTOSPEC-OFF* +%define vimdir %{name}%(majversion=%majversion; echo ${majversion/\./}) +## *AUTOSPEC-ON* +%define langversion 7.2 +%define with_gvim 0 + +Name: vim +Version: 7.4.258 +Release: 1mamba +Summary: VIsual editor iMproved +Group: Applications/Text +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.vim.org/ +Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{majversion}.tar.bz2 +#Source1: ftp://ftp.vim.org/pub/vim/extra/vim-%{langversion}-lang.tar.gz +Source2: vimrc-skel +# patches got from: ftp://ftp.vim.org/pub/vim/patches/%{majversion} +# create full patches archive with vim-patches.sh script below +Source3: %{name}-%{version}-patchset.tar.gz +Source4: vim-patches.sh +License: Charityware +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libgpm-devel +BuildRequires: libncurses-devel +BuildRequires: libselinux-devel +BuildRequires: libtcl-devel +BuildRequires: perl-devel +BuildRequires: ruby-devel +## AUTOBUILDREQ-END +BuildRequires: perl-devel >= 2:5.8.7 +BuildRequires: libpython-devel >= 2.3.4 +BuildRequires: libtcl >= 8.4.11 +BuildRequires: gettext-devel +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%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. 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. + +%package doc +Group: Documentation +Summary: Documentation for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description doc +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. +This package provides documentation files. + +%package tutor +Group: Applications/Text +Summary: Tutorial files for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description tutor +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. +This package provides tutorial files. + +%prep +%setup -q -n %{vimdir} + +# apply big patches +mkdir patches +cd patches +tar xf %{SOURCE3} +cd .. +ls patches/| sort -V | while read f; do + cat patches/$f | patch -p0 +done + +%define _use_internal_dependency_generator 0 + +# Find requires modified +%define __find_requires %{_builddir}/%{vimdir}/find_requires.sh + +# Find requires will ignore datadir files to avoid a wrong /bin/csh requirement +cat > find_requires.sh << _EOF +#! /bin/sh +grep -v %{_datadir} | %{_prefix}/lib/rpm/find-requires %{buildroot} %{_target_cpu} +_EOF + +chmod +x find_requires.sh + +sed -i ' + s,SYS_VIMRC_FILE "\$VIM/vimrc",SYS_VIMRC_FILE "%{_sysconfdir}/vim/vimrc", + s,SYS_GVIMRC_FILE "\$VIM/gvimrc",SYS_GVIMRC_FILE "%{_sysconfdir}/vim/gvimrc",' \ +src/os_unix.h + +# disable command echo +#for i in runtime/{gvimrc_example.vim,vimrc_example.vim}; do +# sed -i 's/^set showcmd/set noshowcmd/' $i +#done + +%define localedir %{buildroot}%{_datadir}/locale/ + +%build +# build gvim +%if %{with_gvim} + +#LOCALEDIR=%{localedir} \ +%configure \ + --with-compiledby="%{packager}" \ + --with-features=huge \ + --with-x=yes \ + --enable-gui=gnome2 \ + --enable-gtk2-check \ + --enable-xim \ + --enable-fontset \ + --enable-nls \ + --enable-perlinterp \ + --enable-pythoninterp \ + --enable-tclinterp \ + --enable-rubyinterp \ + --enable-cscope \ + --disable-acl \ + --enable-multibyte + +# disable the '-g' option +%make && +mv src/vim src/gvim +%make -C src clean CC=%{_target_platform}-gcc + +%endif + +# build vim +#LOCALEDIR=%{localedir} \ +%configure \ + --with-compiledby="%{packager}" \ + --with-features=huge \ + --with-x=no \ + --enable-gui=no \ + --enable-nls \ + --enable-perlinterp \ + --enable-pythoninterp \ + --enable-tclinterp \ + --enable-rubyinterp \ + --enable-cscope \ + --disable-acl \ + --enable-multibyte + +#sed -i ' +# s,LOCALEDIR=$(DEST_LANG),LOCALEDIR=$(DESTDIR)$(prefix)/share/locale,g' \ +#src/Makefile + +%make +#% make lang + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall + +ln -s vim %{buildroot}%{_bindir}/vi +install -m 0644 -D %{S:2} %{buildroot}%{_sysconfdir}/skel/.vimrc +install -m 0644 -D %{S:2} %{buildroot}/root/.vimrc + +%if %{with_gvim} +install -m 0755 -D src/gvim %{buildroot}%{_bindir}/gvim +%endif + +#%find_lang %{name} + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%{_bindir}/* +%{_datadir}/vim/%{vimdir}/*.vim +%{_datadir}/vim/%{vimdir}/autoload +%{_datadir}/vim/%{vimdir}/colors +%{_datadir}/vim/%{vimdir}/compiler +%{_datadir}/vim/%{vimdir}/ftplugin +%{_datadir}/vim/%{vimdir}/indent +%{_datadir}/vim/%{vimdir}/keymap +%{_datadir}/vim/%{vimdir}/lang +%{_datadir}/vim/%{vimdir}/macros +%{_datadir}/vim/%{vimdir}/plugin +%{_datadir}/vim/%{vimdir}/print +%{_datadir}/vim/%{vimdir}/spell +%{_datadir}/vim/%{vimdir}/syntax +%{_datadir}/vim/%{vimdir}/tools +%{_sysconfdir}/skel/.vimrc +%{_mandir}/man1/* +%lang(fr) %{_mandir}/fr*/man1/ +%lang(it) %{_mandir}/it*/man1/ +%lang(ja) %{_mandir}/ja/man1/ +%lang(it) %{_mandir}/it*/man1/ +%lang(pl) %{_mandir}/pl*/man1/ +%lang(ru) %{_mandir}/ru*/man1/ +%if %{with_gvim} +%{_bindir}/gvim +%endif +/root/.vimrc + +%files doc +%defattr(-,root,root) +%{_datadir}/vim/%{vimdir}/doc + +%files tutor +%defattr(-,root,root) +%{_datadir}/vim/%{vimdir}/tutor + +%changelog +* Wed Apr 09 2014 Silvan Calarco 7.4.258-1mamba +- update to 7.4.253 + +* Sun Jan 12 2014 Silvan Calarco 7.4.142-1mamba +- update to 7.4.142 + +* Sun Nov 17 2013 Silvan Calarco 7.4.094-1mamba +- update to 7.4.094 + +* Fri Sep 13 2013 Automatic Build System 7.4.027-1mamba +- update to 7.4.027 + +* Tue Aug 27 2013 Automatic Build System 7.4.009-1mamba +- update to 7.4.009 + +* Sat Aug 10 2013 Automatic Build System 7.3.1287-1mamba +- automatic version update by autodist + +* Wed Dec 01 2010 Silvan Calarco 7.3-2mamba +- fix dependencies by unsetting use_internal_dependency_generator +- update packager +- added -doc and -tutor packages + +* Tue Nov 16 2010 Silvan Calarco 7.3-1mamba +- update to 7.3 +- also install .vimrc in /root + +* Thu May 06 2009 Ercole 'ercolinux' Carpanetto 7.2-2mamba +- modified the .vimrc to add mode and command in the ruler, and make cursors keys works in edit mode +- modified vendor and distribution + +* Fri Aug 29 2008 Silvan Calarco 7.2-1mamba +- update to 7.2 + +* Mon May 14 2007 Aleph0 7.1-1mamba +- update to 7.1 +- modified xorg paths used when building gvim + +* Fri Jul 07 2006 Stefano Cotta Ramusino 7.0.037-1qilnx +- update to version 7.0.037 by autospec + +* Mon Jun 26 2006 Davide Madrisan 6.4.010-2qilnx +- updated vimrc file + +* Wed Apr 12 2006 Davide Madrisan 6.4.010-1qilnx +- update to version 6.4.010 by autospec + +* Mon Oct 03 2005 Stefano Cotta Ramusino 6.3.090-1qilnx +- updated to patch level 090 + +* Mon Aug 08 2005 Davide Madrisan 6.3.086-1qilnx +- updated to patch level 086 + +* Thu Dec 16 2004 Davide Madrisan 6.3-3qilnx +- security fix QSA-2004-064 (CAN-2004-1138) +- added new patches from ftp://ftp.vim.org/pub/vim/patches/6.3/ + +* Wed Nov 17 2004 Davide Madrisan 6.3-2qilnx +- rebuild with patches from ftp://ftp.vim.org/pub/vim/patches/6.3/ +- fixed security issues in `vimspell.sh' and `tcltags' (insecure creation + of temporary files) + +* Tue Jun 08 2004 Davide Madrisan 6.3-1qilnx +- new version rebuild +- added localisation + +* Tue Feb 17 2004 Davide Madrisan 6.2-1qilnx +- new version rebuild + +* Mon Apr 23 2003 Silvan Calarco 6.1-4qilnx +- added .vimrc default skeleton file + +* Mon Apr 17 2003 Silvan Calarco 6.1-3qilnx +- removed Prefix definition +- modified find_requires script to avoid a mistaken /bin/csh requirement + +* Mon Apr 14 2003 Mirko Cortillaro +- modified file list and created infodir + +* Wed Apr 02 2003 Mirko Cortillaro +- write a spec file for vim diff --git a/vimrc-skel b/vimrc-skel new file mode 100644 index 0000000..43731c5 --- /dev/null +++ b/vimrc-skel @@ -0,0 +1,22 @@ +if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" + set fileencodings=utf-8,latin1 +endif + +set showmode +set showcmd +set nocompatible +set backspace=2 +set history=50 +set ruler +syntax on + +if &t_Co > 2 || has("gui_running") + syntax on + set hlsearch +endif + +if &term=="xterm" + set t_Co=8 + set t_Sb=[4%dm + set t_Sf=[3%dm +endif