vim.spec 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. ##
  2. ## vim.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package versions
  25. %define V_vl 7.0
  26. %define V_vs 70
  27. %define V_pl 17
  28. %define V_spl 20060509
  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: OpenPKG
  35. Distribution: OpenPKG
  36. Class: CORE
  37. Group: Editor
  38. License: Charityware
  39. Version: %{V_vl}.%{V_pl}
  40. Release: 20060518
  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. %option with_tcl no
  48. %option with_ruby no
  49. # list of sources
  50. Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{V_vl}.tar.bz2
  51. Source2: rc.vim
  52. Patch0: vim.patch
  53. Patch1: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.001
  54. Patch2: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.002
  55. Patch3: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.003
  56. Patch4: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.004
  57. Patch5: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.005
  58. Patch6: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.006
  59. Patch7: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.007
  60. Patch8: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.008
  61. Patch9: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.009
  62. Patch10: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.010
  63. Patch11: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.011
  64. Patch12: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.012
  65. Patch13: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.013
  66. Patch14: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.014
  67. Patch15: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.015
  68. Patch16: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.016
  69. Patch17: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}/%{V_vl}.017
  70. # build information
  71. Prefix: %{l_prefix}
  72. BuildRoot: %{l_buildroot}
  73. BuildPreReq: OpenPKG, openpkg >= 20040130
  74. PreReq: OpenPKG, openpkg >= 20040130
  75. %if "%{with_x11}" == "yes"
  76. BuildPreReq: X11, gtk
  77. PreReq: X11, gtk
  78. %endif
  79. %if "%{with_perl}" == "yes"
  80. BuildPreReq: perl
  81. PreReq: perl
  82. %endif
  83. %if "%{with_python}" == "yes"
  84. BuildPreReq: python
  85. PreReq: python
  86. %endif
  87. %if "%{with_tcl}" == "yes"
  88. BuildPreReq: tcl
  89. PreReq: tcl
  90. %endif
  91. %if "%{with_ruby}" == "yes"
  92. BuildPreReq: ruby
  93. PreReq: ruby
  94. %endif
  95. AutoReq: no
  96. AutoReqProv: no
  97. %description
  98. Vim (Vi Improved) is a text editor that is upwards compatible
  99. with the classical Unix Vi. It can be used to edit any ASCII
  100. text. It is especially useful for editing programs. Vim offers
  101. a lot of enhancements not available in the traditional Vi. For
  102. example, Vim has multi level undo, multi windows and buffers, syntax
  103. highlighting, command line editing, filename completion, on-line
  104. help, and visual selection.
  105. %track
  106. prog vim = {
  107. version = %{V_vl}
  108. url = ftp://ftp.vim.org/pub/vim/unix/
  109. regex = vim-(\d+.\d+)\.tar\.gz
  110. }
  111. prog vim:patchlevel = {
  112. version = %{V_vl}.0%{V_pl}
  113. url = ftp://ftp.vim.org/patches/%{V_vl}/
  114. regex = (\d+\.\d+\.\d+)
  115. }
  116. %prep
  117. # unpack base distribution parts
  118. %setup -q -c
  119. %patch -p0
  120. # apply remaining single patches
  121. i=1
  122. while [ $i -le %{V_pl} ]; do
  123. cat $RPM_SOURCE_DIR/%{V_vl}.`echo $i | awk '{ printf("%03d", $0); }'` |\
  124. %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  125. i=`expr $i + 1`
  126. done
  127. # reorder the terminal library search to make sure our ncurses is
  128. # not picked up too easily (because we do not want an explicit
  129. # dependency to it because of vim:CORE vs. ncurses:BASE).
  130. %{l_shtool} subst \
  131. -e 's;ncurses termlib termcap curses;termlib termcap ncurses curses;' \
  132. -e 's;\(.*TCL_DEFS=.*sed -e \)\(.\)\(.*\);\1\2/^[^-]/d\2 \2\3;' \
  133. vim%{V_vs}/src/auto/configure
  134. # adjust introduction text for OpenPKG branding
  135. %{l_shtool} subst \
  136. -e 's;Modified by;Packaged by;' \
  137. vim%{V_vs}/src/version.c
  138. %build
  139. # configure package
  140. cd vim%{V_vs}/src
  141. CC="%{l_cc}" \
  142. CFLAGS="%{l_cflags -O}" \
  143. CPPFLAGS="%{l_cppflags}" \
  144. LDFLAGS="%{l_ldflags}" \
  145. ./configure \
  146. --prefix=%{l_prefix} \
  147. --with-modified-by='%{l_openpkg_release}' \
  148. %if "%{with_x11}" == "yes"
  149. --with-x \
  150. --x-includes=`%{l_rc} --query x11_incdir` \
  151. --x-libraries=`%{l_rc} --query x11_libdir` \
  152. --enable-gui=gtk \
  153. --with-gtk-prefix=%{l_prefix} \
  154. --disable-gtktest \
  155. --without-gnome \
  156. %else
  157. --without-x \
  158. --disable-gui \
  159. %endif
  160. %if "%{with_features}" == "huge"
  161. --with-features=huge \
  162. %else
  163. %if "%{with_features}" == "big"
  164. --with-features=big \
  165. %else
  166. %if "%{with_features}" == "small"
  167. --with-features=small \
  168. %else
  169. --with-features=normal \
  170. %endif
  171. %endif
  172. %endif
  173. %if "%{with_multibyte}" == "yes"
  174. --enable-multibyte \
  175. %endif
  176. %if "%{with_perl}" == "yes"
  177. --enable-perlinterp \
  178. %endif
  179. %if "%{with_python}" == "yes"
  180. --enable-pythoninterp \
  181. %endif
  182. %if "%{with_tcl}" == "yes"
  183. --enable-tclinterp \
  184. %endif
  185. %if "%{with_ruby}" == "yes"
  186. --enable-rubyinterp \
  187. %endif
  188. --disable-nls
  189. %{l_shtool} subst \
  190. -e 's;^\(VIMRTDIR[^=]*=\).*;\1;' \
  191. Makefile
  192. # build package
  193. %{l_make} %{l_mflags -O}
  194. %install
  195. # perform package installation procedure
  196. rm -rf $RPM_BUILD_ROOT
  197. ( cd vim%{V_vs}/src
  198. %{l_make} %{l_mflags} install \
  199. prefix=$RPM_BUILD_ROOT%{l_prefix}
  200. ) || exit $?
  201. # strip down installation hierarchy
  202. strip $RPM_BUILD_ROOT%{l_prefix}/bin/vim >/dev/null 2>&1 || true
  203. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/xxd
  204. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/xxd.1
  205. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/vim/tools
  206. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/vim/macros
  207. # add links for program runtime variants
  208. for link in vi ex rview rvim view vimdiff; do
  209. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  210. ln $RPM_BUILD_ROOT%{l_prefix}/bin/vim \
  211. $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  212. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  213. ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/vim.1 \
  214. $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  215. done
  216. # install run-command script
  217. %{l_shtool} mkdir -f -p -m 755 \
  218. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  219. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  220. %{SOURCE rc.vim} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  221. # determine installation files
  222. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  223. %files -f files
  224. %clean
  225. rm -rf $RPM_BUILD_ROOT