wok view vim/receipt @ rev 18730

Quote root dir in post_install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Dec 20 15:13:45 2015 +0100 (2015-12-20)
parents 3494cfd4c595
children 6fab3264ba87
line source
1 # SliTaz package receipt.
3 PACKAGE="vim"
4 VERSION="7.3"
5 CATEGORY="editors"
6 SHORT_DESC="Advanced text editor"
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="other"
9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.vim.org/"
11 WGET_URL="ftp://ftp.vim.org/pub/vim/unix/$TARBALL"
12 CONFIG_FILES="/etc/vim/vimrc"
13 TAGS="text-editor"
15 DEPENDS="ncurses acl diffutils"
16 BUILD_DEPENDS="ncurses-dev acl-dev diffutils"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 export LDFLAGS="$LDFLAGS -ltinfo"
23 # define the place for the global vimrc file (set to /etc/vim/vimrc)
24 # (patch from Arch Linux PKGBUILD)
25 sed -i 's|^.*\(#define SYS_VIMRC_FILE\).*$|\1 "/etc/vim/vimrc"|' $src/src/feature.h
27 ./configure --prefix=/usr \
28 --cache-file=$PWD/config.cache \
29 --infodir=/usr/share/info \
30 --with-features=normal \
31 --with-x=no \
32 --disable-gui \
33 --enable-multibyte \
34 --disable-motif-check \
35 --disable-athena-check \
36 --mandir=/usr/share/man $CONFIGURE_ARGS &&
38 make VIMRCLOC=/etc/vim VIMRUNTIMEDIR=/usr/share/vim/vim73 MAKE="make -e" &&
39 make DESTDIR=$DESTDIR install
40 mkdir -p $DESTDIR/etc/vim
41 cp -a $src/runtime/vimrc_example.vim $DESTDIR/etc/vim/vimrc
42 }
44 # Rules to gen a SliTaz package suitable for Tazpkg.
45 genpkg_rules()
46 {
47 mkdir -p $fs/usr/share $fs/etc
49 cp -a $install/usr/bin $fs/usr
50 cp -a $install/usr/share/vim $fs/usr/share
51 cp -a $install/etc/vim $fs/etc
52 }
54 post_install()
55 {
56 echo "Processing post-install commands..."
57 cmd=$(readlink "$1/bin/vi")
58 if [ ! "$cmd" = "/usr/bin/vim" ]; then
59 echo ""
60 echo "**** Actual VI link : $cmd"
61 echo ""
62 echo -n "Do you want vim for /bin/vi (y/N) ? : "; read -t 30 anser
63 if [ "$anser" == "y" ]; then
64 echo ""
65 echo -n "Removing vi link to make a new one pointing on /usr/bin/vim..."
66 rm "$1/bin/vi" && ln -sf /usr/bin/vim "$1/bin/vi"
67 status
68 else
69 echo ""
70 echo "Leaving /bin/vi to : $cmd"
71 fi
72 fi
73 }
75 post_remove()
76 {
77 # restore previous symlink
78 echo "Processing post-remove commands..."
79 ln -sf /bin/busybox "$1/bin/vi"
80 }