wok annotate zsh/receipt @ rev 25051
Up terminology (0.7.0)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jun 05 10:44:35 2022 +0000 (2022-06-05) |
parents | 922f061231c2 |
children | ea7c7014b421 |
rev | line source |
---|---|
pascal@1531 | 1 # SliTaz package receipt. |
pascal@1531 | 2 |
pascal@1531 | 3 PACKAGE="zsh" |
pascal@24973 | 4 VERSION="5.8.1" |
pascal@1531 | 5 CATEGORY="system-tools" |
Hans-G?nter@21144 | 6 TAGS="shell" |
Hans-G?nter@21144 | 7 SHORT_DESC="Zsh shell incorporates many features of bash, ksh, and tcsh." |
pascal@1531 | 8 MAINTAINER="sandys@gmail.com" |
pascal@15361 | 9 LICENSE="other" |
Hans-G?nter@21144 | 10 WEB_SITE="https://www.zsh.org/" |
pascal@1531 | 11 |
Hans-G?nter@21144 | 12 TARBALL="$PACKAGE-$VERSION.tar.xz" |
Hans-G?nter@21144 | 13 WGET_URL="${WEB_SITE}pub/$TARBALL" |
Hans-G?nter@21144 | 14 |
Hans-G?nter@21144 | 15 DEPENDS="gdbm ncurses ncursesw zlib" |
slaxemulator@11123 | 16 BUILD_DEPENDS="ncurses-dev zlib-dev" |
slaxemulator@11123 | 17 |
pascal@24304 | 18 # What is the latest version available today? |
pascal@24304 | 19 current_version() |
pascal@24304 | 20 { |
pascal@24304 | 21 wget -O - ${WGET_URL%/*} 2>/dev/null | \ |
pascal@24304 | 22 sed "/$PACKAGE-/!d;s|.*$PACKAGE-||;s|.tar.*||" | tail -n1 |
pascal@24304 | 23 } |
pascal@24304 | 24 |
pascal@1531 | 25 # Rules to configure and make the package. |
pascal@1531 | 26 compile_rules() |
pascal@1531 | 27 { |
Hans-G?nter@21144 | 28 ./configure \ |
Hans-G?nter@21144 | 29 --bindir=/bin \ |
Hans-G?nter@21144 | 30 --disable-dynamic \ |
Hans-G?nter@21144 | 31 --enable-multibyte \ |
Hans-G?nter@21144 | 32 --enable-fndir=/usr/share/zsh/functions \ |
Hans-G?nter@21144 | 33 --enable-scriptdir=/usr/share/zsh/scripts \ |
Hans-G?nter@21144 | 34 --with-tcsetpgrp \ |
Hans-G?nter@21144 | 35 $CONFIGURE_ARGS && |
Hans-G?nter@21144 | 36 make -j 1 && |
slaxemulator@9723 | 37 make install |
pascal@1531 | 38 } |
pascal@1531 | 39 |
pascal@1531 | 40 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1531 | 41 genpkg_rules() |
al@18741 | 42 { |
Hans-G?nter@23795 | 43 mkdir $fs/etc |
Hans-G?nter@23795 | 44 mkdir -p $fs/usr/share/zsh |
Hans-G?nter@23795 | 45 mkdir -p $fs/usr/share/zsh/scripts |
Hans-G?nter@23795 | 46 |
Hans-G?nter@23795 | 47 cp -a $install/bin $fs |
pascal@1531 | 48 |
Hans-G?nter@21144 | 49 # Configuration files. |
slaxemulator@9723 | 50 cp $stuff/example.zshrc $fs/etc/zshrc |
al@18741 | 51 |
pascal@1531 | 52 #no way around this... gen_package will not automatically copy these |
Hans-G?nter@23795 | 53 cp -r $install/usr/share/zsh/functions \ |
Hans-G?nter@23795 | 54 $fs/usr/share/zsh |
pascal@1531 | 55 } |
pascal@1531 | 56 |
pascal@1531 | 57 # Post install commands for Tazpkg. |
pascal@1531 | 58 # Check /bin/sh stat. |
pascal@1531 | 59 # |
pascal@1531 | 60 post_install() |
pascal@1531 | 61 { |
pascal@18730 | 62 sh=$(readlink "$1/bin/sh") |
Hans-G?nter@23795 | 63 if [ "$sh" != '/bin/zsh' ] |
Hans-G?nter@23795 | 64 then |
al@18741 | 65 echo '' |
pascal@1531 | 66 echo "**** Actual SH link : $sh" |
al@18741 | 67 echo '' |
al@18741 | 68 echo -n 'Do you want Zsh for /bin/sh (y/N) ? : ' |
pascal@6073 | 69 read -t 30 answer < /dev/tty |
Hans-G?nter@23795 | 70 if [ "$answer" = 'y' ] |
Hans-G?nter@23795 | 71 then |
al@18741 | 72 echo '' |
al@18741 | 73 action 'Removing sh link to make a new one pointing on /bin/zsh...' |
pascal@18730 | 74 rm "$1/bin/sh" && ln -s /bin/zsh "$1/bin/sh" |
pascal@1531 | 75 status |
Hans-G?nter@23795 | 76 else |
al@18741 | 77 echo '' |
pascal@1531 | 78 echo "Leaving /bin/sh to : $sh" |
pascal@1531 | 79 fi |
pascal@1531 | 80 fi |
pascal@1531 | 81 } |
mojo@11667 | 82 |
mojo@11667 | 83 # Restore a valid sh link if needed. |
mojo@11667 | 84 pre_remove() |
mojo@11667 | 85 { |
al@18741 | 86 sh=$(readlink "$1/bin/sh") |
Hans-G?nter@23795 | 87 [ "$sh" != 'busybox' ] && |
Hans-G?nter@23795 | 88 ln -sf /bin/busybox "$1/bin/sh" |
mojo@11667 | 89 } |