vim.spec 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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.2
  27. %define V_vs 62
  28. %define V_pl 6
  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: 20030603
  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}.001
  53. Patch2: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.002
  54. Patch3: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.003
  55. Patch4: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.004
  56. Patch5: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.005
  57. Patch6: ftp://ftp.vim.org/pub/vim/patches/%{V_vl}.006
  58. # build information
  59. Prefix: %{l_prefix}
  60. BuildRoot: %{l_buildroot}
  61. BuildPreReq: OpenPKG, openpkg >= 20030103
  62. PreReq: OpenPKG, openpkg >= 20030103
  63. %if "%{with_x11}" == "yes"
  64. BuildPreReq: X11, gtk
  65. PreReq: X11, gtk
  66. %endif
  67. %if "%{with_perl}" == "yes"
  68. BuildPreReq: perl
  69. PreReq: perl
  70. %endif
  71. %if "%{with_python}" == "yes"
  72. BuildPreReq: python
  73. PreReq: python
  74. %endif
  75. AutoReq: no
  76. AutoReqProv: no
  77. %description
  78. Vim (Vi Improved) is a text editor that is upwards compatible with the
  79. classical Unix Vi. It can be used to edit any ASCII text. It is especially
  80. useful for editing programs. Vim offers a lot of enhancements not
  81. available in the traditional Vi. For example, Vim has multi level undo,
  82. multi windows and buffers, syntax highlighting, com- mand line editing,
  83. filename completion, on-line help, and visual selection.
  84. %prep
  85. # unpack base distribution parts
  86. %setup0 -q -c
  87. %setup1 -q -T -D -a 1
  88. %setup2 -q -T -D -a 2
  89. %setup3 -q -T -D -a 3
  90. # apply initial jumbo patches
  91. # %{l_gzip} -d -c $RPM_SOURCE_DIR/%{V_vl}.1-100.gz |\
  92. # %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  93. # apply remaining single patches
  94. i=1
  95. while [ $i -le %{V_pl} ]; do
  96. cat $RPM_SOURCE_DIR/%{V_vl}.`echo $i | awk '{ printf("%03d", $0); }'` |\
  97. %{l_patch} -p0 -E -t -s >/dev/null 2>&1 || true
  98. i=`expr $i + 1`
  99. done
  100. %build
  101. # configure package
  102. cd vim%{V_vs}/src
  103. CC="%{l_cc}" \
  104. CFLAGS="%{l_cflags -O}" \
  105. CPPFLAGS="%{l_cppflags}" \
  106. LDFLAGS="%{l_ldflags}" \
  107. ./configure \
  108. --prefix=%{l_prefix} \
  109. --with-tlib=termcap \
  110. %if "%{with_x11}" == "yes"
  111. --with-x \
  112. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  113. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  114. --enable-gui=gtk \
  115. --with-gtk-prefix=%{l_prefix} \
  116. --disable-gtktest \
  117. --without-gnome \
  118. %else
  119. --without-x \
  120. --disable-gui \
  121. %endif
  122. %if "%{with_features}" == "huge"
  123. --with-features=huge \
  124. %else
  125. %if "%{with_features}" == "big"
  126. --with-features=big \
  127. %else
  128. %if "%{with_features}" == "small"
  129. --with-features=small \
  130. %else
  131. --with-features=normal \
  132. %endif
  133. %endif
  134. %endif
  135. %if "%{with_multibyte}" == "yes"
  136. --enable-multibyte \
  137. %endif
  138. %if "%{with_perl}" == "yes"
  139. --enable-perlinterp=%{l_prefix}/bin/perl \
  140. %endif
  141. %if "%{with_python}" == "yes"
  142. --enable-pythoninterp=%{l_prefix}/bin/python \
  143. %endif
  144. --disable-nls
  145. %{l_shtool} subst \
  146. -e 's;^\(VIMRTDIR[^=]*=\).*;\1;' \
  147. Makefile
  148. # build package
  149. %{l_make} %{l_mflags -O}
  150. %install
  151. # perform package installation procedure
  152. rm -rf $RPM_BUILD_ROOT
  153. ( cd vim%{V_vs}/src
  154. %{l_make} %{l_mflags} install \
  155. prefix=$RPM_BUILD_ROOT%{l_prefix} )
  156. # strip down installation hierarchy
  157. strip $RPM_BUILD_ROOT%{l_prefix}/bin/vim
  158. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/xxd
  159. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/xxd.1
  160. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/vim/tools
  161. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/vim/macros
  162. # add links for program runtime variants
  163. for link in vi ex rview rvim view vimdiff; do
  164. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  165. ln $RPM_BUILD_ROOT%{l_prefix}/bin/vim \
  166. $RPM_BUILD_ROOT%{l_prefix}/bin/$link
  167. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  168. ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/vim.1 \
  169. $RPM_BUILD_ROOT%{l_prefix}/man/man1/$link.1
  170. done
  171. # install run-command script
  172. %{l_shtool} mkdir -f -p -m 755 \
  173. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  174. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  175. %{SOURCE rc.vim} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  176. # determine installation files
  177. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  178. %files -f files
  179. %clean
  180. rm -rf $RPM_BUILD_ROOT