vim.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. ##
  2. ## vim.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2016 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package versions
  24. %define V_vl 8.0
  25. %define V_vs 80
  26. %define V_pl 0100
  27. # package information
  28. Name: vim
  29. Summary: The Vi (Improved) Text Editor
  30. URL: http://www.vim.org/
  31. Vendor: Bram Moolenaar et al.
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: CORE
  35. Group: Editor
  36. License: Charityware
  37. Version: %{V_vl}.%{V_pl}
  38. Release: 20161124
  39. # package options
  40. %option with_features normal
  41. %option with_multibyte yes
  42. %option with_perl no
  43. %option with_python no
  44. %option with_tcl no
  45. %option with_ruby no
  46. %option with_shell no
  47. # list of sources
  48. Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{V_vl}.tar.bz2
  49. Source2: rc.vim
  50. Source3: vimrc
  51. Patch0: vim.patch
  52. Patch1: vim.patch.shell
  53. Patch101: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0001
  54. Patch102: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0002
  55. Patch103: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0003
  56. Patch104: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0004
  57. Patch105: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0005
  58. Patch106: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0006
  59. Patch107: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0007
  60. Patch108: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0008
  61. Patch109: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0009
  62. Patch110: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0010
  63. Patch111: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0011
  64. Patch112: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0012
  65. Patch113: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0013
  66. Patch114: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0014
  67. Patch115: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0015
  68. Patch116: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0016
  69. Patch117: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0017
  70. Patch118: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0018
  71. Patch119: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0019
  72. Patch120: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0020
  73. Patch121: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0021
  74. Patch122: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0022
  75. Patch123: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0023
  76. Patch124: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0024
  77. Patch125: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0025
  78. Patch126: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0026
  79. Patch127: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0027
  80. Patch128: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0028
  81. Patch129: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0029
  82. Patch130: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0030
  83. Patch131: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0031
  84. Patch132: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0032
  85. Patch133: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0033
  86. Patch134: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0034
  87. Patch135: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0035
  88. Patch136: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0036
  89. Patch137: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0037
  90. Patch138: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0038
  91. Patch139: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0039
  92. Patch140: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0040
  93. Patch141: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0041
  94. Patch142: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0042
  95. Patch143: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0043
  96. Patch144: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0044
  97. Patch145: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0045
  98. Patch146: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0046
  99. Patch147: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0047
  100. Patch148: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0048
  101. Patch149: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0049
  102. Patch150: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0050
  103. Patch151: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0051
  104. Patch152: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0052
  105. Patch153: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0053
  106. Patch154: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0054
  107. Patch155: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0055
  108. Patch156: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0056
  109. Patch157: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0057
  110. Patch158: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0058
  111. Patch159: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0059
  112. Patch160: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0060
  113. Patch161: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0061
  114. Patch162: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0062
  115. Patch163: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0063
  116. Patch164: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0064
  117. Patch165: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0065
  118. Patch166: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0066
  119. Patch167: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0067
  120. Patch168: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0068
  121. Patch169: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0069
  122. Patch170: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0070
  123. Patch171: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0071
  124. Patch172: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0072
  125. Patch173: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0073
  126. Patch174: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0074
  127. Patch175: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0075
  128. Patch176: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0076
  129. Patch177: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0077
  130. Patch178: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0078
  131. Patch179: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0079
  132. Patch180: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0080
  133. Patch181: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0081
  134. Patch182: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0082
  135. Patch183: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0083
  136. Patch184: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0084
  137. Patch185: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0085
  138. Patch186: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0086
  139. Patch187: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0087
  140. Patch188: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0088
  141. Patch189: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0089
  142. Patch190: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0090
  143. Patch191: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0091
  144. Patch192: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0092
  145. Patch193: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0093
  146. Patch194: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0094
  147. Patch195: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0095
  148. Patch196: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0096
  149. Patch197: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0097
  150. Patch198: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0098
  151. Patch199: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0099
  152. Patch200: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.0100
  153. # build information
  154. BuildPreReq: OpenPKG, openpkg >= 20160101, ncurses
  155. PreReq: OpenPKG, openpkg >= 20160101, ncurses
  156. %if "%{with_perl}" == "yes"
  157. BuildPreReq: perl
  158. PreReq: perl
  159. %endif
  160. %if "%{with_python}" == "yes"
  161. BuildPreReq: python
  162. PreReq: python
  163. %endif
  164. %if "%{with_tcl}" == "yes"
  165. BuildPreReq: tcl
  166. PreReq: tcl
  167. %endif
  168. %if "%{with_ruby}" == "yes"
  169. BuildPreReq: ruby
  170. PreReq: ruby
  171. %endif
  172. %if "%{with_shell}" == "yes"
  173. BuildPreReq: autoconf
  174. %endif
  175. %description
  176. Vim (Vi Improved) is a text editor that is upwards compatible
  177. with the classical Unix Vi. It can be used to edit any ASCII
  178. text. It is especially useful for editing programs. Vim offers
  179. a lot of enhancements not available in the traditional Vi. For
  180. example, Vim has multi level undo, multi windows and buffers, syntax
  181. highlighting, command line editing, filename completion, on-line
  182. help, and visual selection.
  183. %track
  184. prog vim = {
  185. version = %{V_vl}
  186. url = ftp://ftp.vim.org/pub/vim/unix/
  187. regex = vim-(\d+.\d+)\.tar\.(gz|bz2)
  188. }
  189. prog vim:patchlevel = {
  190. version = %{V_vl}.%{V_pl}
  191. url = ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/
  192. regex = (%{V_vl}\.\d+)
  193. }
  194. %prep
  195. # unpack base distribution parts
  196. %setup -q -c
  197. %patch -p0
  198. %if "%{with_shell}" == "yes"
  199. %patch -p0 -d vim%{V_vs} -P 1
  200. %endif
  201. # apply bundle patchsets
  202. # for patchset in 0001-1000; do
  203. # %{l_gzip} -d -c $RPM_SOURCE_DIR/%{V_vl}.$patchset.gz |\
  204. # %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  205. # done
  206. # apply remaining single patches
  207. i=1
  208. while [ $i -le %{V_pl} ]; do
  209. cat $RPM_SOURCE_DIR/%{V_vl}.`echo $i | awk '{ printf("%04d", $0); }'` |\
  210. %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  211. i=`expr $i + 1`
  212. done
  213. # adjust introduction text for OpenPKG branding
  214. %{l_shtool} subst \
  215. -e 's;Modified by;Packaged by;' \
  216. vim%{V_vs}/src/version.c
  217. # adjust paths to global configuration files
  218. %{l_shtool} subst \
  219. -e 's;^/\* \(#define SYS_VIMRC_FILE\).*$;\1 "%{l_prefix}/etc/vim/vimrc";' \
  220. -e 's;^/\* \(#define SYS_GVIMRC_FILE\).*$;\1 "%{l_prefix}/etc/vim/gvimrc";' \
  221. vim%{V_vs}/src/feature.h
  222. %if "%{with_python}" == "yes"
  223. # fix Python includes
  224. %{l_shtool} subst \
  225. -e 's;PYTHON_CFLAGS=.*$;PYTHON_CFLAGS="`python-config --includes`";' \
  226. vim%{V_vs}/src/auto/configure
  227. %endif
  228. %build
  229. # configure package
  230. cd vim%{V_vs}/src
  231. %if "%{with_shell}" == "yes"
  232. %{l_make} %{l_mflags} autoconf
  233. %endif
  234. CC="%{l_cc}" \
  235. CFLAGS="%{l_cflags -O}" \
  236. CPPFLAGS="%{l_cppflags}" \
  237. LDFLAGS="%{l_ldflags}" \
  238. GREP="grep" \
  239. ./configure \
  240. --prefix=%{l_prefix} \
  241. --mandir=%{l_prefix}/man \
  242. --with-local-dir=%{l_prefix} \
  243. --with-global-runtime=%{l_prefix}/lib/vim \
  244. --with-modified-by='%{l_openpkg_release}' \
  245. --with-tlib=ncurses \
  246. --without-x \
  247. --disable-gui \
  248. %if "%{with_features}" == "huge"
  249. --with-features=huge \
  250. %else
  251. %if "%{with_features}" == "big"
  252. --with-features=big \
  253. %else
  254. %if "%{with_features}" == "small"
  255. --with-features=small \
  256. %else
  257. --with-features=normal \
  258. %endif
  259. %endif
  260. %endif
  261. %if "%{with_multibyte}" == "yes"
  262. --enable-multibyte \
  263. %endif
  264. %if "%{with_perl}" == "yes"
  265. --enable-perlinterp \
  266. %else
  267. --disable-perlinterp \
  268. %endif
  269. %if "%{with_python}" == "yes"
  270. --enable-pythoninterp \
  271. --with-python-config-dir=%{l_prefix}/lib/python/config \
  272. %else
  273. --disable-pythoninterp \
  274. %endif
  275. %if "%{with_tcl}" == "yes"
  276. --enable-tclinterp \
  277. %else
  278. --disable-tclinterp \
  279. %endif
  280. %if "%{with_ruby}" == "yes"
  281. --enable-rubyinterp \
  282. %else
  283. --disable-rubyinterp \
  284. %endif
  285. --disable-nls
  286. %{l_shtool} subst \
  287. -e 's;^\(VIMRTDIR[^=]*=\).*;\1;' \
  288. Makefile
  289. # build package
  290. %{l_make} %{l_mflags -O}
  291. %install
  292. # perform package installation procedure
  293. ( cd vim%{V_vs}/src
  294. %{l_make} %{l_mflags} install \
  295. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  296. MANDIR=$RPM_BUILD_ROOT%{l_prefix}/man
  297. ) || exit $?
  298. # strip down installation hierarchy
  299. strip $RPM_BUILD_ROOT%{l_prefix}/bin/vim >/dev/null 2>&1 || true
  300. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/xxd
  301. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/xxd.1
  302. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/vim/tools
  303. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/vim/macros
  304. # add links for program runtime variants
  305. for link in vi ex rview rvim view vimdiff; do
  306. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  307. ln $RPM_BUILD_ROOT%{l_prefix}/bin/vim \
  308. $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  309. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  310. ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/vim.1 \
  311. $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  312. done
  313. # create installation area for addon packages
  314. %{l_shtool} mkdir -f -p -m 755 \
  315. $RPM_BUILD_ROOT%{l_prefix}/lib/vim
  316. # install run-command script
  317. %{l_shtool} mkdir -f -p -m 755 \
  318. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  319. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  320. %{SOURCE rc.vim} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  321. # install default configuration
  322. %{l_shtool} mkdir -f -p -m 755 \
  323. $RPM_BUILD_ROOT%{l_prefix}/etc/vim
  324. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  325. %{SOURCE vimrc} $RPM_BUILD_ROOT%{l_prefix}/etc/vim/
  326. # determine installation files
  327. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  328. %{l_files_std} \
  329. '%config %{l_prefix}/etc/vim/vimrc'
  330. %files -f files
  331. %clean
  332. %preun
  333. if [ $1 -eq 0 ]; then
  334. # remove a (usually empty) "helptags" file of addon packages
  335. rm -f $RPM_INSTALL_PREFIX/lib/vim/doc/tags >/dev/null 2>&1 || true
  336. fi