updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / vim-gtk / PKGBUILD
blob48a82385c638443769b7c13c6e36b1792c1ccbfa
1 # Maintainer: Bartek Piotrowski <barthalion@gmail.com>
3 pkgname=vim-gtk
4 _realname=vim
5 _srcver=7.3
6 _patchlevel=$(wget ftp://ftp.vim.org/pub/vim/patches/${_srcver}/ -q -O - | sed -n '/7.3./ s/.*7.3.\([0-9]\+\).*/\1/p' | tail -1)
7 pkgver=${_srcver}.${_patchlevel}
8 pkgrel=3
9 pkgdesc="Modified from extra/gvim, compiled with gtk2 ui, without deps on vi/vim, ruby and desktop utils."
10 arch=(i686 x86_64)
11 license=('custom:vim')
12 url="http://www.vim.org"
13 depends=('libxt' 'gtk2')
14 provides=(${_realname})
15 conflicts=(gvim vim)
16 source=(ftp://ftp.vim.org/pub/vim/unix/vim-${_srcver}.tar.bz2)
17 md5sums=('5b9510a17074e2b37d8bb38ae09edbf2')
18 _python2=n
19 _vimfolder=${_realname}$(echo ${_srcver} | sed "s/\.//")
21 if [ ${_python2} = "y" ]; then
22   makedepends=('wget' 'sed' 'grep' 'python2' 'perl' 'gzip')
23 else
24   makedepends=('wget' 'sed' 'grep' 'python' 'perl' 'gzip') 
27 build() {
28   cd ${srcdir}/${_vimfolder}
30   wget ftp://ftp.vim.org/pub/vim/patches/${_srcver}/${_srcver}.*
31   wget ftp://ftp.vim.org/pub/vim/patches/${_srcver}/MD5SUMS
32   md5sum -c MD5SUMS || return 1
33   for x in `ls ${_srcver}.*`; do patch -p0 -i $x; done
35   if [ ${_python2} = "y" ]; then
36     sed -i -e 's|vi_cv_path_python, python|vi_cv_path_python, python2|' \
37                ${srcdir}/${_vimfolder}/src/configure.in
38     (cd ${srcdir}/${_vimfolder}/src && autoconf)
39   fi
41   ./configure --prefix=/usr --localstatedir=/var/lib/vim --mandir=/usr/share/man \
42               --with-features=big \
43               --with-x=yes --disable-gpm --with-x=yes --enable-gui=gtk2 \
44               --with-global-runtime=/usr/share/vim\
45               --enable-multibyte --enable-cscope \
46               --enable-perlinterp --enable-pythoninterp
47   make || return 1
48   make VIMRCLOC=/etc DESTDIR=${pkgdir} install
50   # Clean unneeded binary files and man pages
51   cd ${pkgdir}/usr/bin
52   rm -f ex view rview xxd vimtutor
54   find ${pkgdir}/usr/share/man -type d -name 'man1' 2>/dev/null | \
55   while read _mandir; do
56     cd ${_mandir}
57     rm -f ex.1 view.1 vimtutor.1 xxd.1
58   done
60   # Fix FS#17216
61   sed -i 's|messages,/var|messages,/var/log/messages.log,/var|' \
62           ${pkgdir}/usr/share/vim/${_vimfolder}/filetype.vim
64   # Patch filetype.vim for better handling of pacman related files
65   sed -i "s/rpmsave/pacsave/;s/rpmnew/pacnew/;s/,\*\.ebuild/\0,PKGBUILD*,*.install/" \
66           ${pkgdir}/usr/share/vim/${_vimfolder}/filetype.vim
67   sed -i "/find the end/,+3{s/changelog_date_entry_search/changelog_date_end_entry_search/}" \
68           ${pkgdir}/usr/share/vim/${_vimfolder}/ftplugin/changelog.vim
70   # License
71   install -Dm644 ${srcdir}/${_vimfolder}/runtime/doc/uganda.txt\
72     ${pkgdir}/usr/share/licenses/${_realname}/license.txt