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

Tobias Kieslich tobias at archlinux.org
Tue May 5 07:16:33 UTC 2009


    Date: Tuesday, May 5, 2009 @ 03:16:33
  Author: tobias
Revision: 37938

upgpkg: gvim 7.2.166-1

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

------------------+
 PKGBUILD         |   77 +++++++++++++++++++++--------------------------------
 fetch_patches.sh |   19 ++++++++-----
 gvim.install     |   19 +++++++++++++
 3 files changed, 63 insertions(+), 52 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-05-05 07:14:50 UTC (rev 37937)
+++ PKGBUILD	2009-05-05 07:16:33 UTC (rev 37938)
@@ -3,81 +3,66 @@
 
 pkgname=gvim
 _srcver=7.2
-_patchlevel=65
+_patchlevel=166
 pkgver=${_srcver}.${_patchlevel}
 pkgrel=1
 pkgdesc="the vim text editor with advanced features enabled, such as a gui mode"
 arch=(i686 x86_64)
 license=('custom:vim')
 url="http://www.vim.org"
-depends=("vim>=${pkgver}" 'perl' 'python' 'ruby' 'acl' 'libxt' 'gtk2' 'desktop-file-utils')
-makedepends=('pkgconfig')
-backup=(etc/gvimrc)
-conflicts=('gvim-devel')
-provides=('gvim-devel')
+depends=("vim=${pkgver}" 'perl' 'python' 'ruby' 'libxt' 'desktop-file-utils' 'gtk2')
+makedepends=('pkgconfig' 'sed')
 install=${pkgname}.install
 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 \
         ${pkgname}.desktop fetch_patches.sh)
-md5sums=('f0901284b338e448bfd79ccca0041254' '35e04482f07c57221c9a751aaa3b8dac' \
-         'd8884786979e0e520c112faf2e176f05' '2be104c0372dd6dae19cb7968c03cd4f' \
-         'a3b03cd44b8ed78a99850d4cbfaafe55')
 
 build()
 {
+  _versiondir="vim"$(echo ${_srcver} | sed "s/\.//")
   # patch party
   # pull in patches from vim.org (or the src cache alternatively)
-  . ${startdir}/src/fetch_patches.sh
+  . ${srcdir}/fetch_patches.sh
   get_patches || return 1
-  cd ${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//")
+  cd ${srcdir}/${_versiondir}
    # define the place for the global (g)vimrc file (set to /etc/vimrc)
   sed -i 's|^.*\(#define SYS_.*VIMRC_FILE.*"\) .*$|\1|' src/feature.h
   ./configure --prefix=/usr --localstatedir=/var/lib/vim --mandir=/usr/share/man \
     --with-compiledby=ArchLinux --with-features=big \
-    --with-x=yes --disable-gpm --with-x=yes --enable-gui=gtk2 \
-    --with-global-runtime=/usr/share/vim --with-vim-name=gvim \
+    --with-x=yes --disable-gpm --enable-gui=gtk2 \
     --enable-multibyte --enable-cscope \
     --enable-perlinterp --enable-pythoninterp --enable-rubyinterp
   make || return 1
-  # install everything first ...
-  make VIMRCLOC=/etc DESTDIR=${startdir}/pkg VIMRTDIR= install
+   # install everything first ...
+  make VIMRCLOC=/etc DESTDIR=${pkgdir} install
 
    # ... and clean up what vim already has for us
-   # move the binary and fix the (g)* related symlinks
-  find ${startdir}/pkg/usr/bin -type l 2> /dev/null | while read symlink; do
-    rm ${symlink}
-  done
-  cd ${startdir}/pkg/usr/bin
-  rm -f gvimtutor xxd
-  ln -s gvim evim
-  ln -s gvim egview
-  ln -s gvim gview
-  ln -s gvim gvimdiff
-  ln -s gvim rgview
-  ln -s gvim rgvim
+  cd ${pkgdir}/usr/bin
+  rm -f xxd ex view vimtutor vimdiff rview rvim
+  mv vim vim-big
+  # ... make g* related symlinks point directly to the actual binary
+  ln -sf vim-big eview
+  ln -sf vim-big evim
+  ln -sf vim-big gview
+  ln -sf vim-big gvim
+  ln -sf vim-big gvimdiff
+  ln -sf vim-big rgview
+  ln -sf vim-big rgvim
 
-   # delete the manpages/symlinks provided by vi package
-  find ${startdir}/pkg/usr/share/man -type d -name 'man1' 2> /dev/null | \
-   while read mandir; do
-    cd ${mandir}
-    rm -f *.1
-    ln -s evi.1.gz evim.1.gz
-    ln -s vi.1.gz egview.1.gz
-    ln -s vi.1.gz gview.1.gz
-    ln -s vi.1.gz gvim.1.gz
-    ln -s vimdiff.1.gz gvimdiff.1.gz
-    ln -s vi.1.gz rgvim.1.gz
-    ln -s vi.1.gz rgview.1.gz
+   # delete the manpages/symlinks provided by vim and (n)vi package
+  find ${pkgdir}/usr/share/man -type d -name 'man1' 2> /dev/null | \
+  while read _mandir; do
+    cd ${_mandir}
+      rm -f ex.1 view.1       # provided by (n)vi
+      rm -f rvim.1 rview.1 vim.1 vimtutor.1 vimdiff.1 xxd.1  # provided by vim
   done
 
-  install -Dm644 ${startdir}/pkg/usr/share/vim/gvimrc_example.vim \
-    ${startdir}/pkg/etc/gvimrc
-   # clean all settings and controls -  served by vi package
-  rm -rf ${startdir}/pkg/usr/share/vim
+   # clean all settings and controls -  served by vim package
+  rm -rf ${pkgdir}/usr/share/vim
    # freedesktop links
-  install -D -m644 ${startdir}/src/${pkgname}.desktop \
+  install -D -m644 ${srcdir}/${pkgname}.desktop \
     ${startdir}/pkg/usr/share/applications/gvim.desktop
-  install -D -m644 ${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//")/runtime/vim48x48.png \
-    ${startdir}/pkg/usr/share/pixmaps/gvim.png
+  install -D -m644 ${srcdir}/${_versiondir}/runtime/vim48x48.png \
+    ${pkgdir}/usr/share/pixmaps/gvim.png
 }

Modified: fetch_patches.sh
===================================================================
--- fetch_patches.sh	2009-05-05 07:14:50 UTC (rev 37937)
+++ fetch_patches.sh	2009-05-05 07:16:33 UTC (rev 37938)
@@ -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}/vim$(echo ${_srcver} | sed "s/\.//")
   if [ -d ${_patchdir} ]; then
     rm -rf ${_patchdir}
     echo -e "\tremove patches from old build"
@@ -19,9 +19,10 @@
 
   downloads=0
   for _line in $(/bin/cat MD5SUMS); do
+    _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} ./
@@ -46,13 +47,19 @@
   ########
 
   if [ ${downloads} != ${_patchlevel} ]; then
-    echo -e "Number of patches does not match the patchlevel!\nEdit the PKGBUILD accordingly!"
-    return 1
+    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
+  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: gvim.install
===================================================================
--- gvim.install	2009-05-05 07:14:50 UTC (rev 37937)
+++ gvim.install	2009-05-05 07:16:33 UTC (rev 37938)
@@ -1,4 +1,11 @@
 post_install() {
+
+  echo "Create gvim related symlinks..."
+  cd usr/bin
+  rm -f vim
+  ln -sf vim-big vim
+  cd ${OLDPWD}
+
   echo "Updating desktop and mime database..."
   update-desktop-database -q
   echo -n "Updating vim help tags..."
@@ -12,6 +19,18 @@
 }
 
 post_remove() {
+  # we recover what pacmans database knows about gvim
+  # is vim installed and well?
+  if [ -f usr/bin/vim-normal ] ; then
+    cd usr/bin
+    rm -f vim
+    ln -sf vim-normal vim
+    cd ${OLDPWD}
+    echo "Recover vim related symlinks ..."
+  else
+    # Should never be the case because gvim depends on vim
+    rm -f usr/bin/vim
+  fi
   echo -n "Updating desktop and mime database..."
   update-desktop-database
   echo "done."




More information about the arch-commits mailing list