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