vim.spec 7.8 KB

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