vim.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. ##
  2. ## vim.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2005 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package versions
  26. %define V_vl 6.3
  27. %define V_vs 63
  28. %define V_pl 67
  29. # package information
  30. Name: vim
  31. Summary: The Vi (Improved) Text Editor
  32. URL: http://www.vim.org/
  33. Vendor: Bram Moolenaar et al.
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG
  36. Class: CORE
  37. Group: Editor
  38. License: Charityware
  39. Version: %{V_vl}.%{V_pl}
  40. Release: 20050319
  41. # package options
  42. %option with_x11 no
  43. %option with_features normal
  44. %option with_multibyte no
  45. %option with_perl no
  46. %option with_python no
  47. # list of sources
  48. Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{V_vl}-src1.tar.gz
  49. Source1: ftp://ftp.vim.org/pub/vim/unix/vim-%{V_vl}-src2.tar.gz
  50. Source2: ftp://ftp.vim.org/pub/vim/unix/vim-%{V_vl}-rt1.tar.gz
  51. Source3: ftp://ftp.vim.org/pub/vim/unix/vim-%{V_vl}-rt2.tar.gz
  52. Source4: rc.vim
  53. Patch0: vim.patch
  54. Patch1: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.001
  55. Patch2: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.002
  56. Patch3: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.003
  57. Patch4: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.004
  58. Patch5: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.005
  59. Patch6: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.006
  60. Patch7: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.007
  61. Patch8: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.008
  62. Patch9: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.009
  63. Patch10: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.010
  64. Patch11: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.011
  65. Patch12: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.012
  66. Patch13: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.013
  67. Patch14: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.014
  68. Patch15: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.015
  69. Patch16: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.016
  70. Patch17: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.017
  71. Patch18: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.018
  72. Patch19: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.019
  73. Patch20: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.020
  74. Patch21: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.021
  75. Patch22: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.022
  76. Patch23: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.023
  77. Patch24: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.024
  78. Patch25: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.025
  79. Patch26: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.026
  80. Patch27: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.027
  81. Patch28: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.028
  82. Patch29: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.029
  83. Patch30: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.030
  84. Patch31: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.031
  85. Patch32: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.032
  86. Patch33: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.033
  87. Patch34: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.034
  88. Patch35: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.035
  89. Patch36: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.036
  90. Patch37: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.037
  91. Patch38: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.038
  92. Patch39: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.039
  93. Patch40: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.040
  94. Patch41: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.041
  95. Patch42: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.042
  96. Patch43: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.043
  97. Patch44: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.044
  98. Patch45: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.045
  99. Patch46: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.046
  100. Patch47: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.047
  101. Patch48: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.048
  102. Patch49: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.049
  103. Patch50: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.050
  104. Patch51: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.051
  105. Patch52: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.052
  106. Patch53: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.053
  107. Patch54: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.054
  108. Patch55: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.055
  109. Patch56: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.056
  110. Patch57: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.057
  111. Patch58: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.058
  112. Patch59: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.059
  113. Patch60: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.060
  114. Patch61: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.061
  115. Patch62: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.062
  116. Patch63: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.063
  117. Patch64: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.064
  118. Patch65: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.065
  119. Patch66: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.066
  120. Patch67: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.067
  121. # build information
  122. Prefix: %{l_prefix}
  123. BuildRoot: %{l_buildroot}
  124. BuildPreReq: OpenPKG, openpkg >= 20040130
  125. PreReq: OpenPKG, openpkg >= 20040130
  126. %if "%{with_x11}" == "yes"
  127. BuildPreReq: X11, gtk
  128. PreReq: X11, gtk
  129. %endif
  130. %if "%{with_perl}" == "yes"
  131. BuildPreReq: perl
  132. PreReq: perl
  133. %endif
  134. %if "%{with_python}" == "yes"
  135. BuildPreReq: python
  136. PreReq: python
  137. %endif
  138. AutoReq: no
  139. AutoReqProv: no
  140. %description
  141. Vim (Vi Improved) is a text editor that is upwards compatible
  142. with the classical Unix Vi. It can be used to edit any ASCII
  143. text. It is especially useful for editing programs. Vim offers
  144. a lot of enhancements not available in the traditional Vi. For
  145. example, Vim has multi level undo, multi windows and buffers, syntax
  146. highlighting, command line editing, filename completion, on-line
  147. help, and visual selection.
  148. %track
  149. prog vim:patchlevel = {
  150. version = %{V_vl}.0%{V_pl}
  151. url = ftp://ftp.de.vim.org/patches/%{V_vl}/
  152. regex = (\d+\.\d+\.\d+)
  153. }
  154. prog vim:rt1 = {
  155. version = %{V_vl}
  156. url = ftp://ftp.vim.org/pub/vim/unix/
  157. regex = vim-(\d+.\d+)-rt1\.tar\.gz
  158. }
  159. prog vim:rt2 = {
  160. version = %{V_vl}
  161. url = ftp://ftp.vim.org/pub/vim/unix/
  162. regex = vim-(\d+.\d+)-rt2\.tar\.gz
  163. }
  164. prog vim:src1 = {
  165. version = %{V_vl}
  166. url = ftp://ftp.vim.org/pub/vim/unix/
  167. regex = vim-(\d+.\d+)-src1\.tar\.gz
  168. }
  169. prog vim:src2 = {
  170. version = %{V_vl}
  171. url = ftp://ftp.vim.org/pub/vim/unix/
  172. regex = vim-(\d+.\d+)-src2\.tar\.gz
  173. }
  174. %prep
  175. # unpack base distribution parts
  176. %setup -q -c
  177. %setup -q -T -D -a 1
  178. %setup -q -T -D -a 2
  179. %setup -q -T -D -a 3
  180. %patch -p0
  181. # apply initial jumbo patches
  182. # %{l_gzip} -d -c $RPM_SOURCE_DIR/%{V_vl}.1-100.gz |\
  183. # %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  184. # apply remaining single patches
  185. i=1
  186. while [ $i -le %{V_pl} ]; do
  187. cat $RPM_SOURCE_DIR/%{V_vl}.`echo $i | awk '{ printf("%03d", $0); }'` |\
  188. %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  189. i=`expr $i + 1`
  190. done
  191. # reorder the terminal library search to make sure our ncurses is
  192. # not picked up too easily (because we do not want an explicit
  193. # dependency to it because of vim:CORE vs. ncurses:BASE).
  194. %{l_shtool} subst \
  195. -e 's;ncurses termlib termcap curses;termlib termcap ncurses curses;' \
  196. vim%{V_vs}/src/auto/configure
  197. # adjust introduction text for OpenPKG branding
  198. %{l_shtool} subst \
  199. -e 's;Modified by;Packaged by;' \
  200. vim%{V_vs}/src/version.c
  201. %build
  202. # configure package
  203. cd vim%{V_vs}/src
  204. CC="%{l_cc}" \
  205. CFLAGS="%{l_cflags -O}" \
  206. CPPFLAGS="%{l_cppflags}" \
  207. LDFLAGS="%{l_ldflags}" \
  208. ./configure \
  209. --prefix=%{l_prefix} \
  210. --with-modified-by='%{l_openpkg_release}' \
  211. %if "%{with_x11}" == "yes"
  212. --with-x \
  213. --x-includes=`%{l_rc} --query x11_incdir` \
  214. --x-libraries=`%{l_rc} --query x11_libdir` \
  215. --enable-gui=gtk \
  216. --with-gtk-prefix=%{l_prefix} \
  217. --disable-gtktest \
  218. --without-gnome \
  219. %else
  220. --without-x \
  221. --disable-gui \
  222. %endif
  223. %if "%{with_features}" == "huge"
  224. --with-features=huge \
  225. %else
  226. %if "%{with_features}" == "big"
  227. --with-features=big \
  228. %else
  229. %if "%{with_features}" == "small"
  230. --with-features=small \
  231. %else
  232. --with-features=normal \
  233. %endif
  234. %endif
  235. %endif
  236. %if "%{with_multibyte}" == "yes"
  237. --enable-multibyte \
  238. %endif
  239. %if "%{with_perl}" == "yes"
  240. --enable-perlinterp=%{l_prefix}/bin/perl \
  241. %endif
  242. %if "%{with_python}" == "yes"
  243. --enable-pythoninterp=%{l_prefix}/bin/python \
  244. %endif
  245. --disable-nls
  246. %{l_shtool} subst \
  247. -e 's;^\(VIMRTDIR[^=]*=\).*;\1;' \
  248. Makefile
  249. # build package
  250. %{l_make} %{l_mflags -O}
  251. %install
  252. # perform package installation procedure
  253. rm -rf $RPM_BUILD_ROOT
  254. ( cd vim%{V_vs}/src
  255. %{l_make} %{l_mflags} install \
  256. prefix=$RPM_BUILD_ROOT%{l_prefix}
  257. ) || exit $?
  258. # strip down installation hierarchy
  259. strip $RPM_BUILD_ROOT%{l_prefix}/bin/vim
  260. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/xxd
  261. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/xxd.1
  262. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/vim/tools
  263. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/vim/macros
  264. # add links for program runtime variants
  265. for link in vi ex rview rvim view vimdiff; do
  266. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  267. ln $RPM_BUILD_ROOT%{l_prefix}/bin/vim \
  268. $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  269. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  270. ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/vim.1 \
  271. $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  272. done
  273. # install run-command script
  274. %{l_shtool} mkdir -f -p -m 755 \
  275. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  276. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  277. %{SOURCE rc.vim} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  278. # determine installation files
  279. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  280. %files -f files
  281. %clean
  282. rm -rf $RPM_BUILD_ROOT