[arch-commits] Commit in vim/trunk (PKGBUILD fetch_patches.sh vim.install)

Tobias Kieslich tobias at archlinux.org
Tue May 5 03:14:28 EDT 2009


    Date: Tuesday, May 5, 2009 @ 03:14:28
  Author: tobias
Revision: 37935

upgpkg: vim 7.2.166-1

Modified:
  vim/trunk/PKGBUILD
  vim/trunk/fetch_patches.sh
  vim/trunk/vim.install

------------------+
 PKGBUILD         |   67 ++++++++++++++++++++++++++++-------------------------
 fetch_patches.sh |   27 +++++++++++++--------
 vim.install      |   37 ++++++++++++++---------------
 3 files changed, 71 insertions(+), 60 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-05-05 07:12:29 UTC (rev 37934)
+++ PKGBUILD	2009-05-05 07:14:28 UTC (rev 37935)
@@ -3,61 +3,66 @@
 
 pkgname=vim
 _srcver=7.2
-_patchlevel=65
+_patchlevel=166
 pkgver=${_srcver}.${_patchlevel}
-pkgrel=1.1
-pkgdesc="a highly configurable, improved version of the vi text editor"
+pkgrel=1
+pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor'
 arch=(i686 x86_64)
 license=('custom:vim')
 url="http://www.vim.org"
-depends=("vi>=${pkgver}" 'perl' 'python' 'ruby' 'acl' 'gpm>=1.20.4' 'libxt')
-makedepends=('wget' 'sed' 'grep')
+groups=('base')
+depends=('gpm' 'coreutils')
+makedepends=('wget' 'sed' 'grep' 'gettext' 'perl')
+optdepends=('perl:    the runtime provides a view useful perl scripts')
 backup=(etc/vimrc)
 install=${pkgname}.install
 # we need the extra-stuff to get all patches applied smoothly
 source=(ftp://ftp.vim.org/pub/vim/unix/vim-${_srcver}.tar.bz2 \
         ftp://ftp.vim.org/pub/vim/extra/vim-${_srcver}-extra.tar.gz \
         ftp://ftp.vim.org/pub/vim/extra/vim-${_srcver}-lang.tar.gz \
-        fetch_patches.sh)
-md5sums=('f0901284b338e448bfd79ccca0041254' '35e04482f07c57221c9a751aaa3b8dac' \
-         'd8884786979e0e520c112faf2e176f05' 'a3b03cd44b8ed78a99850d4cbfaafe55')
+        fetch_patches.sh fetch_runtime.sh)
 
 build()
 {
+  _versiondir="vim"$(echo ${_srcver} | sed "s/\.//")
   # pull in patches from vim.org (or the src cache alternatively)
-  . ${startdir}/src/fetch_patches.sh
+  . ${srcdir}/fetch_patches.sh
+  . ${srcdir}/fetch_runtime.sh
   get_patches || return 1
-  cd ${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//")
+  cd ${srcdir}/${_versiondir}
   sed -i 's|^.*\(#define SYS_.*VIMRC_FILE.*"\) .*$|\1|' src/feature.h
+  sed -i 's|^.*\(#define VIMRC_FILE.*"\) .*$|\1|' src/feature.h
   # build party
   ./configure --prefix=/usr --localstatedir=/var/lib/vim --mandir=/usr/share/man \
     --with-compiledby=ArchLinux --with-features=big \
-    --with-x=yes --disable-gui \
-    --with-global-runtime=/usr/share/vim --with-vim-name=vim \
+    --enable-gpm --enable-acl --with-x=no --disable-gui \
     --enable-multibyte --enable-cscope \
-    --enable-perlinterp --enable-pythoninterp --enable-rubyinterp
+    --enable-perlinterp
+    #--with-global-runtime=/usr/share/vim --with-vim-name=vim \
   make || return 1
-  make  VIMRCLOC=/etc DESTDIR=${startdir}/pkg VIMRTDIR= install
-  cd ${startdir}/pkg/usr/bin
-  rm -f ex view rview xxd vimtutor
-  ln -s vitutor vimtutor
+  make  VIMRCLOC=/etc DESTDIR=${pkgdir} install
+  cd ${pkgdir}/usr/bin
+  rm ex view          # provided by (n)vi in core
+  mv vim vim-normal   # we create a vim-symlink on post_install
+  ln -sf vim-normal vim
+  # ... make g* related symlinks point directly to the actual binary
+  ln -sf vim-normal rview
+  ln -sf vim-normal rvim
+  ln -sf vim-normal vimdiff
 
-   # delete the manpages/symlinks provided by vi package
-  find ${startdir}/pkg/usr/share/man -type d -name 'man1' 2> /dev/null | \
+  # delete some manpages
+  find ${pkgdir}/usr/share/man -type d -name 'man1' 2> /dev/null | \
    while read mandir; do
     cd ${mandir}
-    mv vimdiff.1 vimdiff.org
-    rm -f *.1
-    ln -s rvi.1.gz rvim.1.gz
-    ln -s vi.1.gz vim.1.gz
-    ln -s vitutor.1.gz vimtutor.1.gz
-    mv vimdiff.org vimdiff.1
+    rm -f ex.1 view.1       # provided by (n)vi
+    rm -f evim.1            # this does not make sense in the console version
   done
 
-  # kill the nobackup parts
-  sed -i '/vms/,+4 d' ${startdir}/pkg/usr/share/vim/vimrc_example.vim
-  install -Dm644 ${startdir}/pkg/usr/share/vim/vimrc_example.vim \
-    ${startdir}/pkg/etc/vimrc
-  # clean all settings and controls -  served by vi package
-  rm -rf ${startdir}/pkg/usr/share/vim
+  _runtimedir="${pkgdir}/usr/share/vim/${_versiondir}/"
+  update_runtime
+  install -Dm644 ${_runtimedir}/vimrc_example.vim \
+    ${pkgdir}/etc/vimrc
+  install -dm755 ${pkgdir}/usr/share/licenses/vim
+  cd ${pkgdir}/usr/share/licenses/vim
+  ln -s ../../vim/${_versiondir}/doc/uganda.txt license.txt
 }

Modified: fetch_patches.sh
===================================================================
--- fetch_patches.sh	2009-05-05 07:12:29 UTC (rev 37934)
+++ fetch_patches.sh	2009-05-05 07:14:28 UTC (rev 37935)
@@ -1,8 +1,8 @@
 # the external logic for pulling in patches
 
 get_patches() {
-  _patchdir=${startdir}/src/patches
-  cd ${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//")
+  _patchdir=${srcdir}/patches
+  cd ${srcdir}/${_versiondir}
   if [ -d ${_patchdir} ]; then
     rm -rf ${_patchdir}
     echo -e "\tremove patches from old build"
@@ -17,11 +17,12 @@
   echo -e "\tfetching checksumfile for patches"
   wget ${_rpath}/MD5SUMS >/dev/null 2>&1
 
-  downloads=0
+  _downloads=0
   for _line in $(/bin/cat MD5SUMS); do
-    downloads=$((${downloads} + 1))
+    _file=$(echo $_line | cut -d ' ' -f3)
+    [ ${_file##*.} == "gz" ] && continue
+    _downloads=$((${_downloads} + 1))
     _md5=$(echo $_line | cut -d ' ' -f1)
-    _file=$(echo $_line | cut -d ' ' -f3)
     if [ -f ${SRCDEST}/vim-${_srcver}/${_file} ]; then
       echo -e "\thaving patch file:${_file}"
       cp ${SRCDEST}/vim-${_srcver}/${_file} ./
@@ -45,14 +46,20 @@
 
   ########
 
-  if [ ${downloads} != ${_patchlevel} ]; then
-    echo -e "Number of patches does not match the patchlevel!\nEdit the PKGBUILD accordingly!"
-    return 1
+  if [ ${_downloads} != ${_patchlevel} ]; then
+    echo ""
+    echo -e "\t\tWARNING!"
+    echo "You are not building the latest available version! A newer patchlevel"
+    echo "seems to be available. Please edit the PKGBUILD and add the latest"
+    echo "${_downloads} as pkgrel number!"
+    echo ""
+    sleep 10
   fi
   IFS=$_OLDIFS
   rm MD5SUMS
-  cd ${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//")
-  for _patch in $(/bin/ls ${_patchdir}); do
+  cd ${srcdir}/${_versiondir}
+  for _patchnum in $(/usr/bin/seq 1 ${_patchlevel}); do
+    _patch=${_srcver}.$(printf "%03d" ${_patchnum})
     patch -Np0 -i ${_patchdir}/${_patch} || return 1
   done
   rm -rf ${_patchdir}

Modified: vim.install
===================================================================
--- vim.install	2009-05-05 07:12:29 UTC (rev 37934)
+++ vim.install	2009-05-05 07:14:28 UTC (rev 37935)
@@ -1,37 +1,36 @@
 post_install() {
-  # if we have an existing gvim installation - relocate binaries and symlinks
-  if [ -f usr/bin/vim ] ; then
+  # if gvim is installed make vim a symlink to vim-big
+  if [ -f usr/bin/vim-big ] ; then
     cd usr/bin
-    rm -f view rview
-    ln -s vim view
-    ln -s vim rview
+    rm -f vim
+    ln -sf vim-big vim
     cd ${OLDPWD}
-    echo "Create vim related symlinks..."
+    echo "Create gvim related symlinks..."
   fi
-  echo -n "Updating vim help tags..."
-  usr/bin/vim --noplugins -u NONE -U NONE \
+  echo -n "Updating vi help tags..."
+  usr/bin/vi --noplugins -u NONE -U NONE \
     --cmd ":helptags usr/share/vim/doc" --cmd ":q" > /dev/null 2>&1
   echo "done."
 }
 
-pre_remove() {
-  cd usr/bin
-  rm -f view rview
-  if [ -f usr/bin/vi ] ; then
-    ln -s vi view
-    ln -s vi rview
-    echo "Create vi related symlinks..."
+post_remove() {
+  # By all dependencies in the world, that shall never happen, because
+  # gvim depends on vim ... but then there is always pacman -Rd ...
+
+  # if gvim is installed make vim a symlink to vim-big
+  if [ -f usr/bin/vim-big ] ; then
+    cd usr/bin
+    rm -f vim
+    ln -sf vim-big vim
+    cd ${OLDPWD}
+    echo "Create gvim related symlinks..."
   fi
-  cd ${OLDPWD}
 }
 
 post_upgrade() {
   post_install $1
 }
 
-pre_upgrade() {
-  pre_remove $2
-}
 
 op=$1
 shift



More information about the arch-commits mailing list