2 # spec file for package vim
4 # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
15 # Please submit bugfixes or comments via http://bugs.opensuse.org/
18 %define debug_package %{nil}
20 %define pkg_version 8.0
21 %define patchlevel 586
22 %define patchlevel_compact 586
23 %define VIM_SUBDIR vim80
24 %define site_runtimepath %{_datadir}/vim/site
25 %define make make VIMRCLOC=%{_sysconfdir} VIMRUNTIMEDIR=%{_datadir}/vim/current MAKE="make -e" %{?_smp_mflags}
29 Version: %{pkg_version}.%{patchlevel_compact}
33 Group: Productivity/Editors/Vi
34 Url: http://www.vim.org/
35 Source: https://github.com/vim/vim/archive/v%{pkg_version}.%{patchlevel}.tar.gz#/vim-%{pkg_version}.%{patchlevel}.tar.gz
37 Source99: %{name}-rpmlintrc
38 Source1001: vim.manifest
39 BuildRequires: autoconf
40 BuildRequires: db4-devel
42 BuildRequires: gettext-devel
43 BuildRequires: ncurses-devel
45 BuildRequires: pkgconfig
46 BuildRequires: python-devel
48 BuildRequires: libattr-devel
50 Requires(post): update-alternatives
51 Requires(postun): update-alternatives
52 Recommends: vim-data = %{version}-%{release}
54 Provides: vim-base = %{version}-%{release}
55 Obsoletes: vim-base < %{version}-%{release}
57 Requires(pre): update-alternatives
60 Vim (Vi IMproved) is an almost compatible version of the UNIX editor
61 vi. Almost every possible command can be performed using only ASCII
62 characters. Only the 'Q' command is missing (you do not need it). Many
63 new features have been added: multilevel undo, command line history,
64 file name completion, block operations, and editing of binary data.
68 # Used to be in vim-plugins package
69 Group: Productivity/Editors/Vi
70 Obsoletes: vim-plugin-matchit <= 1.13.2
71 Provides: vim-plugin-matchit = 1.13.2
75 This package contains optional runtime & syntax files for vim.
79 %setup -q -n %{name}-%{pkg_version}.%{patchlevel}
80 cp %{SOURCE3} %{SOURCE1001} .
83 # See also disable-unreliable-tests.patch
84 rm -f src/testdir/test_cmdline.*
85 rm -f src/testdir/test_channel.*
86 rm -f src/testdir/gen_opt_test.vim
87 rm -f src/testdir/test_options.*
88 rm -f src/testdir/test_terminal*
89 rm -f src/testdir/test_writefile.*
92 export CFLAGS="%{optflags} -Wall -pipe -fno-strict-aliasing"
93 export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/-D_FORTIFY_SOURCE=1}
95 export COMMON_OPTIONS="\
100 --with-vim-name=vim \
102 --with-view-name=view \
105 --with-features=huge \
106 --with-compiledby='http://www.tizen.org/' \
108 --with-global-runtime=%{site_runtimepath} \
109 --enable-luainterp=dynamic \
110 --enable-perlinterp=yes \
111 --enable-pythoninterp=dynamic \
112 --enable-python3interp=dynamic \
113 --enable-rubyinterp=dynamic"
120 %configure ${COMMON_OPTIONS} --disable-gui --disable-gpm --with-x=no
121 sed -i -e 's|define HAVE_DATE_TIME 1|undef HAVE_DATE_TIME|' src/auto/config.h
126 %makeinstall DESTDIR=%{buildroot} STRIP=:
127 # create icon directory to have the icons installed and convert them to all hicolor expected sizes.
128 for size in %{_datadir}/icons/hicolor/*[0-9]x[0-9]*; do
129 SIZE=$(echo $size | awk -Fx {'print $2}')
130 install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps
131 # rsvg-convert -h ${SIZE} -w ${SIZE} %{SOURCE24} -o %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps/gvim.png
133 install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
134 #install -m 0644 %{SOURCE24} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/gvim.svg
136 # the last installed binary is gvim. preserve it and
137 # fix its symlinks. e* was added here as it doesnt make much sense in
139 mv %{buildroot}%{_bindir}/vim %{buildroot}%{_bindir}/gvim
140 for f in egvim egview eview evim gex gvi gview gvimdiff rgview rgvim ; do
141 ln -s -vf gvim %{buildroot}%{_bindir}/$f
145 install -D -m 0755 vim-nox11 %{buildroot}%{_bindir}/vim-nox11
146 mkdir -p %{buildroot}%{_sysconfdir}/alternatives
147 ln -s -f %{_sysconfdir}/alternatives/vim %{buildroot}%{_bindir}/vim
150 ln -s -f vim %{buildroot}%{_bindir}/vi
151 ln -s -f vim %{buildroot}%{_bindir}/edit
152 ln -s -f vim %{buildroot}%{_bindir}/ex
155 mkdir -p %{buildroot}%{_mandir}/man1
156 ln -s -f vim.1.gz %{buildroot}%{_mandir}/man1/vi.1.gz
157 ln -s -f vim.1.gz %{buildroot}%{_mandir}/man1/ex.1.gz
160 # make the vim settings more generic
161 ln -s -f %{VIM_SUBDIR} %{buildroot}%{_datadir}/vim/current
164 install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/vimrc
166 # create site wide runtime directory
167 mkdir -p -m 0755 %{buildroot}%{site_runtimepath}/after
168 mkdir -m 0755 %{buildroot}%{site_runtimepath}/autoload
169 mkdir -m 0755 %{buildroot}%{site_runtimepath}/colors
170 mkdir -m 0755 %{buildroot}%{site_runtimepath}/doc
171 mkdir -m 0755 %{buildroot}%{site_runtimepath}/plugin
172 mkdir -m 0755 %{buildroot}%{site_runtimepath}/syntax
173 mkdir -m 0755 %{buildroot}%{site_runtimepath}/ftdetect
174 mkdir -m 0755 %{buildroot}%{site_runtimepath}/after/syntax
175 mkdir -m 0755 %{buildroot}%{_datadir}/vim/current/skeletons
176 mkdir -m 0755 %{buildroot}%{_sysconfdir}/skel
181 install -d -m 0755 %{buildroot}%{_docdir}/{,g}vim/
182 cp runtime/doc/uganda.txt LICENSE
185 README.txt README_src.txt README_unix.txt \
186 %{buildroot}%{_docdir}/vim/
188 # remove unecessary duplicate manpages
189 rm -rf %{buildroot}%{_mandir}/fr.ISO8859-1/
190 rm -rf %{buildroot}%{_mandir}/fr.UTF-8/
191 rm -rf %{buildroot}%{_mandir}/pl.ISO8859-2/
192 rm -rf %{buildroot}%{_mandir}/pl.UTF-8/
193 rm -rf %{buildroot}%{_mandir}/ru.KOI8-R/
194 rm -rf %{buildroot}%{_mandir}/it.ISO8859-1/
195 rm -rf %{buildroot}%{_mandir}/it.UTF-8/
197 # remove unnecessary files
198 rm -rf %{buildroot}%{_datadir}/applications/vim.desktop
199 rm -rf %{buildroot}%{_datadir}/icons/locolor
201 # and move russian manpages to a place where they can be found
202 mv %{buildroot}%{_mandir}/ru.UTF-8 %{buildroot}%{_mandir}/ru
205 # remove some c source files
206 rm -f %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/tools/*.c
207 rm -f %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/macros/maze/*.c
209 # Remove sample server to avoid python dependency
210 rm %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/tools/demoserver.py
212 # Create ghost files (see vim.conf)
213 mkdir -p %{buildroot}%{_localstatedir}/run/vi.recover
215 %fdupes -s %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/lang
216 %fdupes -s %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/tutor
217 %fdupes -s %{buildroot}%{_datadir}/vim/%{VIM_SUBDIR}/ftplugin
220 rm -f %{buildroot}%{_sysconfdir}/gvimrc
221 rm -f %{buildroot}%{_bindir}/egview
222 rm -f %{buildroot}%{_bindir}/egvim
223 rm -f %{buildroot}%{_bindir}/eview
224 rm -f %{buildroot}%{_bindir}/evim
225 rm -f %{buildroot}%{_bindir}/gex
226 rm -f %{buildroot}%{_bindir}/gvi
227 rm -f %{buildroot}%{_bindir}/gview
228 rm -f %{buildroot}%{_bindir}/gvim
229 rm -f %{buildroot}%{_bindir}/gvimdiff
230 rm -f %{buildroot}%{_bindir}/rgview
231 rm -f %{buildroot}%{_bindir}/rgvim
232 rm -f %{buildroot}%{_datadir}/applications/gvim.desktop
233 rm -f %{buildroot}%{_datadir}/icons/hicolor/*/apps/gvim.*
238 # vim does quite an extensive test relying on a full fledged terminal
239 # inside OBS, stdio is redirected to a serial console (where the build log
240 # is being recorded/extracted. Systemd set non-local tty by default to vt220
241 # in upcoming versions
243 # Reset the terminal scrolling region left behind by the testsuite
244 trap "printf '\e[r'" EXIT
245 # Look for "TEST FAILURE" in the build log
246 LC_ALL=en_US.UTF-8 make test
249 %{_sbindir}/update-alternatives --install %{_bindir}/vim vim %{_bindir}/vim-nox11 20
252 if [ ! -e %{_bindir}/vim-nox11 ] ; then
253 %{_sbindir}/update-alternatives --remove vim %{_bindir}/vim-nox11
258 %manifest %{name}.manifest
260 %defattr(-,root,root,-)
261 %config(noreplace) %{_sysconfdir}/vimrc
262 %ghost %{_sysconfdir}/alternatives/vim
273 # additional binaries
279 #%dir %{_mandir}/fr/man1/
280 #%{_mandir}/fr/man1/*
282 #%dir %{_mandir}/it/man1/
283 #%{_mandir}/it/man1/*
285 #%dir %{_mandir}/ru/man1/
286 #%{_mandir}/ru/man1/*
288 #%dir %{_mandir}/pl/man1/
289 #%{_mandir}/pl/man1/*
291 #%dir %{_mandir}/ja/man1/
292 #%{_mandir}/ja/man1/*
296 %{_datadir}/vim/current
297 %dir %{_datadir}/vim/
298 %dir %{_datadir}/vim/%{VIM_SUBDIR}/
299 %dir %{_datadir}/vim/%{VIM_SUBDIR}/autoload/
300 %dir %{_datadir}/vim/%{VIM_SUBDIR}/colors/
301 %dir %{_datadir}/vim/%{VIM_SUBDIR}/compiler/
302 %dir %{_datadir}/vim/%{VIM_SUBDIR}/doc/
303 %dir %{_datadir}/vim/%{VIM_SUBDIR}/ftplugin/
304 %dir %{_datadir}/vim/%{VIM_SUBDIR}/indent/
305 %dir %{_datadir}/vim/%{VIM_SUBDIR}/keymap/
306 %dir %{_datadir}/vim/%{VIM_SUBDIR}/lang/
307 %dir %{_datadir}/vim/%{VIM_SUBDIR}/macros/
308 %dir %{_datadir}/vim/%{VIM_SUBDIR}/pack/
309 %dir %{_datadir}/vim/%{VIM_SUBDIR}/plugin/
310 %dir %{_datadir}/vim/%{VIM_SUBDIR}/print/
311 %dir %{_datadir}/vim/%{VIM_SUBDIR}/spell/
312 %dir %{_datadir}/vim/%{VIM_SUBDIR}/syntax/
313 %dir %{_datadir}/vim/%{VIM_SUBDIR}/tools/
314 %dir %{_datadir}/vim/%{VIM_SUBDIR}/tutor/
315 %dir %{_datadir}/vim/%{VIM_SUBDIR}/skeletons/
316 %dir %{site_runtimepath}
317 %dir %{site_runtimepath}/autoload/
318 %dir %{site_runtimepath}/colors/
319 %dir %{site_runtimepath}/doc/
320 %dir %{site_runtimepath}/plugin/
321 %dir %{site_runtimepath}/syntax/
322 %dir %{site_runtimepath}/ftdetect/
323 %dir %{site_runtimepath}/after/
324 %dir %{site_runtimepath}/after/syntax/
326 %{_datadir}/vim/%{VIM_SUBDIR}/bugreport.vim
327 %{_datadir}/vim/%{VIM_SUBDIR}/defaults.vim
328 %{_datadir}/vim/%{VIM_SUBDIR}/evim.vim
329 %{_datadir}/vim/%{VIM_SUBDIR}/filetype.vim
330 %{_datadir}/vim/%{VIM_SUBDIR}/ftoff.vim
331 %{_datadir}/vim/%{VIM_SUBDIR}/ftplugin.vim
332 %{_datadir}/vim/%{VIM_SUBDIR}/ftplugof.vim
333 %{_datadir}/vim/%{VIM_SUBDIR}/indent.vim
334 %{_datadir}/vim/%{VIM_SUBDIR}/indoff.vim
335 %{_datadir}/vim/%{VIM_SUBDIR}/optwin.vim
336 %{_datadir}/vim/%{VIM_SUBDIR}/rgb.txt
337 %{_datadir}/vim/%{VIM_SUBDIR}/scripts.vim
338 %{_datadir}/vim/%{VIM_SUBDIR}/syntax/syntax.vim
339 #%{_datadir}/vim/%{VIM_SUBDIR}/skeletons/skeleton.spec
341 # THIS BREAKS THE BUILD: %{_datadir}/vim/current/tools/missing-vim-client
342 #%{_datadir}/vim/%{VIM_SUBDIR}/tools/missing-vim-client
345 %manifest %{name}.manifest
346 %defattr(-,root,root,-)
348 %{_datadir}/vim/%{VIM_SUBDIR}/autoload/*
349 %{_datadir}/vim/%{VIM_SUBDIR}/colors/*
350 %{_datadir}/vim/%{VIM_SUBDIR}/compiler/*
351 %{_datadir}/vim/%{VIM_SUBDIR}/doc/*
352 %{_datadir}/vim/%{VIM_SUBDIR}/ftplugin/*
353 %{_datadir}/vim/%{VIM_SUBDIR}/indent/*
354 %{_datadir}/vim/%{VIM_SUBDIR}/keymap/*
355 %{_datadir}/vim/%{VIM_SUBDIR}/lang/*
356 %{_datadir}/vim/%{VIM_SUBDIR}/macros/*
357 %{_datadir}/vim/%{VIM_SUBDIR}/pack/*
358 %{_datadir}/vim/%{VIM_SUBDIR}/plugin/*
359 %{_datadir}/vim/%{VIM_SUBDIR}/print/*
360 %{_datadir}/vim/%{VIM_SUBDIR}/spell/*
361 %{_datadir}/vim/%{VIM_SUBDIR}/syntax/*
362 %exclude %{_datadir}/vim/%{VIM_SUBDIR}/syntax/syntax.vim
363 #%{_datadir}/vim/%{VIM_SUBDIR}/tools/blink.c
364 %{_datadir}/vim/%{VIM_SUBDIR}/tools/ccfilter.1
365 #%{_datadir}/vim/%{VIM_SUBDIR}/tools/ccfilter.c
366 %{_datadir}/vim/%{VIM_SUBDIR}/tools/ccfilter_README.txt
367 %{_datadir}/vim/%{VIM_SUBDIR}/tools/efm_filter.pl
368 %{_datadir}/vim/%{VIM_SUBDIR}/tools/efm_filter.txt
369 %{_datadir}/vim/%{VIM_SUBDIR}/tools/efm_perl.pl
370 %{_datadir}/vim/%{VIM_SUBDIR}/tools/mve.awk
371 %{_datadir}/vim/%{VIM_SUBDIR}/tools/mve.txt
372 %{_datadir}/vim/%{VIM_SUBDIR}/tools/pltags.pl
373 %{_datadir}/vim/%{VIM_SUBDIR}/tools/README.txt
374 %{_datadir}/vim/%{VIM_SUBDIR}/tools/ref
375 %{_datadir}/vim/%{VIM_SUBDIR}/tools/shtags.1
376 %{_datadir}/vim/%{VIM_SUBDIR}/tools/shtags.pl
377 %{_datadir}/vim/%{VIM_SUBDIR}/tools/unicode.vim
378 %{_datadir}/vim/%{VIM_SUBDIR}/tools/vim132
379 %{_datadir}/vim/%{VIM_SUBDIR}/tools/vimm
380 %{_datadir}/vim/%{VIM_SUBDIR}/tools/vimspell.sh
381 %{_datadir}/vim/%{VIM_SUBDIR}/tools/vimspell.txt
382 %{_datadir}/vim/%{VIM_SUBDIR}/tools/vim_vs_net.cmd
383 #%{_datadir}/vim/%{VIM_SUBDIR}/tools/xcmdsrv_client.c
384 %{_datadir}/vim/%{VIM_SUBDIR}/tutor/*
385 %{_datadir}/vim/%{VIM_SUBDIR}/delmenu.vim
386 %{_datadir}/vim/%{VIM_SUBDIR}/gvimrc_example.vim
387 %{_datadir}/vim/%{VIM_SUBDIR}/menu.vim
388 %{_datadir}/vim/%{VIM_SUBDIR}/mswin.vim
389 %{_datadir}/vim/%{VIM_SUBDIR}/synmenu.vim
390 %{_datadir}/vim/%{VIM_SUBDIR}/vimrc_example.vim