Dominique Leuenberger 2018-01-19 10:49:47 +00:00 committed by Git OBS Bridge
commit b38d28de4d
2 changed files with 28 additions and 20 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Jan 17 11:18:07 UTC 2018 - tchvatal@suse.com
- Sort with spec-cleaner
- Add conditional to build with python2 in order to build with py3
only enviroment
- Convert dependencies to pkgconfig style
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jan 8 11:32:31 UTC 2018 - idonmez@suse.com Mon Jan 8 11:32:31 UTC 2018 - idonmez@suse.com

View File

@ -22,6 +22,7 @@
%define VIM_SUBDIR vim80 %define VIM_SUBDIR vim80
%define site_runtimepath %{_datadir}/vim/site %define site_runtimepath %{_datadir}/vim/site
%define make make VIMRCLOC=%{_sysconfdir} VIMRUNTIMEDIR=%{_datadir}/vim/current MAKE="make -e" %{?_smp_mflags} %define make make VIMRCLOC=%{_sysconfdir} VIMRUNTIMEDIR=%{_datadir}/vim/current MAKE="make -e" %{?_smp_mflags}
%bcond_without python2
Name: vim Name: vim
Version: %{pkg_version}.%{patchlevel_compact} Version: %{pkg_version}.%{patchlevel_compact}
Release: 0 Release: 0
@ -65,24 +66,26 @@ BuildRequires: db-devel
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: gettext-devel BuildRequires: gettext-devel
BuildRequires: gpm-devel BuildRequires: gpm-devel
BuildRequires: gtk3-devel
BuildRequires: krb5-mini BuildRequires: krb5-mini
BuildRequires: libacl-devel BuildRequires: libacl-devel
BuildRequires: lua-devel
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: perl BuildRequires: perl
BuildRequires: pkgconfig BuildRequires: pkgconfig
%if %{with python2}
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python3-devel %endif
# Needed to convert svg to png # Needed to convert svg to png
BuildRequires: rsvg-view BuildRequires: rsvg-view
BuildRequires: ruby-devel BuildRequires: ruby-devel
BuildRequires: update-desktop-files BuildRequires: update-desktop-files
PreReq: fileutils BuildRequires: pkgconfig(gtk+-3.0)
PreReq: sh-utils BuildRequires: pkgconfig(lua)
BuildRequires: pkgconfig(python3)
BuildRequires: pkgconfig(xt)
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun): update-alternatives
Recommends: vim-data = %{version}-%{release} Recommends: vim-data = %{version}-%{release}
Conflicts: vim-base < 8.0
Provides: vi Provides: vi
Provides: vim-base = %{version}-%{release} Provides: vim-base = %{version}-%{release}
Provides: vim-enhanced = %{version}-%{release} Provides: vim-enhanced = %{version}-%{release}
@ -91,12 +94,7 @@ Obsoletes: vim-base < %{version}-%{release}
Obsoletes: vim-enhanced < %{version}-%{release} Obsoletes: vim-enhanced < %{version}-%{release}
Obsoletes: vim-python < %{version}-%{release} Obsoletes: vim-python < %{version}-%{release}
Provides: vim_client Provides: vim_client
Conflicts: vim-base < 8.0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?libperl_requires} %{?libperl_requires}
%if 0%{?suse_version} > 1200
BuildRequires: pkgconfig(xt)
%endif
%description %description
Vim (Vi IMproved) is an almost compatible version of the UNIX editor Vim (Vi IMproved) is an almost compatible version of the UNIX editor
@ -123,6 +121,7 @@ Requires: gvim_client
Requires: vim-data = %{version}-%{release} Requires: vim-data = %{version}-%{release}
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun): update-alternatives
Conflicts: gvim < 8.0
Provides: gvim-base = %{version}-%{release} Provides: gvim-base = %{version}-%{release}
Provides: gvim-enhanced = %{version}-%{release} Provides: gvim-enhanced = %{version}-%{release}
Obsoletes: gvim-base < %{version}-%{release} Obsoletes: gvim-base < %{version}-%{release}
@ -130,7 +129,6 @@ Obsoletes: gvim-enhanced < %{version}-%{release}
Provides: gvim_client Provides: gvim_client
Provides: vi Provides: vi
Provides: vim_client Provides: vim_client
Conflicts: gvim < 8.0
%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 +187,15 @@ export COMMON_OPTIONS="\
--with-global-runtime=%{site_runtimepath} \ --with-global-runtime=%{site_runtimepath} \
--enable-luainterp=dynamic \ --enable-luainterp=dynamic \
--enable-perlinterp=yes \ --enable-perlinterp=yes \
--enable-pythoninterp=dynamic \
--enable-python3interp=dynamic \ --enable-python3interp=dynamic \
--enable-rubyinterp=dynamic" --enable-rubyinterp=dynamic"
%if %{with python2}
COMMON_OPTIONS="${COMMON_OPTIONS} --enable-pythoninterp=yes"
%else
COMMON_OPTIONS="${COMMON_OPTIONS} --enable-pythoninterp=no"
%endif
export GUI_OPTIONS="\ export GUI_OPTIONS="\
--disable-icon-cache-update \ --disable-icon-cache-update \
--enable-xim \ --enable-xim \
@ -210,7 +213,7 @@ make %{?_smp_mflags}
cp src/vim vim-nox11 cp src/vim vim-nox11
# build gvim # build gvim
make distclean make %{?_smp_mflags} distclean
%configure ${COMMON_OPTIONS} ${GUI_OPTIONS} %configure ${COMMON_OPTIONS} ${GUI_OPTIONS}
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}
@ -220,7 +223,7 @@ make %{?_smp_mflags}
gcc %{optflags} %{SOURCE13} -o vitmp gcc %{optflags} %{SOURCE13} -o vitmp
%install %install
%makeinstall STRIP=: %make_install STRIP=:
# create icon directory to have the icons installed and convert them to all hicolor expected sizes. # create icon directory to have the icons installed and convert them to all hicolor expected sizes.
for size in %{_datadir}/icons/hicolor/*[0-9]x[0-9]*; do for size in %{_datadir}/icons/hicolor/*[0-9]x[0-9]*; do
SIZE=$(echo $size | awk -Fx {'print $2}') SIZE=$(echo $size | awk -Fx {'print $2}')
@ -342,10 +345,10 @@ export TERM=linux
trap "printf '\e[r'" EXIT trap "printf '\e[r'" EXIT
# Look for "TEST FAILURE" in the build log # Look for "TEST FAILURE" in the build log
%ifarch ppc ppc64 ppc64le %ifarch ppc ppc64 ppc64le
LC_ALL=en_US.UTF-8 make test || { echo "Ignore transient errors for PowerPC. boo#1072651"; } LC_ALL=en_US.UTF-8 make -j1 test || { echo "Ignore transient errors for PowerPC. boo#1072651"; }
%else %else
make test make -j1 test
LC_ALL=en_US.UTF-8 make test LC_ALL=en_US.UTF-8 make -j1 test
%endif %endif
%post %post
@ -367,7 +370,6 @@ fi
%icon_theme_cache_postun %icon_theme_cache_postun
%files %files
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/vimrc %config(noreplace) %{_sysconfdir}/vimrc
%ghost %{_sysconfdir}/alternatives/vim %ghost %{_sysconfdir}/alternatives/vim
%{_bindir}/vim-nox11 %{_bindir}/vim-nox11
@ -457,7 +459,6 @@ fi
%{_datadir}/vim/%{VIM_SUBDIR}/tools/missing-vim-client %{_datadir}/vim/%{VIM_SUBDIR}/tools/missing-vim-client
%files data %files data
%defattr(-,root,root,-)
# data files # data files
%{_datadir}/vim/%{VIM_SUBDIR}/autoload/* %{_datadir}/vim/%{VIM_SUBDIR}/autoload/*
%{_datadir}/vim/%{VIM_SUBDIR}/colors/* %{_datadir}/vim/%{VIM_SUBDIR}/colors/*
@ -504,7 +505,6 @@ fi
%{_datadir}/vim/%{VIM_SUBDIR}/vimrc_example.vim %{_datadir}/vim/%{VIM_SUBDIR}/vimrc_example.vim
%files -n gvim %files -n gvim
%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 %ghost %{_sysconfdir}/alternatives/vim