vim.spec 7.5 KB

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