SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "vim"

# SliTaz package receipt.

PACKAGE="vim"
VERSION="9.0.0133"
basever=${VERSION%.*}
basever=${basever/./}
CATEGORY="editors"
TAGS="text-editor"
SHORT_DESC="Advanced text editor."
MAINTAINER="erjo@slitaz.org"
LICENSE="other"
WEB_SITE="https://www.vim.org/"

TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="https://github.com/$PACKAGE/$PACKAGE/archive/v$VERSION.tar.gz"

DEPENDS="acl diffutils ncurses"
BUILD_DEPENDS="acl-dev diffutils ncurses-dev"

CONFIG_FILES="/etc/vim/vimrc"

current_version()
{
    wget -O - ${WGET_URL%/arch*}/tags 2>/dev/null | \
    sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
}

# Rules to configure and make the package.
compile_rules()
{
    export LDFLAGS="$LDFLAGS -ltinfo"

    # define the place for the global vimrc file (set to /etc/vim/vimrc)
    # (patch from Arch Linux PKGBUILD)
    sed -i 's|^.*\(#define SYS_VIMRC_FILE\).*$|\1 "/etc/vim/vimrc"|' \
        $src/src/feature.h

    # 9.0.0133 unrecognised:
#        --disable-athena-check

    ./configure                \
        --prefix=/usr            \
        --cache-file=$PWD/config.cache    \
        --infodir=/usr/share/info    \
        --with-features=normal        \
        --with-x=no            \
        --disable-gui            \
        --enable-multibyte        \
        --disable-motif-check        \
        --mandir=/usr/share/man        \
        $CONFIGURE_ARGS &&

    make                        \
        VIMRCLOC=/etc/vim            \
        VIMRUNTIMEDIR=/usr/share/vim/vim$basever\
        MAKE="make -e" &&
    make    install                \
        DESTDIR=$DESTDIR

    mkdir -p $DESTDIR/etc/vim
    cp -a $src/runtime/vimrc_example.vim    $DESTDIR/etc/vim/vimrc

    for i in GenericName Keywords
      do
        l="$(grep $i= $DESTDIR/usr/share/applications/vim.desktop)"
        sed -i "/$i=/d;s|$i\[de].*|$l\n&|" $DESTDIR/usr/share/applications/vim.desktop
      done
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/share
    mkdir -p $fs/etc

    cp -a $install/usr/bin        $fs/usr
    cp -a $install/usr/share/vim    $fs/usr/share
    cp -a $install/etc/vim        $fs/etc
}

post_install()
{
    cmd=$(readlink "$1/bin/vi")
    if [ "$cmd" != '/usr/bin/vim' ]
      then
        echo ''
        echo "**** Actual VI link : $cmd"
        echo ''
        echo -n 'Do you want vim  for /bin/vi (y/N) ? : '
        read -t 30 anser
        if [ "$anser" = 'y' ]
          then
            echo ''
            echo -n 'Removing vi link to make a new one pointing to /usr/bin/vim...'
            rm "$1/bin/vi" &&
            ln -sf /usr/bin/vim "$1/bin/vi"
            status
          else
            echo ''
            echo "Leaving /bin/vi to : $cmd"
        fi
    fi
}

post_remove()
{
    # restore previous symbolic link
    ln -sf /bin/busybox "$1/bin/vi"
}
6047 packages and 209931 files in current database (Wed Jun 26 15:35:30 2024)