vim.spec 7.5 KB

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