From 8b1294c638ba27cb895cf50715840130845f6fdbd951c8b613867485bb7a7304 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= <ismail@i10z.com>
Date: Wed, 25 Apr 2012 09:19:31 +0000
Subject: [PATCH 1/2] Accepting request 115281 from
 home:saschpe:branches:editors

Add a vim-python subpackage that only enables Python interpreter support
(and X11 clibboard, too), for users that don't want the extra dependencies
of vim-enhanced (basically the perl, ruby and tcl base packages)

OBS-URL: https://build.opensuse.org/request/show/115281
OBS-URL: https://build.opensuse.org/package/show/editors/vim?expand=0&rev=95
---
 vim.changes |  7 +++++++
 vim.spec    | 53 ++++++++++++++++++++++++++++++++++++++++++++---------
 2 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/vim.changes b/vim.changes
index 0f52b36..75a9555 100644
--- a/vim.changes
+++ b/vim.changes
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Wed Apr 25 08:53:49 UTC 2012 - saschpe@suse.de
+
+- Add a vim-python subpackage that only enables Python interpreter support
+  (and X11 clibboard, too), for users that don't want the extra dependencies
+  of vim-enhanced (basically the perl, ruby and tcl base packages)
+
 -------------------------------------------------------------------
 Sat Mar 24 20:08:15 UTC 2012 - idonmez@suse.com
 
diff --git a/vim.spec b/vim.spec
index 7357a92..01a318b 100644
--- a/vim.spec
+++ b/vim.spec
@@ -130,7 +130,6 @@ Package vim contains the normal version of vim. To get the full runtime
 environment install additionally vim-data.
 
 %package data
-
 Summary:        Vi IMproved
 Group:          Productivity/Editors/Vi
 PreReq:         %{vim_prereq}
@@ -153,7 +152,6 @@ For SUSE Linux, Vim is used as /usr/bin/vi.
 Package vim-data contains the runtime files.
 
 %package base
-
 Summary:        Vi IMproved
 Group:          Productivity/Editors/Vi
 PreReq:         %{vim_prereq}
@@ -177,7 +175,6 @@ 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
 Group:          Productivity/Editors/Vi
 PreReq:         %{vim_prereq}
@@ -198,10 +195,28 @@ 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.
 
+%package python
+Summary:        A version of the VIM editor which includes recent enhancements
+Group:          Productivity/Editors/Vi
+PreReq:         %{vim_prereq}
+PreReq:         update-alternatives
+Provides:       vi
+Provides:       vim_client
+# It makes little sense to have both the 'python' and 'enhanced' versions installed:
+Conflicts:      vim-enhanced = %{version}
+
+%description python
+The vim-python package contains a version of VIM with extra, recently
+introduced features like Python and X11 clipboard support, but it has no
+graphical user interface.
+
+Install the vim-python package if you'd like to use these features but don't
+want to have the extra dependencies on Perl, Ruby and TCL runtimes. 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.
+
 %if 0%{?with_splitted_gvim}
-
 %package -n gvim-base
-
 Summary:        dummy package for a subpackage only build in the buildservice
 Group:          Productivity/Editors/Vi
 PreReq:         %{vim_prereq}
@@ -212,7 +227,6 @@ Requires:       gvim_client
 dummy package for a subpackage only build in the buildservice
 
 %package -n gvim-enhanced
-
 Summary:        dummy package for a subpackage only build in the buildservice
 Group:          Productivity/Editors/Vi
 PreReq:         %{gvim_prereq}
@@ -223,11 +237,9 @@ Provides:       vim_client
 
 %description -n gvim-enhanced
 dummy package for a subpackage only build in the buildservice
-
 %endif
 
 %package -n gvim
-
 Summary:        A GUI for Vi
 Group:          Productivity/Editors/Vi
 PreReq:         %{gvim_prereq}
@@ -305,7 +317,9 @@ export SCRIPT_OPTIONS="\
     --enable-tclinterp \
     --with-tclsh=%{_bindir}/tclsh \
     --with-python-config-dir=%{py_libdir}/config"
-
+export PYTHON_OPTIONS="\
+    --enable-pythoninterp \
+    --with-python-config-dir=%{py_libdir}/config"
 export GUI_OPTIONS="\
     --enable-xim \
     --enable-fontset \
@@ -333,6 +347,13 @@ sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h
 cp src/vim vim-enhanced
 make distclean
 #
+# build python binary
+%configure ${COMMON_OPTIONS} ${PYTHON_OPTIONS} --disable-gui
+sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h
+%make
+cp src/vim vim-python
+make distclean
+#
 # build enhanced gvim binary
 %configure ${COMMON_OPTIONS} ${SCRIPT_OPTIONS} ${GUI_OPTIONS}
 sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h
@@ -366,6 +387,7 @@ done
 # install the other binaries
 install -D -m 0755 vim-normal    %{buildroot}/bin/vim-normal
 install -D -m 0755 vim-enhanced  %{buildroot}%{_bindir}/vim-enhanced
+install -D -m 0755 vim-python  %{buildroot}%{_bindir}/vim-python
 %if 0%{?with_splitted_gvim}
 install -D -m 0755 gvim-enhanced %{buildroot}%{_bindir}/gvim-enhanced
 %endif
@@ -473,6 +495,10 @@ fi
 /usr/sbin/update-alternatives --install \
     /bin/vim        vim  %{_bindir}/vim-enhanced  20
 
+%post python
+/usr/sbin/update-alternatives --install \
+    /bin/vim        vim  %{_bindir}/vim-python  18
+
 %post -n gvim
 /usr/sbin/update-alternatives --install \
     %{_bindir}/gvim gvim %{_bindir}/gvim-normal   5
@@ -502,6 +528,11 @@ if [ "$1" = 0 ] ; then
     /usr/sbin/update-alternatives --remove vim %{_bindir}/vim-enhanced
 fi
 
+%preun python
+if [ "$1" = 0 ] ; then
+    /usr/sbin/update-alternatives --remove vim %{_bindir}/vim-python
+fi
+
 %preun -n gvim
 if [ "$1" = 0 ] ; then
     /usr/sbin/update-alternatives --remove vim %{_bindir}/gvim
@@ -654,6 +685,10 @@ fi
 %defattr(-,root,root,-)
 %{_bindir}/vim-enhanced
 
+%files python
+%defattr(-,root,root,-)
+%{_bindir}/vim-python
+
 %files -n gvim
 %defattr(-,root,root,-)
 %{_bindir}/gvim-normal

From 72e78541d8f23a71fe3be036bf0baa01cd79cdaf33a641c2b3a2d73c839a1a69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= <ismail@i10z.com>
Date: Fri, 27 Apr 2012 19:13:08 +0000
Subject: [PATCH 2/2] darix is right, there is no need for Conflicts here

OBS-URL: https://build.opensuse.org/package/show/editors/vim?expand=0&rev=96
---
 vim.spec | 2 --
 1 file changed, 2 deletions(-)

diff --git a/vim.spec b/vim.spec
index 01a318b..1be2c77 100644
--- a/vim.spec
+++ b/vim.spec
@@ -202,8 +202,6 @@ PreReq:         %{vim_prereq}
 PreReq:         update-alternatives
 Provides:       vi
 Provides:       vim_client
-# It makes little sense to have both the 'python' and 'enhanced' versions installed:
-Conflicts:      vim-enhanced = %{version}
 
 %description python
 The vim-python package contains a version of VIM with extra, recently