vim.spec 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. ##
  2. ## vim.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 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 14
  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: 20040724
  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. # build information
  69. Prefix: %{l_prefix}
  70. BuildRoot: %{l_buildroot}
  71. BuildPreReq: OpenPKG, openpkg >= 20040130
  72. PreReq: OpenPKG, openpkg >= 20040130
  73. %if "%{with_x11}" == "yes"
  74. BuildPreReq: X11, gtk
  75. PreReq: X11, gtk
  76. %endif
  77. %if "%{with_perl}" == "yes"
  78. BuildPreReq: perl
  79. PreReq: perl
  80. %endif
  81. %if "%{with_python}" == "yes"
  82. BuildPreReq: python
  83. PreReq: python
  84. %endif
  85. AutoReq: no
  86. AutoReqProv: no
  87. %description
  88. Vim (Vi Improved) is a text editor that is upwards compatible
  89. with the classical Unix Vi. It can be used to edit any ASCII
  90. text. It is especially useful for editing programs. Vim offers
  91. a lot of enhancements not available in the traditional Vi. For
  92. example, Vim has multi level undo, multi windows and buffers, syntax
  93. highlighting, command line editing, filename completion, on-line
  94. help, and visual selection.
  95. %track
  96. prog vim:patchlevel = {
  97. version = %{V_vl}.%{V_pl}
  98. url = ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/
  99. regex = (\d+\.\d+\.\d+)
  100. }
  101. prog vim:rt1 = {
  102. version = %{V_vl}
  103. url = ftp://ftp.vim.org/pub/vim/unix/
  104. regex = vim-(\d+.\d+)-rt1\.tar\.gz
  105. }
  106. prog vim:rt2 = {
  107. version = %{V_vl}
  108. url = ftp://ftp.vim.org/pub/vim/unix/
  109. regex = vim-(\d+.\d+)-rt2\.tar\.gz
  110. }
  111. prog vim:src1 = {
  112. version = %{V_vl}
  113. url = ftp://ftp.vim.org/pub/vim/unix/
  114. regex = vim-(\d+.\d+)-src1\.tar\.gz
  115. }
  116. prog vim:src2 = {
  117. version = %{V_vl}
  118. url = ftp://ftp.vim.org/pub/vim/unix/
  119. regex = vim-(\d+.\d+)-src2\.tar\.gz
  120. }
  121. %prep
  122. # unpack base distribution parts
  123. %setup -q -c
  124. %setup -q -T -D -a 1
  125. %setup -q -T -D -a 2
  126. %setup -q -T -D -a 3
  127. %patch -p0
  128. # apply initial jumbo patches
  129. # %{l_gzip} -d -c $RPM_SOURCE_DIR/%{V_vl}.1-100.gz |\
  130. # %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  131. # apply remaining single patches
  132. i=1
  133. while [ $i -le %{V_pl} ]; do
  134. cat $RPM_SOURCE_DIR/%{V_vl}.`echo $i | awk '{ printf("%03d", $0); }'` |\
  135. %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  136. i=`expr $i + 1`
  137. done
  138. # reorder the terminal library search to make sure our ncurses is
  139. # not picked up too easily (because we do not want an explicit
  140. # dependency to it because of vim:CORE vs. ncurses:BASE).
  141. %{l_shtool} subst \
  142. -e 's;ncurses termlib termcap curses;termlib termcap ncurses curses;' \
  143. vim%{V_vs}/src/auto/configure
  144. # adjust introduction text for OpenPKG branding
  145. %{l_shtool} subst \
  146. -e 's;Modified by;Packaged by;' \
  147. vim%{V_vs}/src/version.c
  148. %build
  149. # configure package
  150. cd vim%{V_vs}/src
  151. CC="%{l_cc}" \
  152. CFLAGS="%{l_cflags -O}" \
  153. CPPFLAGS="%{l_cppflags}" \
  154. LDFLAGS="%{l_ldflags}" \
  155. ./configure \
  156. --prefix=%{l_prefix} \
  157. --with-modified-by='%{l_openpkg_release}' \
  158. %if "%{with_x11}" == "yes"
  159. --with-x \
  160. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  161. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  162. --enable-gui=gtk \
  163. --with-gtk-prefix=%{l_prefix} \
  164. --disable-gtktest \
  165. --without-gnome \
  166. %else
  167. --without-x \
  168. --disable-gui \
  169. %endif
  170. %if "%{with_features}" == "huge"
  171. --with-features=huge \
  172. %else
  173. %if "%{with_features}" == "big"
  174. --with-features=big \
  175. %else
  176. %if "%{with_features}" == "small"
  177. --with-features=small \
  178. %else
  179. --with-features=normal \
  180. %endif
  181. %endif
  182. %endif
  183. %if "%{with_multibyte}" == "yes"
  184. --enable-multibyte \
  185. %endif
  186. %if "%{with_perl}" == "yes"
  187. --enable-perlinterp=%{l_prefix}/bin/perl \
  188. %endif
  189. %if "%{with_python}" == "yes"
  190. --enable-pythoninterp=%{l_prefix}/bin/python \
  191. %endif
  192. --disable-nls
  193. %{l_shtool} subst \
  194. -e 's;^\(VIMRTDIR[^=]*=\).*;\1;' \
  195. Makefile
  196. # build package
  197. %{l_make} %{l_mflags -O}
  198. %install
  199. # perform package installation procedure
  200. rm -rf $RPM_BUILD_ROOT
  201. ( cd vim%{V_vs}/src
  202. %{l_make} %{l_mflags} install \
  203. prefix=$RPM_BUILD_ROOT%{l_prefix}
  204. ) || exit $?
  205. # strip down installation hierarchy
  206. strip $RPM_BUILD_ROOT%{l_prefix}/bin/vim
  207. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/xxd
  208. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/xxd.1
  209. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/vim/tools
  210. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/vim/macros
  211. # add links for program runtime variants
  212. for link in vi ex rview rvim view vimdiff; do
  213. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  214. ln $RPM_BUILD_ROOT%{l_prefix}/bin/vim \
  215. $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  216. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  217. ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/vim.1 \
  218. $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  219. done
  220. # install run-command script
  221. %{l_shtool} mkdir -f -p -m 755 \
  222. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  223. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  224. %{SOURCE rc.vim} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  225. # determine installation files
  226. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  227. %files -f files
  228. %clean
  229. rm -rf $RPM_BUILD_ROOT