wok view zsh/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 fcb16f737698
children 6fab3264ba87
line source
1 # SliTaz package receipt.
3 PACKAGE="zsh"
4 VERSION="5.0.7"
5 CATEGORY="system-tools"
6 SHORT_DESC="Zsh shell incorporates many features of bash, ksh, and tcsh"
7 MAINTAINER="sandys@gmail.com"
8 LICENSE="other"
9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="http://zsh.sourceforge.net/"
11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
12 TAGS="shell"
14 DEPENDS="ncurses zlib ncursesw"
15 BUILD_DEPENDS="ncurses-dev zlib-dev"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 ./configure --bindir=/bin \
21 --disable-dynamic --enable-multibyte \
22 --enable-fndir=/usr/share/zsh/functions \
23 --enable-scriptdir=/usr/share/zsh/scripts \
24 $CONFIGURE_ARGS &&
25 make &&
26 make install
27 }
29 # Rules to gen a SliTaz package suitable for Tazpkg.
30 genpkg_rules()
31 {
32 cp -a $install/bin $fs
34 # Config files.
35 #
36 mkdir $fs/etc
37 cp $stuff/example.zshrc $fs/etc/zshrc
39 #no way around this... gen_package will not automatically copy these
40 mkdir -p $fs/usr/share/zsh
41 cp -r $install/usr/share/zsh/functions $fs/usr/share/zsh
43 mkdir -p $fs/usr/share/zsh/scripts
44 }
46 # Post install commands for Tazpkg.
47 # Check /bin/sh stat.
48 #
49 post_install()
50 {
51 echo "Processing post-install commands..."
52 sh=$(readlink "$1/bin/sh")
53 if [ ! "$sh" = "/bin/zsh" ]; then
54 echo ""
55 echo "**** Actual SH link : $sh"
56 echo ""
57 echo -n "Do you want Zsh for /bin/sh (y/N) ? : "
58 read -t 30 answer < /dev/tty
59 if [ "$answer" == "y" ]; then
60 echo ""
61 echo -n "Removing sh link to make a new one pointing on /bin/zsh..."
62 rm "$1/bin/sh" && ln -s /bin/zsh "$1/bin/sh"
63 status
64 else
65 echo ""
66 echo "Leaving /bin/sh to : $sh"
67 fi
68 fi
69 }
71 # Restore a valid sh link if needed.
72 pre_remove()
73 {
74 sh=$(readlink "$1/bin/sh")
75 if [ ! "$sh" = "busybox" ]; then
76 rm "$1/bin/sh" &&
77 ln -s /bin/busybox "$1/bin/sh"
78 fi
79 }