#!/bin/sh PKGNAM=vim-gvim VERSION=${VERSION:-7.2} BUILD=${BUILD:-1} . /etc/pkghelpers pkghelpers_env VIMVER=${VERSION} # This is the directory in the VIM source archive to cd into. DIRVER=72 PYVER=2.5 BUILD=1 rm -rf $PKG mkdir -p $PKG # Determine VIM patchlevel: if [ -d $CWD/patches ] ; then cd $CWD/patches PATCHLEVEL=$(/bin/ls 2> /dev/null | tail -1 | cut -f 3 -d . ) if [ "$PATCHLEVEL" = "" ]; then PATCHLEVEL=000 fi cd $CWD fi cd $TMP rm -rf vim$DIRVER tar xjvf $CWD/vim-$VIMVER.tar.bz2 || exit 1 tar xjvf $CWD/vim-$VIMVER-lang.tar.bz2 || exit 1 config_vim() { CFLAGS="$SLKCFLAGS" \ ./configure \ $* \ --prefix=/usr \ --mandir=/usr/man \ --enable-pythoninterp \ --with-python-config-dir=/usr/lib$LIBSUFFIX/python$PYVER/config \ --enable-perlinterp \ --disable-tclinterp \ --enable-multibyte \ --enable-cscope \ --with-features=huge \ --with-compiledby="" \ --build=$ARCH-$DISTRO-linux # I had been adding this, but got 100% complaints and 0% kudos: # --enable-rubyinterp } cd $TMP/vim$DIRVER chown -R root:root . for file in $CWD/patches/* ; do ( zcat $file 2> /dev/null | patch -p0 --verbose --batch ) done config_vim --with-x --enable-gui=gtk2 make -j $NUMJOBS || exit 1 make install DESTDIR=$PKG rsync -lprvt $PKG/usr/share/man/ $PKG/usr/man/ rm -r $PKG/usr/share/man # Legacy binary links: ( cd $PKG/usr/bin ; rm -rf ex ) ( cd $PKG/usr/bin ; ln -sf vim ex ) ( cd $PKG/usr/bin ; rm -rf rview ) ( cd $PKG/usr/bin ; ln -sf vim rview ) ( cd $PKG/usr/bin ; rm -rf rvim ) ( cd $PKG/usr/bin ; ln -sf vim rvim ) ( cd $PKG/usr/bin ; rm -rf view ) ( cd $PKG/usr/bin ; ln -sf vim view ) ( cd $PKG/usr/bin ; rm -rf eview ) ( cd $PKG/usr/bin ; ln -sf vim eview ) ( cd $PKG/usr/bin ; rm -rf evim ) ( cd $PKG/usr/bin ; ln -sf vim evim ) mkdir -p $PKG/install cat $CWD/slack-desc.vim-gvim > $PKG/install/slack-desc zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh # You'll have to run "gvim" to get the graphical version. # Seems like this is the common way for console and gui versions # of vim to co-exist. If your "vi" symlink isn't pointed in a # way that suits you, it is fully user serviceable. :-) ( cd $PKG/usr/bin rm -f gvim mv vim gvim for programlink in $(find . -type l | cut -b3-) ; do rm $programlink ln -sf gvim $programlink done ) rm -f vimtutor xxd # Perfect! # Now we get rid of everything that's not in the other vim package. # Let's assume (dangerous ;-) that we just built that in $TMP # and use it as a reference: if ! /bin/ls $TMP/vim-${VIMVER}*tgz 1> /dev/null 2> /dev/null ; then echo "FATAL: VIM package needed in $TMP" exit 1 fi mkdir $PKG/vim ( cd $PKG ( cd vim echo "Extracting reference package $TMP/vim-${VIMVER}*tgz:" explodepkg $TMP/vim-${VIMVER}*tgz 1> /dev/null sh install/doinst.sh ) ) rm -r $PKG/vim/install ( cd $PKG find vim | cut -b4- | while read sharedfile ; do if [ ! -d $sharedfile ]; then rm --verbose $PKG/$sharedfile fi done ) # Finally, reference purge: rm -rf $PKG/vim # Perhaps we would be better off without this and forcing folks to run kappfinder # or something. It seems better than starting with nothing, but might force # people into defaults they don't want. Another nifty catch-22... mkdir -p $PKG/usr/share/applications cp -a $CWD/gvim.desktop $PKG/usr/share/applications mkdir -p $PKG/usr/share/pixmaps cp -a $CWD/gvim.png $PKG/usr/share/pixmaps chown -R root:root $PKG/usr/share # Slamd64 # Remove empty directories: find $PKG -type d -exec rmdir -p {} \; 2> /dev/null export PKGVER=$VERSION.$PATCHLEVEL cd $PKG pkghelpers_fixup pkghelpers_makepkg