Accepting request 478641 from home:kukuk:branches:editors
- Build default vim without X11 support, use update-alternatives to prefer gvim if installed for X11 support. OBS-URL: https://build.opensuse.org/request/show/478641 OBS-URL: https://build.opensuse.org/package/show/editors/vim?expand=0&rev=424
This commit is contained in:
parent
433c3c0831
commit
2d14c13832
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Mar 11 10:55:35 CET 2017 - kukuk@suse.de
|
||||||
|
|
||||||
|
- Build default vim without X11 support, use update-alternatives
|
||||||
|
to prefer gvim if installed for X11 support.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Mar 6 08:40:25 UTC 2017 - idonmez@suse.com
|
Mon Mar 6 08:40:25 UTC 2017 - idonmez@suse.com
|
||||||
|
|
||||||
|
43
vim.spec
43
vim.spec
@ -50,6 +50,8 @@ BuildRequires: update-desktop-files
|
|||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
PreReq: fileutils
|
PreReq: fileutils
|
||||||
PreReq: sh-utils
|
PreReq: sh-utils
|
||||||
|
Requires(post): update-alternatives
|
||||||
|
Requires(preun): update-alternatives
|
||||||
%{?libperl_requires}
|
%{?libperl_requires}
|
||||||
Provides: vi
|
Provides: vi
|
||||||
Provides: vim-base = %{version}-%{release}
|
Provides: vim-base = %{version}-%{release}
|
||||||
@ -124,6 +126,8 @@ Obsoletes: gvim-enhanced < %{version}-%{release}
|
|||||||
Provides: gvim_client
|
Provides: gvim_client
|
||||||
Provides: vi
|
Provides: vi
|
||||||
Provides: vim_client
|
Provides: vim_client
|
||||||
|
Requires(post): update-alternatives
|
||||||
|
Requires(preun): update-alternatives
|
||||||
|
|
||||||
%description -n gvim
|
%description -n gvim
|
||||||
Package gvim contains the largest set of features of vim, which is
|
Package gvim contains the largest set of features of vim, which is
|
||||||
@ -189,10 +193,10 @@ autoconf
|
|||||||
popd
|
popd
|
||||||
|
|
||||||
# build vim
|
# build vim
|
||||||
%configure ${COMMON_OPTIONS} --disable-gui --disable-gpm
|
%configure ${COMMON_OPTIONS} --disable-gui --disable-gpm --with-x=no
|
||||||
sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h
|
sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
cp src/vim vim
|
cp src/vim vim-nox11
|
||||||
|
|
||||||
# build gvim
|
# build gvim
|
||||||
make distclean
|
make distclean
|
||||||
@ -224,14 +228,17 @@ for f in egvim egview eview evim gex gvi gview gvimdiff rgview rgvim ; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# install vim
|
# install vim
|
||||||
install -D -m 0755 vim %{buildroot}/bin/vim
|
install -D -m 0755 vim-nox11 %{buildroot}%{_bindir}/vim-nox11
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||||
|
ln -s -f %{_sysconfdir}/alternatives/vim %{buildroot}%{_bindir}/vim
|
||||||
|
|
||||||
# compat symlinks
|
# compat symlinks
|
||||||
ln -s -f /bin/vim %{buildroot}/bin/vi
|
mkdir %{buildroot}/bin
|
||||||
ln -s -f /bin/vim %{buildroot}%{_bindir}/vim
|
ln -s -f %{_bindir}/vim %{buildroot}/bin/vi
|
||||||
ln -s -f /bin/vim %{buildroot}%{_bindir}/vi
|
ln -s -f %{_bindir}/vim %{buildroot}/bin/vim
|
||||||
ln -s -f vim %{buildroot}%{_bindir}/edit
|
ln -s -f vim %{buildroot}%{_bindir}/vi
|
||||||
ln -s -f /bin/vim %{buildroot}/bin/ex
|
ln -s -f vim %{buildroot}%{_bindir}/edit
|
||||||
|
ln -s -f %{_bindir}/vim %{buildroot}/bin/ex
|
||||||
|
|
||||||
# man pages
|
# man pages
|
||||||
ln -s -f vim.1.gz %{buildroot}%{_mandir}/man1/vi.1.gz
|
ln -s -f vim.1.gz %{buildroot}%{_mandir}/man1/vi.1.gz
|
||||||
@ -325,15 +332,32 @@ trap "printf '\e[r'" EXIT
|
|||||||
# Look for "TEST FAILURE" in the build log
|
# Look for "TEST FAILURE" in the build log
|
||||||
LC_ALL=en_US.UTF-8 make test
|
LC_ALL=en_US.UTF-8 make test
|
||||||
|
|
||||||
|
%post
|
||||||
|
%{_sbindir}/update-alternatives --install %{_bindir}/vim vim %{_bindir}/vim-nox11 10
|
||||||
|
|
||||||
|
%preun
|
||||||
|
if [ "$1" = 0 ] ; then
|
||||||
|
%{_sbindir}/update-alternatives --remove vim %{_bindir}/vim-nox11
|
||||||
|
fi
|
||||||
|
|
||||||
%post -n gvim
|
%post -n gvim
|
||||||
|
%{_sbindir}/update-alternatives --install %{_bindir}/vim vim %{_bindir}/gvim 20
|
||||||
%icon_theme_cache_post
|
%icon_theme_cache_post
|
||||||
|
|
||||||
|
%preun -n gvim
|
||||||
|
if [ "$1" = 0 ] ; then
|
||||||
|
%{_sbindir}/update-alternatives --remove vim %{_bindir}/gvim
|
||||||
|
fi
|
||||||
|
|
||||||
%postun -n gvim
|
%postun -n gvim
|
||||||
%icon_theme_cache_postun
|
%icon_theme_cache_postun
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%config(noreplace) %{_sysconfdir}/vimrc
|
%config(noreplace) %{_sysconfdir}/vimrc
|
||||||
|
%ghost %{_sysconfdir}/alternatives/vim
|
||||||
|
%{_bindir}/vim-nox11
|
||||||
|
%{_bindir}/vim
|
||||||
# symlinks
|
# symlinks
|
||||||
/bin/vi
|
/bin/vi
|
||||||
/bin/vim
|
/bin/vim
|
||||||
@ -343,7 +367,6 @@ LC_ALL=en_US.UTF-8 make test
|
|||||||
%{_bindir}/rview
|
%{_bindir}/rview
|
||||||
%{_bindir}/rvim
|
%{_bindir}/rvim
|
||||||
%{_bindir}/vi
|
%{_bindir}/vi
|
||||||
%{_bindir}/vim
|
|
||||||
%{_bindir}/view
|
%{_bindir}/view
|
||||||
%{_bindir}/vimdiff
|
%{_bindir}/vimdiff
|
||||||
# additional binaries
|
# additional binaries
|
||||||
@ -470,6 +493,8 @@ LC_ALL=en_US.UTF-8 make test
|
|||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc runtime/doc/gui_x11.txt
|
%doc runtime/doc/gui_x11.txt
|
||||||
%ghost %config(missingok) %{_sysconfdir}/gvimrc
|
%ghost %config(missingok) %{_sysconfdir}/gvimrc
|
||||||
|
%ghost %{_sysconfdir}/alternatives/vim
|
||||||
|
%{_bindir}/vim
|
||||||
%{_bindir}/egview
|
%{_bindir}/egview
|
||||||
%{_bindir}/egvim
|
%{_bindir}/egvim
|
||||||
%{_bindir}/eview
|
%{_bindir}/eview
|
||||||
|
Loading…
Reference in New Issue
Block a user