# SliTaz package receipt. PACKAGE="vim-tiny" VERSION="9.0.0133" basever=${VERSION%.*} basever=${basever/./} CATEGORY="editors" TAGS="text-editor" SHORT_DESC="Advanced text editor without GUI." MAINTAINER="erjo@slitaz.org" LICENSE="other" WEB_SITE="https://www.vim.org/" SOURCE="vim" TARBALL="$SOURCE-$VERSION.tar.gz" WGET_URL="https://github.com/$SOURCE/$SOURCE/archive/v$VERSION.tar.gz" DEPENDS="ncurses" BUILD_DEPENDS="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=tiny \ --with-x=no \ --disable-gui \ --enable-multibyte \ --with-vim-name=$PACKAGE \ --disable-acl \ --disable-motif-check \ --mandir=/usr/share/man \ $CONFIGURE_ARGS && make \ VIMRCLOC=/etc/vim \ VIMRUNTIMEDIR=/usr/share/vim/vim$basever\ MAKE="make -e" && make DESTDIR=$DESTDIR install mkdir -p $DESTDIR/etc/vim cp -a $src/runtime/vimrc_example.vim $DESTDIR/etc/vim/vimrc rm -rf $DESTDIR/usr/share/applications } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/etc mkdir -p $fs/usr/bin mkdir -p $fs/usr/share/vim/vim$basever cp -a $install/etc/vim $fs/etc cp -a $install/usr/bin/vim-tiny $fs/usr/bin cp -a $install/usr/share/vim/vim$basever/defaults.vim \ $fs/usr/share/vim/vim$basever } post_install() { cmd=$(readlink "$1/bin/vi") if [ "$cmd" != '/usr/bin/vim-tiny' ] then echo '' echo "**** Actual VI link : $cmd" echo '' echo -n 'Do you want vim-tiny for /bin/vi (y/N) ? : ' read -t 30 anser if [ "$anser" = 'y' ] then echo '' action 'Removing vi link to make a new one pointing to /usr/bin/vim-tiny...' rm "$1/bin/vi" && ln -sf /usr/bin/vim-tiny "$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" }