Rebase for vim 8.0.586 28/163428/1
authorAnas Nashif <anas.nashif@intel.com>
Wed, 7 Nov 2012 06:43:44 +0000 (22:43 -0800)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 11 Dec 2017 04:33:07 +0000 (13:33 +0900)
Change-Id: Idcef6293721e3a50d568442ff8572177a38e3b02
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
packaging/tizen.vimrc [new file with mode: 0644]
packaging/vim-7.4-patches.tar.bz2 [new file with mode: 0644]
packaging/vim-rpmlintrc [new file with mode: 0644]
packaging/vim.changes [new file with mode: 0644]
packaging/vim.manifest [new file with mode: 0644]
packaging/vim.spec [new file with mode: 0644]
src/configure.ac
src/feature.h
src/os_unix.c

diff --git a/packaging/tizen.vimrc b/packaging/tizen.vimrc
new file mode 100644 (file)
index 0000000..c3a4520
--- /dev/null
@@ -0,0 +1,251 @@
+" /etc/vimrc (configuration file for vim only)
+" author: Klaus Franken     <kfr@suse.de>
+" author: Werner Fink       <werner@suse.de> 
+" author: Florian La Roche  <florian@suse.de> 
+" version: 06/11/2011
+" commented lines start with `"'
+
+
+" enable syntax highlighting
+syntax on
+
+" automatically indent lines (default)
+" set noautoindent
+
+" select case-insenitiv search (not default)
+" set ignorecase
+
+" show cursor line and column in the status line
+set ruler
+
+" show matching brackets
+set showmatch
+
+" display mode INSERT/REPLACE/...
+set showmode
+
+" changes special characters in search patterns (default)
+" set magic
+
+" Required to be able to use keypad keys and map missed escape sequences
+set esckeys
+
+" get easier to use and more user friendly vim defaults
+" CAUTION: This option breaks some vi compatibility. 
+"          Switch it off if you prefer real vi compatibility
+set nocompatible
+
+" allow backspacing over everything in insert mode 
+set backspace=indent,eol,start
+
+" Complete longest common string, then each full match
+" enable this for bash compatible behaviour
+" set wildmode=longest,full
+
+" Try to get the correct main terminal type
+if &term =~ "xterm"
+    let myterm = "xterm"
+elseif &term =~ "screen"
+    let myterm = "screen"
+else
+    let myterm =  &term
+endif
+let myterm = substitute(myterm, "cons[0-9][0-9].*$",  "linux", "")
+let myterm = substitute(myterm, "cons[0-9][0-9].*$",  "linux", "")
+let myterm = substitute(myterm, "vt1[0-9][0-9].*$",   "vt100", "")
+let myterm = substitute(myterm, "vt2[0-9][0-9].*$",   "vt220", "")
+let myterm = substitute(myterm, "\\([^-]*\\)[_-].*$", "\\1",   "")
+
+" Here we define the keys of the NumLock in keyboard transmit mode of xterm
+" which misses or hasn't activated Alt/NumLock Modifiers.  Often not defined
+" within termcap/terminfo and we should map the character printed on the keys.
+if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
+    " keys in insert/command mode.
+    map! <ESC>Oo  :
+    map! <ESC>Oj  *
+    map! <ESC>Om  -
+    map! <ESC>Ok  +
+    map! <ESC>Ol  ,
+    map! <ESC>OM  \r
+    map! <ESC>Ow  7
+    map! <ESC>Ox  8
+    map! <ESC>Oy  9
+    map! <ESC>Ot  4
+    map! <ESC>Ou  5
+    map! <ESC>Ov  6
+    map! <ESC>Oq  1
+    map! <ESC>Or  2
+    map! <ESC>Os  3
+    map! <ESC>Op  0
+    map! <ESC>On  .
+    " keys in normal mode
+    map <ESC>Oo  :
+    map <ESC>Oj  *
+    map <ESC>Om  -
+    map <ESC>Ok  +
+    map <ESC>Ol  ,
+    map <ESC>OM  \r
+    map <ESC>Ow  7
+    map <ESC>Ox  8
+    map <ESC>Oy  9
+    map <ESC>Ot  4
+    map <ESC>Ou  5
+    map <ESC>Ov  6
+    map <ESC>Oq  1
+    map <ESC>Or  2
+    map <ESC>Os  3
+    map <ESC>Op  0
+    map <ESC>On  .
+endif
+
+" xterm but without activated keyboard transmit mode
+" and therefore not defined in termcap/terminfo.
+if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
+    " keys in insert/command mode.
+    map! <Esc>[H  <Home>
+    map! <Esc>[F  <End>
+    " Home/End: older xterms do not fit termcap/terminfo.
+    map! <Esc>[1~ <Home>
+    map! <Esc>[4~ <End>
+    " Up/Down/Right/Left
+    map! <Esc>[A  <Up>
+    map! <Esc>[B  <Down>
+    map! <Esc>[C  <Right>
+    map! <Esc>[D  <Left>
+    " KP_5 (NumLock off)
+    map! <Esc>[E  <Insert>
+    " keys in normal mode
+    map <ESC>[H  0
+    map <ESC>[F  $
+    " Home/End: older xterms do not fit termcap/terminfo.
+    map <ESC>[1~ 0
+    map <ESC>[4~ $
+    " Up/Down/Right/Left
+    map <ESC>[A  k
+    map <ESC>[B  j
+    map <ESC>[C  l
+    map <ESC>[D  h
+    " KP_5 (NumLock off)
+    map <ESC>[E  i
+endif
+
+" xterm/kvt but with activated keyboard transmit mode.
+" Sometimes not or wrong defined within termcap/terminfo.
+if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
+    " keys in insert/command mode.
+    map! <Esc>OH <Home>
+    map! <Esc>OF <End>
+    map! <ESC>O2H <Home>
+    map! <ESC>O2F <End>
+    map! <ESC>O5H <Home>
+    map! <ESC>O5F <End>
+    " Cursor keys which works mostly
+    " map! <Esc>OA <Up>
+    " map! <Esc>OB <Down>
+    " map! <Esc>OC <Right>
+    " map! <Esc>OD <Left>
+    map! <Esc>[2;2~ <Insert>
+    map! <Esc>[3;2~ <Delete>
+    map! <Esc>[2;5~ <Insert>
+    map! <Esc>[3;5~ <Delete>
+    map! <Esc>O2A <PageUp>
+    map! <Esc>O2B <PageDown>
+    map! <Esc>O2C <S-Right>
+    map! <Esc>O2D <S-Left>
+    map! <Esc>O5A <PageUp>
+    map! <Esc>O5B <PageDown>
+    map! <Esc>O5C <S-Right>
+    map! <Esc>O5D <S-Left>
+    " KP_5 (NumLock off)
+    map! <Esc>OE <Insert>
+    " keys in normal mode
+    map <ESC>OH  0
+    map <ESC>OF  $
+    map <ESC>O2H  0
+    map <ESC>O2F  $
+    map <ESC>O5H  0
+    map <ESC>O5F  $
+    " Cursor keys which works mostly
+    " map <ESC>OA  k
+    " map <ESC>OB  j
+    " map <ESC>OD  h
+    " map <ESC>OC  l
+    map <Esc>[2;2~ i
+    map <Esc>[3;2~ x
+    map <Esc>[2;5~ i
+    map <Esc>[3;5~ x
+    map <ESC>O2A  ^B
+    map <ESC>O2B  ^F
+    map <ESC>O2D  b
+    map <ESC>O2C  w
+    map <ESC>O5A  ^B
+    map <ESC>O5B  ^F
+    map <ESC>O5D  b
+    map <ESC>O5C  w
+    " KP_5 (NumLock off)
+    map <ESC>OE  i
+endif
+
+if myterm == "linux"
+    " keys in insert/command mode.
+    map! <Esc>[G  <Insert>
+    " KP_5 (NumLock off)
+    " keys in normal mode
+    " KP_5 (NumLock off)
+    map <ESC>[G  i
+endif
+
+if myterm == "screen"
+    map! <ESC>[1;2D <S-Left>
+    map! <ESC>[1;2C <S-Right>
+    map! <ESC>[1;2A <S-Up>
+    map! <ESC>[1;2B <S-Down>
+    map! <ESC>[1;2H <Home>
+    map! <ESC>[1;2F <End>
+    map! <ESC>[2;2~ <Insert>
+    map! <ESC>[3;2~ <Delete>
+    map! <ESC>[5;2~ <PageUp>
+    map! <ESC>[6;2~ <PageDown>
+    map! <ESC>[1;5D <C-Left>
+    map! <ESC>[1;5C <C-Right>
+    map! <ESC>[1;5A <C-Up>
+    map! <ESC>[1;5B <C-Down>
+    map! <ESC>[1;5H <Home>
+    map! <ESC>[1;5F <End>
+    map! <ESC>[2;5~ <Insert>
+    map! <ESC>[3;5~ <Delete>
+    map! <ESC>[5;5~ <PageUp>
+    map! <ESC>[6;5~ <PageDown>
+    map! <ESC>[1;3D <A-Left>
+    map! <ESC>[1;3C <A-Right>
+    map! <ESC>[1;3A <A-Up>
+    map! <ESC>[1;3B <A-Down>
+    map! <ESC>[1;3H <Home>
+    map! <ESC>[1;3F <End>
+    map! <ESC>[2;3~ <Insert>
+    map! <ESC>[3;3~ <Delete>
+    map! <ESC>[5;3~ <PageUp>
+    map! <ESC>[6;3~ <PageDown>
+endif
+
+" This escape sequence is the well known ANSI sequence for
+" Remove Character Under The Cursor (RCUTC[tm])
+map! <Esc>[3~ <Delete>
+map  <ESC>[3~    x
+
+" Only do this part when compiled with support for autocommands. 
+if has("autocmd") 
+  " When editing a file, always jump to the last known cursor position. 
+  " Don't do it when the position is invalid or when inside an event handler 
+  " (happens when dropping a file on gvim). 
+  autocmd BufReadPost * 
+    \ if line("'\"") > 0 && line("'\"") <= line("$") | 
+    \   exe "normal g`\"" | 
+    \ endif 
+endif " has("autocmd")
+
+set nomodeline
+
+" get easier to use and more user friendly vim defaults
+" /etc/vimrc ends here
diff --git a/packaging/vim-7.4-patches.tar.bz2 b/packaging/vim-7.4-patches.tar.bz2
new file mode 100644 (file)
index 0000000..847e53e
Binary files /dev/null and b/packaging/vim-7.4-patches.tar.bz2 differ
diff --git a/packaging/vim-rpmlintrc b/packaging/vim-rpmlintrc
new file mode 100644 (file)
index 0000000..d094f01
--- /dev/null
@@ -0,0 +1,6 @@
+from Config import *
+
+addFilter("vim-data.* devel-file-in-non-devel-package")
+addFilter("vim-data.* file-not-in-%lang")
+addFilter("vim-base.* package-with-huge-docs")
+
diff --git a/packaging/vim.changes b/packaging/vim.changes
new file mode 100644 (file)
index 0000000..7f63fd5
--- /dev/null
@@ -0,0 +1,10 @@
+* Tue Feb 04 2014 Ćukasz Stelmach <l.stelmach@samsung.com> upstream/7.4@b5a2483
+- Update to version 7.4 patch level 155
+- Add smack aware behaviour to keep labels
+
+* Thu Feb 21 2013 Anas Nashif <anas.nashif@intel.com> accepted/trunk/20130114.135547@ee3cf07
+- Use /etc/vimrc as system config gile
+
+* Sun Jan 13 2013 Anas Nashif <anas.nashif@intel.com> upstream/7.3@39756a4
+- do not use missing-client
+
diff --git a/packaging/vim.manifest b/packaging/vim.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/vim.spec b/packaging/vim.spec
new file mode 100644 (file)
index 0000000..fbe1d3d
--- /dev/null
@@ -0,0 +1,393 @@
+%define official_ptchlvl 155
+%define VIM_SUBDIR vim74
+%define site_runtimepath /usr/share/vim/site
+%define smack 1
+
+Name:           vim
+Version:        7.4
+Release:        0
+License:        Vim
+Summary:        Vi IMproved
+Url:            http://www.vim.org/
+Group:          Base/Utilities
+Source:         ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
+Source3:        tizen.vimrc
+Source98:       %{name}-7.4-patches.tar.bz2
+Source99:       %{name}-rpmlintrc
+Source1001:     vim.manifest
+BuildRequires:  autoconf
+BuildRequires:  db4-devel
+BuildRequires:  fdupes
+BuildRequires:  gettext-devel
+BuildRequires:  ncurses-devel
+BuildRequires:  perl
+BuildRequires:  pkgconfig
+BuildRequires:  python-devel
+%if %{smack}
+BuildRequires: libattr-devel
+%endif
+Provides:       vi
+Provides:       vim_client
+Requires(pre):  update-alternatives
+%define vim_prereq %{name}-base = %{version}
+# Explicitly require versioned perl for libperl.so
+%define perl_requires perl = %(rpm -q --qf '%{VERSION}' perl)
+Requires(pre):         %{vim_prereq}
+
+%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.
+
+Vi is available for the AMIGA, MS-DOS, Windows NT, and various versions
+of UNIX.
+
+Package vim contains the normal version of vim. To get the full runtime
+environment install additionally vim-data.
+
+%package data
+Summary:        Vi IMproved
+BuildArch:      noarch
+Requires(pre):         %{vim_prereq}
+
+%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.
+
+Package vim-data contains the runtime files.
+
+%package base
+Summary:        Vi IMproved
+Requires(pre):         %{vim_prereq}
+Requires(pre):         update-alternatives
+
+%description base
+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-base contains the common files needed for all different vim
+versions. You still need to select at least one of the vim,
+vim-enhanced or gvim packages. For full runtime support you might also
+want to install the vim-data package.
+
+%package enhanced
+Summary:        A version of the VIM editor which includes recent enhancements
+Requires:       %{perl_requires}
+Requires:       vim-data
+Provides:       vi
+Provides:       vim_client
+Requires(pre):         %{vim_prereq}
+Requires(pre):         update-alternatives
+
+%description enhanced
+The vim-enhanced package contains a version of VIM with extra, recently
+introduced features like Ruby, Perl and TCL interpreters, but it has no
+graphical user interface. Please use gvim instead, if you need a gui
+too.
+
+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 base package 'vim', for online help, etc. If you need the
+graphical features of vim, you might want to install package gvim too.
+
+%prep
+%setup -q -n vim74 -b 98
+cp %{SOURCE1001} .
+for p in ../vim-%{version}-patches/%{version}*; do
+    test -e $p || break
+    test ${p#*/%{version}.} -le %{official_ptchlvl} || exit 1
+    echo Patch $p
+    patch -s -p0 < $p
+done
+unset p
+cp %{SOURCE3}  .
+
+# newer perl? ugly hack to fix build anyway.
+sed -i -e 's/^XS(XS_/XS_INTERNAL(XS_/' src/if_perl.xs
+
+%build
+export CFLAGS="%{optflags} -Wall -pipe -fno-strict-aliasing"
+export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/-D_FORTIFY_SOURCE=1}
+
+export COMMON_OPTIONS="\
+%if %{smack}
+       --disable-selinux \
+       --enable-smack \
+%endif
+    --with-vim-name=vim \
+    --with-ex-name=ex \
+    --with-view-name=view \
+    --enable-cscope \
+    --enable-multibyte \
+    --enable-sniff \
+    --with-features=huge \
+    --with-compiledby='http://www.tizen.org/' \
+    --with-tlib=tinfo \
+    --with-global-runtime=%{site_runtimepath}"
+export SCRIPT_OPTIONS="\
+    --enable-perlinterp \
+    --enable-pythoninterp \
+    --with-python-config-dir=%{py_libdir}/config"
+
+pushd src
+autoconf
+popd
+#
+# build small default binary
+%configure \
+    ${COMMON_OPTIONS} --disable-gui --without-x --disable-gpm \
+    --disable-perlinterp --disable-pythoninterp \
+    --disable-rubyinterp --disable-tclinterp
+sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h
+make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/current MAKE="make -e" %{?_smp_mflags}
+cp src/vim vim-normal
+make distclean
+#
+# build enhanced binary
+%configure ${COMMON_OPTIONS} ${SCRIPT_OPTIONS} --disable-gui
+sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h
+make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/current MAKE="make -e" %{?_smp_mflags}
+cp src/vim vim-enhanced
+#make distclean
+#
+#
+
+%install
+# create icon directory to have the icon from the tarball installed
+install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
+
+cd src
+make install DESTDIR=%{buildroot} BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=%{site_runtimepath}
+cd ..
+
+# install the other binaries
+install -D -m 0755 vim-normal    %{buildroot}/%{_bindir}/vim-normal
+install -D -m 0755 vim-enhanced  %{buildroot}%{_bindir}/vim-enhanced
+
+# compat symlinks
+# we need a dummy target for /etc/alternatives/vim
+mkdir -p %{buildroot}%{_sysconfdir}/alternatives
+touch %{buildroot}%{_sysconfdir}/alternatives/vim
+ln -s -f /etc/alternatives/vim %{buildroot}/%{_bindir}/vim
+
+ln -s -f vim   %{buildroot}%{_bindir}/vi
+ln -s -f vim        %{buildroot}%{_bindir}/edit
+ln -s -f vim       %{buildroot}/%{_bindir}/ex
+
+# man pages
+mkdir -p %{buildroot}%{_mandir}/man1
+ln -s -f vim.1.gz %{buildroot}%{_mandir}/man1/vi.1.gz
+ln -s -f vim.1.gz %{buildroot}%{_mandir}/man1/ex.1.gz
+
+
+# make the vim settings more generic
+ln -s -f %{VIM_SUBDIR} %{buildroot}%{_datadir}/vim/current
+
+# additional files
+install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/vimrc
+
+# 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
+
+
+#
+# documentation
+install -d -m 0755 %{buildroot}%{_docdir}/{,g}vim/
+cp runtime/doc/uganda.txt LICENSE
+install -D -m 0644 \
+    tizen.vimrc \
+    README.txt README_src.txt README_unix.txt \
+  %{buildroot}%{_docdir}/vim/
+#
+# 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/
+rm -rf %{buildroot}%{_mandir}/ru.UTF-8
+# and move russian manpages to a place where they can be found
+rm -rf %{buildroot}%{_mandir}/{fr,it,pl,ru,ja}
+
+
+# remove some c source files
+rm -f %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/tools/*.c
+rm -f %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/macros/maze/*.c
+#
+# Create ghost files (see vim.conf)
+mkdir -p %{buildroot}%{_localstatedir}/run/vi.recover
+rm -rf %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
+
+%fdupes -s %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/lang
+%fdupes -s %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/tutor
+%fdupes -s %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/ftplugin
+
+%post
+/usr/sbin/update-alternatives --install \
+    /usr/bin/vim        vim  /usr/bin/vim-normal          15
+
+
+%post enhanced
+/usr/sbin/update-alternatives --install \
+    /usr/bin/vim        vim  %{_bindir}/vim-enhanced  20
+
+
+%preun
+if [ "$1" = 0 ] ; then
+    /usr/sbin/update-alternatives --remove vim /usr//bin/vim-normal
+fi
+
+
+%preun enhanced
+if [ "$1" = 0 ] ; then
+    /usr/sbin/update-alternatives --remove vim %{_bindir}/vim-enhanced
+fi
+
+
+%docs_package
+
+%files
+%manifest %{name}.manifest
+%license LICENSE
+%defattr(-,root,root,-)
+%{_bindir}/vim-normal
+
+%files base
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%config(noreplace) %{_sysconfdir}/vimrc
+%ghost %{_sysconfdir}/alternatives/vim
+%{_bindir}/edit
+%{_bindir}/ex
+%{_bindir}/rview
+%{_bindir}/rvim
+%{_bindir}/vi
+%{_bindir}/vim
+%{_bindir}/view
+%{_bindir}/vimdiff
+# additional binaries
+%{_bindir}/vimtutor
+%{_bindir}/xxd
+# docs and data file
+%doc %{_docdir}/vim
+#
+%{_datadir}/vim/current
+%dir %{_datadir}/vim/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/autoload/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/colors/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/compiler/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/doc/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/ftplugin/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/indent/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/keymap/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/lang/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/macros/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/plugin/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/print/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/spell/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/syntax/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/tools/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/tutor/
+%dir %{_datadir}/vim/%{VIM_SUBDIR}/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/%{VIM_SUBDIR}/bugreport.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/evim.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/filetype.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/ftoff.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/ftplugin.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/ftplugof.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/indent.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/indoff.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/optwin.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/scripts.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/syntax/syntax.vim
+
+%files data
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+# data files
+%{_datadir}/vim/%{VIM_SUBDIR}/autoload/*
+%{_datadir}/vim/%{VIM_SUBDIR}/colors/*
+%{_datadir}/vim/%{VIM_SUBDIR}/compiler/*
+%{_datadir}/vim/%{VIM_SUBDIR}/doc/*
+%{_datadir}/vim/%{VIM_SUBDIR}/ftplugin/*
+%{_datadir}/vim/%{VIM_SUBDIR}/indent/*
+%{_datadir}/vim/%{VIM_SUBDIR}/keymap/*
+%{_datadir}/vim/%{VIM_SUBDIR}/lang/*
+%{_datadir}/vim/%{VIM_SUBDIR}/macros/*
+%{_datadir}/vim/%{VIM_SUBDIR}/plugin/*
+%{_datadir}/vim/%{VIM_SUBDIR}/print/*
+%{_datadir}/vim/%{VIM_SUBDIR}/spell/*
+%{_datadir}/vim/%{VIM_SUBDIR}/syntax/*
+%exclude %{_datadir}/vim/%{VIM_SUBDIR}/syntax/syntax.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/ccfilter.1
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/ccfilter_README.txt
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/efm_filter.pl
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/efm_filter.txt
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/efm_perl.pl
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/mve.awk
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/mve.txt
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/pltags.pl
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/README.txt
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/ref
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/shtags.1
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/shtags.pl
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/unicode.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/vimm
+%exclude %{_datadir}/vim/%{VIM_SUBDIR}/tools/vim132
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/vimspell.sh
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/vimspell.txt
+%{_datadir}/vim/%{VIM_SUBDIR}/tools/vim_vs_net.cmd
+%{_datadir}/vim/%{VIM_SUBDIR}/tutor/*
+%{_datadir}/vim/%{VIM_SUBDIR}/delmenu.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/menu.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/mswin.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/synmenu.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/gvimrc_example.vim
+%{_datadir}/vim/%{VIM_SUBDIR}/vimrc_example.vim
+
+%files enhanced
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_bindir}/vim-enhanced
+
+
+%changelog
index cdf39b3..088c487 100644 (file)
@@ -400,6 +400,23 @@ AC_ARG_ENABLE(smack,
        [  --disable-smack        Do not check for Smack support.],
        , enable_smack="yes")
 if test "$enable_smack" = "yes"; then
+  AC_CHECK_HEADER([linux/xattr.h], true, enable_smack="no")
+fi
+if test "$enable_smack" = "yes"; then
+  AC_MSG_RESULT(no)
+  AC_CHECK_LIB(attr, llistxattr,
+         [LIBS="$LIBS -lattr"
+          AC_DEFINE(HAVE_SMACK)])
+else
+   AC_MSG_RESULT(yes)
+fi
+
+dnl Link with -lselinux for SELinux stuff; if not found
+AC_MSG_CHECKING(--disable-selinux argument)
+AC_ARG_ENABLE(selinux,
+       [  --disable-selinux      Don't check for SELinux support.],
+       , enable_selinux="yes")
+if test "$enable_selinux" = "yes"; then
   AC_MSG_RESULT(no)
   AC_CHECK_HEADER([linux/xattr.h], true, enable_smack="no")
 else
index 138279e..90a5025 100644 (file)
  * SYS_VIMRC_FILE      Name of the system-wide .vimrc file.
  */
 /* #define SYS_VIMRC_FILE      "/etc/vimrc" */
-
+#define SYS_VIMRC_FILE "/etc/vimrc"
 /*
  * SYS_GVIMRC_FILE     Name of the system-wide .gvimrc file.
  */
 /* #define SYS_GVIMRC_FILE     "/etc/gvimrc" */
-
+#define SYS_GVIMRC_FILE "/etc/gvimrc"
+       
 /*
  * DFLT_HELPFILE       Name of the help file.
  */
index 8ed3a67..aef21bb 100644 (file)
@@ -2801,75 +2801,84 @@ mch_copy_sec(char_u *from_file, char_u *to_file)
 }
 #endif /* HAVE_SELINUX */
 
-#if defined(HAVE_SMACK) && !defined(PROTO)
+#if defined(HAVE_SMACK)
 /*
  * Copy security info from "from_file" to "to_file".
  */
     void
-mch_copy_sec(char_u *from_file, char_u *to_file)
+mch_copy_sec(from_file, to_file)
+    char_u     *from_file;
+    char_u     *to_file;
 {
-    static const char * const smack_copied_attributes[] =
+    static const char const *smack_copied_attributes[] =
        {
            XATTR_NAME_SMACK,
            XATTR_NAME_SMACKEXEC,
            XATTR_NAME_SMACKMMAP
        };
 
-    char       buffer[SMACK_LABEL_LEN];
-    const char *name;
-    int                index;
-    int                ret;
-    ssize_t    size;
+    char buffer[SMACK_LABEL_LEN];
+    const char *name;
+    int index;
+    int ret;
+    ssize_t size;
 
     if (from_file == NULL)
        return;
 
-    for (index = 0 ; index < (int)(sizeof(smack_copied_attributes)
-                             / sizeof(smack_copied_attributes)[0]) ; index++)
+    for (index = 0 ; index < (int)(sizeof smack_copied_attributes / sizeof smack_copied_attributes[0]) ; index++)
     {
        /* get the name of the attribute to copy */
        name = smack_copied_attributes[index];
 
        /* get the value of the attribute in buffer */
-       size = getxattr((char*)from_file, name, buffer, sizeof(buffer));
+       size = getxattr((char*)from_file, name, buffer, sizeof buffer);
        if (size >= 0)
        {
+
            /* copy the attribute value of buffer */
            ret = setxattr((char*)to_file, name, buffer, (size_t)size, 0);
            if (ret < 0)
            {
-               vim_snprintf((char *)IObuff, IOSIZE,
-                       _("Could not set security context %s for %s"),
-                       name, to_file);
-               msg_outtrans(IObuff);
+               MSG_PUTS(_("Could not set security context "));
+               MSG_PUTS(name);
+               MSG_PUTS(_(" for "));
+               msg_outtrans(to_file);
                msg_putchar('\n');
            }
+
        }
        else
        {
            /* what reason of not having the attribute value? */
            switch (errno)
            {
+               /* extended attributes aren't supported or enabled */
                case ENOTSUP:
-                   /* extended attributes aren't supported or enabled */
                    /* should a message be echoed? not sure... */
                    return; /* leave because it isn't usefull to continue */
 
+               /* no enough size OR unexpected error */
                case ERANGE:
                default:
-                   /* no enough size OR unexpected error */
-                    vim_snprintf((char *)IObuff, IOSIZE,
-                           _("Could not get security context %s for %s. Removing it!"),
-                           name, from_file);
-                   msg_puts(IObuff);
-                   msg_putchar('\n');
-                   /* FALLTHROUGH to remove the attribute */
-
+                   MSG_PUTS(_("Could not get security context "));
+                   MSG_PUTS(name);
+                   MSG_PUTS(_(" for "));
+                   msg_outtrans(from_file);
+                   MSG_PUTS(_(". Removing it!\n"));
+                   /* break; Don't break but continue and remove the attribute */
+
+               /* no attribute of this name */
                case ENODATA:
-                   /* no attribute of this name */
                    ret = removexattr((char*)to_file, name);
-                   /* Silently ignore errors, apparently this happens when
-                    * smack is not actually being used. */
+                   if (ret < 0 && errno != ENODATA)
+                   {
+                       MSG_PUTS(_("Could not remove security context "));
+                       MSG_PUTS(name);
+                       MSG_PUTS(_(" for "));
+                       msg_outtrans(to_file);
+                       msg_putchar('\n');
+                   }
                    break;
            }
        }