[arch-commits] Commit in vim/trunk (PKGBUILD)

Eric Bélanger eric at archlinux.org
Sat Oct 1 01:08:42 UTC 2011


    Date: Friday, September 30, 2011 @ 21:08:42
  Author: eric
Revision: 139173

Add mksource function to create tarball from mercurial checkout, Clean up makedepends

Modified:
  vim/trunk/PKGBUILD

----------+
 PKGBUILD |   69 ++++++++++++++++++++++++++-----------------------------------
 1 file changed, 30 insertions(+), 39 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-09-30 22:43:18 UTC (rev 139172)
+++ PKGBUILD	2011-10-01 01:08:42 UTC (rev 139173)
@@ -7,55 +7,50 @@
 pkgname=('vim' 'gvim' 'vim-runtime')
 _topver=7.3
 _patchlevel=322
-pkgver=${_topver}.${_patchlevel}
 __hgrev=5e84f6567623
+_versiondir="vim${_topver//./}"
+pkgver=${_topver}.${_patchlevel}
 pkgrel=1
 arch=('i686' 'x86_64')
 license=('custom:vim')
 url="http://www.vim.org"
-makedepends=('gawk' 'gpm' 'python2' 'python' 'ruby' 'libxt' 'desktop-file-utils' 'gtk2'
-             'mercurial' 'rsync')
-source=(pythoncomplete.vim::http://www.vim.org/scripts/download_script.php\?src_id=10872
+makedepends=('gpm' 'python2' 'python' 'ruby' 'libxt' 'desktop-file-utils' 'gtk2')
+source=(ftp://ftp.archlinux.org/other/vim/${pkgname}-${pkgver}.tar.xz
+        pythoncomplete.vim::http://www.vim.org/scripts/download_script.php\?src_id=10872
         vimrc archlinux.vim gvim.desktop)
-md5sums=('6e7adfbd5d26c1d161030ec203a7f243'
+md5sums=('67f5333d3ab35b705205dd3c95420b0b'
+         '6e7adfbd5d26c1d161030ec203a7f243'
          'e57777374891063b9ca48a1fe392ac05'
          '10353a61aadc3f276692d0e17db1478e'
          'd90413bd21f400313a785bb4010120cd')
 
-__hgroot='http://vim.googlecode.com/hg/'
-__hgrepo='vim'
-__hgbranch='default'
+# source PKGBUILD && mksource
+# mercurial is needed
+mksource() {
+  __hgroot='http://vim.googlecode.com/hg/'
+  __hgrepo='vim'
+  __hgbranch='default'
 
-_versiondir="vim${_topver//./}"
+  hg clone -b ${__hgbranch} -u ${__hgrev} "${__hgroot}${__hgrepo}" ${__hgrepo}
 
-##### Build #####
-
-build() {
-  cd "${srcdir}"
-
-  msg2 'Checking out source from Mercurial...'
-
-  if [[ -d ${__hgrepo} ]]; then
-    cd ${__hgrepo}
-    hg pull -b ${__hgbranch}|| warning 'hg pull failed!'
-    hg update -r ${__hgrev}
-  else
-    hg clone -b ${__hgbranch} -u ${__hgrev} "${__hgroot}${__hgrepo}" ${__hgrepo}
-    cd ${__hgrepo}
-  fi
-
+  pushd ${__hgrepo}
   if (( $(hg id -n) < $(hg id -nr ${__hgbranch}) )); then
-    warning 'You are not building the latest revision!'
-    warning "Consider updating __hgrev to $(hg id -r ${__hgbranch})."
-    sleep 10
+    printf 'You are not building the latest revision!\n'
+    printf "Consider updating __hgrev to $(hg id -r ${__hgbranch}).\n"
   fi
+  popd
 
-  cd ..
-  rm -rf vim-build gvim-build
-  rsync -a --exclude='.hg/' ${__hgrepo}/ vim-build
+  mv vim ${pkgname}-${pkgver}
+  find ${pkgname}-${pkgver} -depth -type d -name .hg -exec rm -rf {} \;
+  rm ${pkgname}-${pkgver}/{.hgignore,.hgtags}
+  tar -cJf ${pkgname}-${pkgver}.tar.xz ${pkgname}-${pkgver}/*
+}
 
-  msg2 'Patching...'
+build() {
+  cd "${srcdir}"
 
+  cp -a ${pkgname}-${pkgver} vim-build
+
   # define the place for the global (g)vimrc file (set to /etc/vimrc)
   sed -i 's|^.*\(#define SYS_.*VIMRC_FILE.*"\) .*$|\1|' \
     vim-build/src/feature.h
@@ -66,8 +61,6 @@
     vim-build/src/configure.in
   (cd vim-build/src && autoconf)
 
-  msg2 'Building...'
-
   cp -a vim-build gvim-build
 
   cd "${srcdir}"/vim-build
@@ -93,8 +86,6 @@
   make
 }
 
-##### Packaging #####
-
 package_vim() {
   pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor'
   depends=("vim-runtime=${pkgver}-${pkgrel}" 'gpm')
@@ -118,7 +109,7 @@
   rm -r "${pkgdir}"/usr/share/vim
 
   # license
-  install -Dm644 "${srcdir}"/vim/runtime/doc/uganda.txt \
+  install -Dm644 "${srcdir}"/vim-${pkgver}/runtime/doc/uganda.txt \
     "${pkgdir}"/usr/share/licenses/${pkgname}/license.txt
 }
 
@@ -152,7 +143,7 @@
   install -Dm644 runtime/vim48x48.png "${pkgdir}"/usr/share/pixmaps/gvim.png
 
   # license
-   install -Dm644 "${srcdir}"/vim/runtime/doc/uganda.txt \
+   install -Dm644 "${srcdir}"/vim-${pkgver}/runtime/doc/uganda.txt \
     "${pkgdir}"/usr/share/licenses/${pkgname}/license.txt
 }
 
@@ -189,7 +180,7 @@
     "${pkgdir}"/usr/share/vim/vimfiles/archlinux.vim
 
   # rgb.txt file
-  install -Dm644 "${srcdir}"/vim/runtime/rgb.txt \
+  install -Dm644 "${srcdir}"/vim-${pkgver}/runtime/rgb.txt \
     "${pkgdir}"/usr/share/vim/${_versiondir}/rgb.txt
 
   # license




More information about the arch-commits mailing list