vim.spec 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. ##
  2. ## vim.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package versions
  26. %define V_vl 6.1
  27. %define V_vs 61
  28. %define V_pl 411
  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: The OpenPKG Project
  35. Distribution: OpenPKG [CORE]
  36. Group: Editor
  37. License: Charityware
  38. Version: %{V_vl}.%{V_pl}
  39. Release: 20030321
  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. # list of sources
  47. Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{V_vl}-src1.tar.gz
  48. Source1: ftp://ftp.vim.org/pub/vim/unix/vim-%{V_vl}-src2.tar.gz
  49. Source2: ftp://ftp.vim.org/pub/vim/unix/vim-%{V_vl}-rt1.tar.gz
  50. Source3: ftp://ftp.vim.org/pub/vim/unix/vim-%{V_vl}-rt2.tar.gz
  51. Source4: rc.vim
  52. Patch1: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.1-100.gz
  53. Patch2: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.101-200.gz
  54. Patch3: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.201-300.gz
  55. Patch4: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.301-400.gz
  56. Patch401: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.401
  57. Patch402: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.402
  58. Patch403: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.403
  59. Patch404: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.404
  60. Patch405: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.405
  61. Patch406: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.406
  62. Patch407: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.407
  63. Patch408: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.408
  64. Patch409: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.409
  65. Patch410: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.410
  66. Patch411: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.411
  67. # build information
  68. Prefix: %{l_prefix}
  69. BuildRoot: %{l_buildroot}
  70. BuildPreReq: OpenPKG, openpkg >= 20030103
  71. PreReq: OpenPKG, openpkg >= 20030103
  72. %if "%{with_x11}" == "yes"
  73. BuildPreReq: X11, gtk
  74. PreReq: X11, gtk
  75. %endif
  76. %if "%{with_perl}" == "yes"
  77. BuildPreReq: perl
  78. PreReq: perl
  79. %endif
  80. %if "%{with_python}" == "yes"
  81. BuildPreReq: python
  82. PreReq: python
  83. %endif
  84. AutoReq: no
  85. AutoReqProv: no
  86. %description
  87. Vim (Vi Improved) is a text editor that is upwards compatible with the
  88. classical Unix Vi. It can be used to edit any ASCII text. It is especially
  89. useful for editing programs. Vim offers a lot of enhancements not
  90. available in the traditional Vi. For example, Vim has multi level undo,
  91. multi windows and buffers, syntax highlighting, com- mand line editing,
  92. filename completion, on-line help, and visual selection.
  93. %prep
  94. %setup0 -q -c
  95. %setup1 -q -T -D -a 1
  96. %setup2 -q -T -D -a 2
  97. %setup3 -q -T -D -a 3
  98. %{l_gzip} -d -c $RPM_SOURCE_DIR/%{V_vl}.1-100.gz |\
  99. %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  100. %{l_gzip} -d -c $RPM_SOURCE_DIR/%{V_vl}.101-200.gz |\
  101. %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  102. %{l_gzip} -d -c $RPM_SOURCE_DIR/%{V_vl}.201-300.gz |\
  103. %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  104. %{l_gzip} -d -c $RPM_SOURCE_DIR/%{V_vl}.301-400.gz |\
  105. %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  106. i=401
  107. while [ $i -le %{V_pl} ]; do
  108. cat $RPM_SOURCE_DIR/%{V_vl}.`echo $i | awk '{ printf("%03d", $0); }'` |\
  109. %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  110. i=`expr $i + 1`
  111. done
  112. %build
  113. ( cd vim%{V_vs}/src
  114. CC="%{l_cc}" \
  115. CFLAGS="%{l_cflags -O}" \
  116. CPPFLAGS="%{l_cppflags}" \
  117. LDFLAGS="%{l_ldflags}" \
  118. ./configure \
  119. --prefix=%{l_prefix} \
  120. --with-tlib=termcap \
  121. %if "%{with_x11}" == "yes"
  122. --with-x \
  123. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  124. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  125. --enable-gui=gtk \
  126. --with-gtk-prefix=%{l_prefix} \
  127. --disable-gtktest \
  128. --without-gnome \
  129. %else
  130. --without-x \
  131. --disable-gui \
  132. %endif
  133. %if "%{with_features}" == "huge"
  134. --with-features=huge \
  135. %else
  136. %if "%{with_features}" == "big"
  137. --with-features=big \
  138. %else
  139. %if "%{with_features}" == "small"
  140. --with-features=small \
  141. %else
  142. --with-features=normal \
  143. %endif
  144. %endif
  145. %endif
  146. %if "%{with_multibyte}" == "yes"
  147. --enable-multibyte \
  148. %endif
  149. %if "%{with_perl}" == "yes"
  150. --enable-perlinterp=%{l_prefix}/bin/perl \
  151. %endif
  152. %if "%{with_python}" == "yes"
  153. --enable-pythoninterp=%{l_prefix}/bin/python \
  154. %endif
  155. --disable-nls
  156. %{l_make} %{l_mflags -O}
  157. )
  158. %install
  159. ( cd vim%{V_vs}/src
  160. rm -rf $RPM_BUILD_ROOT
  161. %{l_make} %{l_mflags} install \
  162. prefix=$RPM_BUILD_ROOT%{l_prefix}
  163. )
  164. strip $RPM_BUILD_ROOT%{l_prefix}/bin/vim
  165. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/xxd
  166. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/xxd.1
  167. for link in vi ex rview rvim view; do
  168. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  169. ln $RPM_BUILD_ROOT%{l_prefix}/bin/vim \
  170. $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  171. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  172. ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/vim.1 \
  173. $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  174. done
  175. %{l_shtool} mkdir -f -p -m 755 \
  176. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  177. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  178. %{SOURCE rc.vim} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  179. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  180. %files -f files
  181. %clean
  182. rm -rf $RPM_BUILD_ROOT