# # spec file for package vim # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define pkg_version 9.1 %define patchlevel 0470 %define patchlevel_compact %{patchlevel} %define VIM_SUBDIR vim91 %define site_runtimepath %{_datadir}/vim/site %define make make VIMRCLOC=%{_sysconfdir} VIMRUNTIMEDIR=%{_datadir}/vim/current MAKE="make -e" %{?_smp_mflags} %if 0%{?suse_version} > 1500 %bcond_without libalternatives %else %bcond_with libalternatives %endif %bcond_without python2 Name: vim Version: %{pkg_version}.%{patchlevel_compact} Release: 0 Summary: Vi IMproved License: Vim URL: https://www.vim.org/ Source: https://github.com/vim/vim/archive/v%{pkg_version}.%{patchlevel}.tar.gz#/vim-%{pkg_version}.%{patchlevel}.tar.gz Source3: suse.vimrc Source4: vimrc_example1 Source5: vimrc_example2 Source8: suse.gvimrc Source10: README.Japanese-XIM Source13: vitmp.c Source14: vitmp.1 Source15: vim132 Source19: gvim.desktop Source20: spec.skeleton Source21: spec.vim Source23: apparmor.vim # Generated using: epstopdf runtime/vimlogo.eps && pdf2svg runtime/vimlogo.pdf gvim.svg Source24: gvim.svg # Section Bitmap icons generated from gvim.svg using rsvg-convert Source25: gvim_24.png Source26: gvim_32.png Source27: gvim_48.png Source28: gvim_64.png Source29: gvim_96.png Source30: gvim_128.png Source31: gvim_256.png Source32: gvim_512.png # /Section Source99: %{name}-7.4-rpmlintrc Patch3: %{name}-7.4-disable_lang_no.patch Patch4: %{name}-7.3-gvimrc_fontset.patch Patch5: %{name}-7.4-highlight_fstab.patch Patch6: %{name}-7.3-sh_is_bash.patch Patch7: %{name}-7.3-filetype_ftl.patch Patch8: %{name}-7.3-help_tags.patch Patch9: %{name}-7.3-use_awk.patch Patch10: %{name}-7.3-name_vimrc.patch Patch11: %{name}-7.3-mktemp_tutor.patch Patch15: %{name}-7.4-filetype_apparmor.patch Patch18: %{name}-7.3-filetype_spec.patch Patch21: %{name}-7.3-filetype_changes.patch Patch22: %{name}-7.4-filetype_mine.patch Patch100: vim73-no-static-libpython.patch Patch101: vim-8.0.1568-defaults.patch Patch104: vim-8.2.2411-globalvimrc.patch BuildRequires: autoconf BuildRequires: db-devel BuildRequires: fdupes BuildRequires: gettext-devel BuildRequires: gpm-devel BuildRequires: libtool BuildRequires: perl BuildRequires: pkgconfig BuildRequires: ruby-devel BuildRequires: update-desktop-files BuildRequires: pkgconfig(form) BuildRequires: pkgconfig(formw) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(krb5) BuildRequires: pkgconfig(libacl) BuildRequires: pkgconfig(lua) BuildRequires: pkgconfig(menu) BuildRequires: pkgconfig(menuw) BuildRequires: pkgconfig(ncurses) BuildRequires: pkgconfig(ncurses++) BuildRequires: pkgconfig(ncurses++w) BuildRequires: pkgconfig(ncursesw) BuildRequires: pkgconfig(panel) BuildRequires: pkgconfig(panelw) BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(tic) BuildRequires: pkgconfig(tinfo) BuildRequires: pkgconfig(xt) Requires: vim-data-common = %{version}-%{release} Requires: xxd = %{version}-%{release} Recommends: vim-data = %{version}-%{release} Conflicts: vim-base < 8.2 Provides: vi Provides: vim-base = %{version}-%{release} Provides: vim-enhanced = %{version}-%{release} Provides: vim-python = %{version}-%{release} Obsoletes: vim-base < %{version}-%{release} Obsoletes: vim-enhanced < %{version}-%{release} Obsoletes: vim-python < %{version}-%{release} Provides: vim_client %{?libperl_requires} %if %{with libalternatives} Requires: alts %else Requires(post): update-alternatives Requires(postun): update-alternatives %endif %if %{with python2} BuildRequires: python2-devel %endif %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. %package data Summary: Data files needed for extended vim functionality Requires: vim-data-common = %{version}-%{release} # Used to be in vim-plugins package Obsoletes: vim-plugin-matchit <= 1.13.2 Provides: vim-plugin-matchit = 1.13.2 # conflicts with nginx own plugin Obsoletes: vim-plugin-nginx < %{version} Provides: vim-plugin-nginx = %{version} BuildArch: noarch %description data This package contains optional runtime & syntax files for vim. %package data-common Summary: Common Data files for vim & gvim BuildArch: noarch %description data-common This package contains basic runtime & syntax files for vim %package -n gvim Summary: A GUI for Vi Requires: gvim_client Requires: vim-data = %{version}-%{release} Requires: xxd = %{version}-%{release} Conflicts: gvim < 8.2 Provides: gvim-base = %{version}-%{release} Provides: gvim-enhanced = %{version}-%{release} Obsoletes: gvim-base < %{version}-%{release} Obsoletes: gvim-enhanced < %{version}-%{release} Provides: gvim_client Provides: vi Provides: vim_client %if %{with libalternatives} BuildRequires: alts Requires: alts %else Requires(post): update-alternatives Requires(postun): update-alternatives %endif %description -n gvim Package gvim contains the largest set of features of vim, which is graphical windows and language interpreter, like python, ruby, or perl. You need package vim for the help and other documentation too. If you want less features, you might want to install vim instead. %package small Summary: Vim with reduced features Requires: vim-data-common = %{version}-%{release} Provides: vi Provides: vim_client %if %{with libalternatives} BuildRequires: alts Requires: alts %else Requires(post): update-alternatives Requires(postun): update-alternatives %endif %description small Vim compiled with reduced feature set such as no script interpreters built in %package -n xxd Summary: A hex dump utility Conflicts: vim <= 9.0.1418 %description -n xxd xxd creates a hex dump of a given file or standard input. It can also convert a hex dump back to its original binary form. %prep %setup -q -n %{name}-%{pkg_version}.%{patchlevel} %patch -P 3 -p1 %patch -P 4 -p1 %patch -P 5 -p1 %patch -P 6 -p1 %patch -P 7 -p1 %patch -P 8 -p1 %patch -P 9 -p1 %patch -P 10 -p1 %patch -P 11 -p1 cp %{SOURCE23} runtime/syntax/apparmor.vim %patch -P 15 -p1 %patch -P 18 -p1 %patch -P 21 -p1 %patch -P 22 -p1 %patch -P 100 -p1 %patch -P 101 -p1 %patch -P 104 -p1 cp %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE8} %{SOURCE10} . %build export CFLAGS="%{optflags} -Wall -pipe -fno-strict-aliasing" export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/-D_FORTIFY_SOURCE=1} export COMMON_OPTIONS="\ --with-vim-name=vim \ --with-ex-name=ex \ --with-view-name=view \ --enable-cscope \ --enable-multibyte \ --with-compiledby='http://www.opensuse.org/' \ --with-tlib=tinfo \ --with-global-runtime=%{site_runtimepath} \ " # yeah kind of weird to call this small when we then use the # "normal" set. Calling the package vim-normal is weird though as # huge is our default. export SMALL_OPTIONS="\ $COMMON_OPTIONS \ --with-features=small \ --enable-luainterp=no \ --enable-pythoninterp=no \ --enable-perlinterp=no \ --enable-python3interp=no \ --enable-rubyinterp=no" export HUGE_OPTIONS="\ $COMMON_OPTIONS \ --with-features=huge \ --enable-luainterp=dynamic \ --enable-perlinterp=yes \ --enable-python3interp=dynamic \ --enable-rubyinterp=dynamic --enable-pythoninterp=%{?with_python2:yes}%{!?with_python2:no}" export GUI_OPTIONS="\ --disable-icon-cache-update \ --enable-xim \ --enable-fontset \ --enable-gui=gtk3" export NOGUI_OPTIONS="\ --disable-gui \ --disable-gpm \ --with-x=no \ " pushd src autoconf popd # build smaller vim %configure ${SMALL_OPTIONS} ${NOGUI_OPTIONS} sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h %make_build cp src/vim vim-small # build normal vim %make_build -j1 distclean %configure ${HUGE_OPTIONS} ${NOGUI_OPTIONS} sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h %make_build cp src/vim vim-nox11 # build gvim %make_build -j1 distclean %configure ${HUGE_OPTIONS} ${GUI_OPTIONS} sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h %make_build # # build vitmp gcc %{optflags} %{SOURCE13} -o vitmp %install %make_install STRIP=: # create icon directories and install the icons into it for SIZE in 24 32 48 64 96 128 256 512; do install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps install -m 0644 %{_sourcedir}/gvim_${SIZE}.png %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps/gvim.png done install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps install -m 0644 %{SOURCE24} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/gvim.svg # the last installed binary is gvim. preserve it mv %{buildroot}%{_bindir}/vim %{buildroot}%{_bindir}/gvim %if %{with libalternatives} for f in vimdiff ex view rview rvim; do rm %{buildroot}%{_bindir}/$f done %else # fix gvim symlinks. e* was added here as it doesnt make much sense in # console for f in egvim egview eview evim gex gvi gview gvimdiff rgview rgvim ; do ln -s -vf gvim %{buildroot}%{_bindir}/$f done %endif # install vim install -D -m 0755 vim-small %{buildroot}%{_bindir}/vim-small install -D -m 0755 vim-nox11 %{buildroot}%{_bindir}/vim-nox11 %if ! %{with libalternatives} mkdir -p %{buildroot}%{_sysconfdir}/alternatives ln -s -f %{_sysconfdir}/alternatives/vim %{buildroot}%{_bindir}/vim ln -s -f %{_sysconfdir}/alternatives/vi %{buildroot}%{_bindir}/vi %else for f in vi vim rvim evim eview egview view rview vimdiff edit ex egvim gex gvi gview gvimdiff rgview rgvim ; do ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/$f mkdir -p %{buildroot}%{_datadir}/libalternatives/$f done for f in vi vim rvim view rview vimdiff edit ex; do cat > %{buildroot}%{_datadir}/libalternatives/$f/20.conf < %{buildroot}%{_datadir}/libalternatives/$f/30.conf < %{buildroot}%{_datadir}/libalternatives/$f/19.conf <