[arch-commits] Commit in vim/repos (7 files)

Tobias Kieslich tobias at archlinux.org
Mon Jul 20 03:07:19 UTC 2009


    Date: Sunday, July 19, 2009 @ 23:07:19
  Author: tobias
Revision: 46751

Merged revisions 37935,37948,43545,43551,46736 via svnmerge from 
svn+ssh://svn.archlinux.org/srv/svn-packages/vim/trunk

........
  r37935 | tobias | 2009-05-05 00:14:28 -0700 (Tue, 05 May 2009) | 1 line
  
  upgpkg: vim 7.2.166-1
........
  r37948 | tobias | 2009-05-05 10:13:36 -0700 (Tue, 05 May 2009) | 2 lines
  
  Added the runtime fetcher which used to be part of vi
........
  r43545 | tobias | 2009-06-24 22:39:29 -0700 (Wed, 24 Jun 2009) | 1 line
  
  upgpkg: vim 7.2.218-1
........
  r43551 | tobias | 2009-06-24 23:54:53 -0700 (Wed, 24 Jun 2009) | 1 line
  
  upgpkg: vim 7.2.218-1
........
  r46736 | tobias | 2009-07-19 18:22:28 -0700 (Sun, 19 Jul 2009) | 1 line
  
  upgpkg: vim 7.2.234-1
........

Added:
  vim/repos/extra-x86_64/archlinux.vim
    (from rev 46736, vim/trunk/archlinux.vim)
  vim/repos/extra-x86_64/fetch_runtime.sh
    (from rev 46736, vim/trunk/fetch_runtime.sh)
  vim/repos/extra-x86_64/vimrc
    (from rev 46736, vim/trunk/vimrc)
Modified:
  vim/repos/extra-x86_64/	(properties)
  vim/repos/extra-x86_64/PKGBUILD
  vim/repos/extra-x86_64/fetch_patches.sh
  vim/repos/extra-x86_64/vim.install

------------------+
 PKGBUILD         |   68 ++++++++++++++++--------------
 archlinux.vim    |   28 ++++++++++++
 fetch_patches.sh |   27 +++++++-----
 fetch_runtime.sh |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 vim.install      |   37 ++++++++--------
 vimrc            |   16 +++++++
 6 files changed, 233 insertions(+), 60 deletions(-)


Property changes on: vim/repos/extra-x86_64
___________________________________________________________________
Modified: svnmerge-integrated
   - /vim/trunk:1-20955
   + /vim/trunk:1-46750
Deleted: svn:mergeinfo
   - 

Modified: extra-x86_64/PKGBUILD
===================================================================
--- extra-x86_64/PKGBUILD	2009-07-20 03:00:24 UTC (rev 46750)
+++ extra-x86_64/PKGBUILD	2009-07-20 03:07:19 UTC (rev 46751)
@@ -3,61 +3,67 @@
 
 pkgname=vim
 _srcver=7.2
-_patchlevel=65
+_patchlevel=234
 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')
+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 vimrc archlinux.vim)
 
 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
+  cd ${srcdir}/${_versiondir}
+  install -Dm644 ${srcdir}/vimrc  ${pkgdir}/etc/vimrc
+  install -Dm644 ${srcdir}/archlinux.vim  \
+                 ${pkgdir}/usr/share/vim/vimfiles/archlinux.vim
+  install -dm755 ${pkgdir}/usr/share/licenses/vim
+  cd ${pkgdir}/usr/share/licenses/vim
+  ln -s ../../vim/${_versiondir}/doc/uganda.txt license.txt
 }

Copied: vim/repos/extra-x86_64/archlinux.vim (from rev 46736, vim/trunk/archlinux.vim)
===================================================================
--- extra-x86_64/archlinux.vim	                        (rev 0)
+++ extra-x86_64/archlinux.vim	2009-07-20 03:07:19 UTC (rev 46751)
@@ -0,0 +1,28 @@
+" The ArchLinux global vimrc - setting only a few sane defaults
+"
+" Maintainer:      Tobias Kieslich [tobias funnychar archlinux dot org]
+"
+" NEVER EDIT THIS FILE, IT'S OVERWRITTEN UPON UPGRADES, GLOBAL CONFIGURATION
+" SHALL BE DONE IN /etc/vimrc, USER SPECIFIC CONFIGURATION IN ~/.vimrc
+
+set runtimepath=~/.vim,/usr/share/vim,/usr/share/vim/vimcurrent
+
+" Normally we use vim-extensions. If you want true vi-compatibility
+" remove change the following statements
+set nocompatible                " Use Vim defaults instead of 100% vi compatibility
+set backspace=indent,eol,start  " more powerful backspacing
+
+" Now we set some defaults for the editor
+set history=50                  " keep 50 lines of command line history
+set ruler                       " show the cursor position all the time
+
+" Suffixes that get lower priority when doing tab completion for filenames.
+" These are files we are not likely to want to edit or read.
+set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
+
+
+if has('gui_running')
+  " Make shift-insert work like in Xterm
+  map <S-Insert> <MiddleMouse>
+  map! <S-Insert> <MiddleMouse>
+endif

Modified: extra-x86_64/fetch_patches.sh
===================================================================
--- extra-x86_64/fetch_patches.sh	2009-07-20 03:00:24 UTC (rev 46750)
+++ extra-x86_64/fetch_patches.sh	2009-07-20 03:07:19 UTC (rev 46751)
@@ -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}

Copied: vim/repos/extra-x86_64/fetch_runtime.sh (from rev 46736, vim/trunk/fetch_runtime.sh)
===================================================================
--- extra-x86_64/fetch_runtime.sh	                        (rev 0)
+++ extra-x86_64/fetch_runtime.sh	2009-07-20 03:07:19 UTC (rev 46751)
@@ -0,0 +1,117 @@
+# the purpose of this magic is to pull in the latest runtime files for vim
+# we start withe theruntime provoded by the tarballs and compare MD5s against
+# the latest runtime
+# if this fails we look in the local source cache if they have been fetched
+# for an earlier build and compare those MD5 files
+# if this fails, we fetch the stuff from online and store it in the local src
+# cache.
+# The local cache has to be set (makepkg.conf) AND it has to be writable
+
+update_runtime() {
+  _OLDDIR=$(pwd) #get absolute path
+  _errors=0
+  _ftp="ftp://ftp.vim.org/pub/vim/runtime"
+
+  # we're gonna be sneaky and grok the A-A-P recipe for the files we need
+  _recipe="getunix.aap"
+  _srccache="${SRCDEST}/vim-${_srcver}/"
+
+  echo "getting runtime recipe"
+  cd ${srcdir}
+  [ -f "${_recipe}" ] && rm "${_recipe}"
+  wget "${_ftp}/${_recipe}" >/dev/null 2>&1
+
+  cd "${_runtimedir}"
+  _runtimedir=$(pwd) #get absolute path
+
+  # change IFS to loop line-by-line
+  _OLDIFS=$IFS
+  IFS="
+"
+  echo "begin fetching updated runtime files..."
+  for _file in $(grep "file = " "${srcdir}/${_recipe}"); do
+    _file=$(echo ${_file} | sed "s|.*file = \(.*\)|\1|")
+    _md5=$(grep -A2 "file = ${_file} *$" "${srcdir}/${_recipe}" | \
+          grep "get_md5" | \
+          sed 's|@if get_md5(file) != "\(.*\)":|\1|g')
+    _dir=$(dirname "${_file}")
+
+    mkdir -p "${_dir}"
+
+    echo -e "\t${_file}"
+    _havefile=0
+    # if we have the file and the MD5sum fails, we technically don't have the file
+    if [ -f ${_file} ]; then
+      # MD5 fails ? ... we don't have the file
+      if [ $(echo "${_md5}  ${_file}" | md5sum --status -c -) ]; then
+        rm ${_file}
+      else
+        _havefile=1
+      fi
+    fi
+    # look files that were not copied from the unzipped sources
+    _cachefile=${srcdir}/${_versiondir}/runtime/${_file}
+    if [ ${_havefile} -ne 1 -a -f ${_cachefile} ]; then
+      # MD5 fails ? ... we lookup if we downloaded another version earlier
+      if [ $(echo "${_md5}  ${_cachefile}" | md5sum --status -c -) ]; then
+        _cachefile=${_srccache}/${_file}
+        if [ -f ${_cachefile} ]; then
+          if [ $(echo "${_md5}  ${_cachefile}" | md5sum --status -c -) ]; then
+            rm ${_cachefile}
+          else
+            cp ${_cachefile} ${_dir}
+            _havefile=1
+          fi
+        fi
+      else
+        cp ${_cachefile} ${_dir}
+        _havefile=1
+      fi
+    fi
+    # look up the local $SRCDEST
+    _cachefile=${_srccache}/${_file}
+    if [ ${_havefile} -ne 1 -a -f ${_cachefile} ]; then
+      # MD5 fails ? ... we don't have the file
+      if [ $(echo "${_md5}  ${_cachefile}" | md5sum --status -c -) ]; then
+        rm ${_cachefile}
+      else
+        cp ${_cachefile} ${_dir}
+        _havefile=1
+      fi
+    fi
+    # so we finally have to fetch it and store it to $SRCDEST (cache)
+    if [ ${_havefile} -ne 1 ]; then
+      echo -n -e "\t ... fetching file ${_file} ..."
+      cd "${_dir}"
+      wget "${_ftp}/${_file}" >/dev/null 2>&1
+      cd "${_runtimedir}"
+      # store freshly downloaded file in SRCDEST
+      mkdir -p ${_srccache}/${_dir}
+      cp ${_file} ${_srccache}/${_dir}
+      echo -e " done!"
+    fi
+
+   # check the MD5 sum finally
+    if [ $(echo "${_md5}  ${_file}" | md5sum --status -c -) ]; then
+      echo "!!!! md5sum check for ${_file} failed !!!!"
+      errors=$((${_errors} + 1))
+    fi
+  done
+  IFS=${_OLDIFS}
+
+  echo "vim runtime got updated"
+
+  if [ ${_errors} -gt 0 ]; then
+    echo "${_errors} failed MD5 checks while updating runtime files -> build can't be completed"
+    return 1
+  else
+    echo -e "\tpatching filetype.vim for better handling of pacman related files ..."
+    sed -i "s/rpmsave/pacsave/;s/rpmnew/pacnew/;s/,\*\.ebuild/\0,PKGBUILD*,*.install/" filetype.vim
+    sed -i "/find the end/,+3{s/changelog_date_entry_search/changelog_date_end_entry_search/}" ftplugin/changelog.vim
+  fi
+  # make Aaron happy
+  wget http://www.vim.org/scripts/download_script.php\?src_id=10872 \
+    -O autoload/pythoncomplete.vim
+  cd "${_OLDDIR}"
+  return 0
+}

Modified: extra-x86_64/vim.install
===================================================================
--- extra-x86_64/vim.install	2009-07-20 03:00:24 UTC (rev 46750)
+++ extra-x86_64/vim.install	2009-07-20 03:07:19 UTC (rev 46751)
@@ -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

Copied: vim/repos/extra-x86_64/vimrc (from rev 46736, vim/trunk/vimrc)
===================================================================
--- extra-x86_64/vimrc	                        (rev 0)
+++ extra-x86_64/vimrc	2009-07-20 03:07:19 UTC (rev 46751)
@@ -0,0 +1,16 @@
+" All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just
+" /usr/share/vim/vimcurrent/archlinux.vim) and sourced by the call to :runtime
+" you can find below.  If you wish to change any of those settings, you should
+" do it in this file (/etc/vimrc), since archlinux.vim will be overwritten
+" everytime an upgrade of the vim packages is performed.  It is recommended to
+" make changes after sourcing archlinux.vim since it alters the value of the
+" 'compatible' option.
+
+" This line should not be removed as it ensures that various options are
+" properly set to work with the Vim-related packages available in Debian.
+runtime! archlinux.vim
+
+
+" For more option refer to /usr/share/vim/vimcurrent/vimrc_example.vim or the
+" vim manual
+




More information about the arch-commits mailing list