[arch-commits] CVS update of arch/build/editors/vim (3 files)
Tobias Kieslich
tobias at archlinux.org
Tue Jul 10 00:26:30 UTC 2007
Date: Monday, July 9, 2007 @ 20:26:30
Author: tobias
Path: /home/cvs-arch/arch/build/editors/vim
Added: PKGBUILD (1.1) fetch_patches.sh (1.1) vim.install (1.1)
innitial checkin fro new vim layout based on
vi -> the very base but comes with a complete runtime
vim -> x capabilities, but NO GUI!, supports all script languages (except mzScheme wich we don't have)
gvim -> everuthing including a gui
------------------+
PKGBUILD | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++
fetch_patches.sh | 52 ++++++++++++++++++++++++++++++++++++++++++
vim.install | 41 +++++++++++++++++++++++++++++++++
3 files changed, 158 insertions(+)
Index: arch/build/editors/vim/PKGBUILD
diff -u /dev/null arch/build/editors/vim/PKGBUILD:1.1
--- /dev/null Mon Jul 9 20:26:30 2007
+++ arch/build/editors/vim/PKGBUILD Mon Jul 9 20:26:30 2007
@@ -0,0 +1,65 @@
+# $Id: PKGBUILD,v 1.1 2007/07/10 00:26:30 tobias Exp $
+# Maintainer: tobias [ tobias at archlinux org ]
+
+pkgname=vim
+_srcver=7.1
+_patchlevel=22
+pkgver=${_srcver}.${_patchlevel}
+pkgrel=1
+pkgdesc="a highly configurable, improved version of the vi text editor"
+arch=(i686 x86_64)
+license=(CUSTOUM)
+url="http://www.vim.org"
+depends=('vi' 'perl' 'python' 'ruby' 'acl' 'gpm' 'libxt')
+makedepends=('wget' 'sed' 'grep')
+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=('44c6b4914f38d6f9aa959640b89da329'
+ '605cc7ae31bcc9d7864bb0bb6025f55d'
+ '144aa049ba70621acf4247f0459f3ee7'
+ 'fba5e33a451066494c7203d13cf0be3d')
+
+build()
+{
+ # pull in patches from vim.org (or the src cache alternatively)
+ . ${startdir}/fetch_patches.sh
+ get_patches
+ cd ${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//")
+ sed -i 's|^.*\(#define SYS_.*VIMRC_FILE.*"\) .*$|\1|' src/feature.h
+ # build party
+ ./configure --prefix=/usr --localstatedir=/var/lib/vim \
+ --with-compiledby=ArchLinux --with-features=big \
+ --with-x=yes --disable-gui \
+ --with-global-runtime=/usr/share/vim --with-vim-name=vim \
+ --enable-multibyte --enable-cscope \
+ --enable-perlinterp --enable-pythoninterp --enable-rubyinterp
+ 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
+ ln -s vim evim
+
+ # delete the manpages/symlinks provided by vi package
+ find ${startdir}/pkg/usr/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 rvi.1.gz rvim.1.gz
+ ln -s vi.1.gz vim.1.gz
+ ln -s vidiff.1.gz vimdiff.1.gz
+ ln -s vitutor.1.gz vimtutor.1.gz
+ 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
+}
Index: arch/build/editors/vim/fetch_patches.sh
diff -u /dev/null arch/build/editors/vim/fetch_patches.sh:1.1
--- /dev/null Mon Jul 9 20:26:30 2007
+++ arch/build/editors/vim/fetch_patches.sh Mon Jul 9 20:26:30 2007
@@ -0,0 +1,52 @@
+# the external logic for pulling in patches
+
+get_patches() {
+ _patchdir=${startdir}/src/patches
+ cd ${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//")
+ if [ -d ${_patchdir} ]; then
+ rm -rf ${_patchdir}
+ echo -e "\tremove patches from old build"
+ fi
+ mkdir ${_patchdir} && cd ${_patchdir}
+ _rpath=ftp://ftp.vim.org/pub/vim/patches/${_srcver}
+
+ # change IFS to loop line-by-line
+ _OLDIFS=$IFS
+ IFS="
+"
+ echo -e "\tfetching checksumfile for patches"
+ wget ${_rpath}/MD5SUMS >/dev/null 2>&1
+
+ for _line in $(/bin/cat MD5SUMS); do
+ _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} ./
+ else
+ echo -n -e "\t... fetching patch file: ${_file} ..."
+ wget ${_rpath}/${_file} >/dev/null 2>&1
+ if [ -w ${SRCDEST} ]; then
+ if [ ! -d ${SRCDEST}/vim-${_srcver} ]; then
+ mkdir -p ${SRCDEST}/vim-${_srcver}
+ fi
+ cp ${_file} ${SRCDEST}/vim-${_srcver}/
+ echo " done!"
+ fi
+ fi
+
+ echo "${_md5} ${_file}" | md5sum -c - >/dev/null 2>&1
+ if [ ${?} -ne 0 ]; then
+ echo ${_file} md5sums do not match
+ return 1
+ fi
+ done
+ IFS=$_OLDIFS
+ rm MD5SUMS
+ cd ${startdir}/src/vim$(echo ${_srcver} | sed "s/\.//")
+ for _patch in $(/bin/ls ${_patchdir}); do
+ patch -Np0 -i ${_patchdir}/${_patch} || return 1
+ done
+ rm -rf ${_patchdir}
+ return 0
+}
Index: arch/build/editors/vim/vim.install
diff -u /dev/null arch/build/editors/vim/vim.install:1.1
--- /dev/null Mon Jul 9 20:26:30 2007
+++ arch/build/editors/vim/vim.install Mon Jul 9 20:26:30 2007
@@ -0,0 +1,41 @@
+post_install() {
+ # if we have an existing gvim installation - relocate binaries and symlinks
+ if [ -f /usr/bin/vim ] ; then
+ OLDDIR=$(pwd)
+ cd /usr/bin
+ rm -f view rview
+ ln -s vim view
+ ln -s vim rview
+ cd ${OLDDIR}
+ echo "create vim related symlinks..."
+ fi
+ echo -n "Updating vim help tags..."
+ /usr/bin/vim --noplugins -u NONE -U NONE \
+ --cmd ":helptags /usr/share/vim/doc" --cmd ":q" > /dev/null 2>&1
+ echo "done."
+}
+
+pre_remove() {
+ OLDDIR=$(pwd)
+ 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..."
+ fi
+ cd ${OLDDIR}
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_upgrade() {
+ pre_remove $1
+}
+
+op=$1
+shift
+
+$op $*
More information about the arch-commits
mailing list