vim.spec 6.8 KB

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