updated on Sun Jan 15 04:04:02 UTC 2012
[aur-mirror.git] / vim-hg / PKGBUILD
blobf353e997689a3f4bbe19f4e812ef5b9563448f4d
1 # $Id: PKGBUILD 49631 2009-08-14 06:17:04Z tobias $
2 # Maintainer: jdhore [ jdhore1 at gmail com ]
4 pkgname=vim-hg
5 pkgver=2574
6 pkgrel=1
7 pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor'
8 arch=(i686 x86_64)
9 license=('custom:vim')
10 url="http://www.vim.org"
11 depends=('gpm' 'perl' 'python')
12 makedepends=('wget' 'sed' 'grep' 'gettext' 'mercurial')
13 conflicts=(vim)
14 provides=(vim=7.3)
15 source=(vimrc archlinux.vim)
16 md5sums=('6228d36c3702d4e9afc4d2a1edcc3aff'
17          '10353a61aadc3f276692d0e17db1478e')
18 backup=(etc/vimrc)
20 _hgroot="https://vim.googlecode.com/hg/"
21 _hgrepo="vim"
23 fetch() {
24   # update source
25   cd $srcdir
27   if [ -d ${_hgrepo} ]; then
28     cd $srcdir/${_hgrepo}
29     hg pull -u
30   else
31     hg clone ${_hgroot}${_hgrepo} || return 1
32     cd $srcdir/${_hgrepo}
33   fi
37   msg "Mercurial checkout done or server timeout"
38   msg "Starting make..."
40   rm -rf "$srcdir/$_hgrepo-build"
41   cp -R "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
44 build()
46   fetch
48   cd "$srcdir/$_hgrepo-build"
50   sed -i 's|^.*\(#define SYS_.*VIMRC_FILE.*"\) .*$|\1|' src/feature.h
51   sed -i 's|^.*\(#define VIMRC_FILE.*"\) .*$|\1|' src/feature.h
52   # build party
53   ./configure --prefix=/usr --localstatedir=/var/lib/vim --mandir=/usr/share/man \
54   --with-compiledby=ArchLinux --with-features=big \
55   --enable-gpm --enable-acl --with-x=no --disable-gui \
56   --enable-multibyte --enable-cscope \
57   --enable-perlinterp --enable-pythoninterp
59   make || return 1
62 package() {
63   cd "$srcdir/$_hgrepo-build"
64   make VIMRCLOC=/etc DESTDIR=${pkgdir} install
66   cd "$pkgdir/usr/bin"
67   rm ex view                # provided by (n)vi in core
69   # delete some manpages
70   cd ${pkgdir}/usr/share/man
71   rm -f {*/,}man1/ex.1 {*/,}man1/view.1      # provided by (n)vi
72   rm -f {*/,}man1/evim.1                     # this does not make sense in the console version
74   # patch runtime
75   cd $pkgdir/usr/share/vim/vim73/
76   sed -i "s/rpmsave/pacsave/;s/rpmnew/pacnew/;s/,\*\.ebuild/\0,PKGBUILD*,*.install/" filetype.vim
78   # fix FS#17216
79   sed -i 's|messages,/var|messages,/var/log/messages.log,/var|' \
80     ${pkgdir}/usr/share/vim/vim73/filetype.vim
83   install -Dm644 ${srcdir}/vimrc  ${pkgdir}/etc/vimrc
84   install -Dm644 ${srcdir}/archlinux.vim  \
85                  ${pkgdir}/usr/share/vim/vimfiles/archlinux.vim
86   install -dm755 ${pkgdir}/usr/share/licenses/$pkgname
87   cd ${pkgdir}/usr/share/licenses/$pkgname
88   ln -s ../../vim/vim73/doc/uganda.txt license.txt
91 # vim:set ts=2 sw=2 et: