wok annotate conky-theme-onsea/receipt @ rev 25031

Add fatcat
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri May 20 09:25:51 2022 +0000 (2022-05-20)
parents 4bccb65c3f35
children
rev   line source
hackdorte@19066 1 # SliTaz package receipt.
hackdorte@19066 2
hackdorte@19066 3 PACKAGE="conky-theme-onsea"
hackdorte@19066 4 VERSION="0.1"
hackdorte@19066 5 CATEGORY="x-window"
hackdorte@19066 6 SHORT_DESC="A smooth theme for conky with smoke color."
hackdorte@19066 7 MAINTAINER="hackdorte@sapo.pt"
hackdorte@19066 8 LICENSE="PublicDomain"
hackdorte@19066 9 SOURCE="onsea"
hackdorte@19066 10 WEB_SITE="http://people.slitaz.org/~leonardolaporte"
hackdorte@19066 11 STUFF_DIR="lab.slitaz/5.0/pkg/conky/1.9.0"
hackdorte@19066 12 TARBALL="$SOURCE-$VERSION.tar.gz"
hackdorte@19066 13 WGET_URL="${WEB_SITE}/$STUFF_DIR/$TARBALL"
hackdorte@19069 14 TAGS="conky desktop monitoring theme"
hackdorte@19069 15 HOST_ARCH="i486"
hackdorte@19066 16
hackdorte@19066 17 DEPENDS="conky"
hackdorte@19066 18 BUILD_DEPENDS="wget"
hackdorte@19066 19
hackdorte@19069 20 BAK_DIR=".conky-backup"
hackdorte@19069 21 BAK_FILE="old_conkyrc"
hackdorte@19066 22
pascal@24436 23 # What is the latest version available today?
pascal@24436 24 current_version()
pascal@24436 25 {
pascal@24436 26 wget -O - ${WGET_URL%/*} 2>/dev/null | \
pascal@24436 27 sed "/latest/d;/$SOURCE-[0-9]/!d;/tar/!d;s|.*$SOURCE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
pascal@24436 28 }
pascal@24436 29
hackdorte@19066 30 # Rules to configure and make the package.
hackdorte@19066 31 compile_rules()
hackdorte@19066 32 {
hackdorte@19066 33 mkdir -p $install/usr/share/conky/themes/$SOURCE
hackdorte@19066 34 cp -a $src/.conkyrc $install/usr/share/conky/themes/$SOURCE/.conkyrc
hackdorte@19066 35 }
hackdorte@19066 36
hackdorte@19066 37 # Rules to gen a SliTaz package suitable for Tazpkg.
hackdorte@19066 38 genpkg_rules()
hackdorte@19066 39 {
hackdorte@19066 40 cp -a $install/* $fs
hackdorte@19066 41 }
hackdorte@19066 42
hackdorte@19066 43 pre_install()
hackdorte@19066 44 {
hackdorte@19066 45 # Build current ".conkyrc" backup.
pascal@19068 46 if [ -e $1/home/$USER/.conkyrc ]; then
hackdorte@19069 47 mkdir -p $1/home/$USER/$BAK_DIR/$BAK_FILE
hackdorte@19069 48 mv $1/home/$USER/.conkyrc $1/home/$USER/$BAK_DIR/$BAK_FILE
hackdorte@19066 49
hackdorte@19066 50 # README (Alert file only).
pascal@19068 51 cat > $1/home/$USER/$BAK_DIR/README <<EOT
hackdorte@19066 52
hackdorte@19066 53 $PACKAGE Backup
hackdorte@19066 54 ==============================================
hackdorte@19066 55 $(date)
hackdorte@19066 56
hackdorte@19066 57 Please do not remove this directory manually.
hackdorte@19066 58
hackdorte@19066 59 Run: tazpkg remove $PACKAGE
hackdorte@19066 60
hackdorte@19066 61 EOT
hackdorte@19066 62 fi
hackdorte@19066 63 }
hackdorte@19066 64
hackdorte@19066 65 post_install()
hackdorte@19066 66 {
hackdorte@19066 67 # Install new ".conkyrc" to (home/user).
hackdorte@19066 68 # And create a link to the original file.
pascal@19068 69 cd $1/home/$USER
pascal@19068 70 ln -s /usr/share/conky/themes/$SOURCE/.conkyrc $1/home/$USER/.conkyrc
hackdorte@19069 71 ### chmod 755 $1/home/$USER/.conkyrc
hackdorte@19066 72
hackdorte@19066 73 # Check the conky process and run new theme.
hackdorte@19069 74 [ "$1" ] ||
hackdorte@19066 75 if busybox pidof conky >>/dev/null 2>&1; then
hackdorte@19066 76 su - $USER -c "killall conky" && su - $USER -c "conky &";
hackdorte@19066 77 else
hackdorte@19066 78 su - $USER -c "conky &";
hackdorte@19066 79 fi
hackdorte@19066 80 }
hackdorte@19066 81
hackdorte@19066 82 pre_remove()
hackdorte@19066 83 {
hackdorte@19066 84 # Restore old ".conkyrc" backup.
pascal@19068 85 if [ -e $1/home/$USER/$BAK_DIR/$BAK_FILE/.conkyrc ]; then
pascal@19068 86 mv $1/home/$USER/$BAK_DIR/$BAK_FILE/.conkyrc $1/home/$USER
pascal@19068 87 chmod 777 $1/home/$USER/.conkyrc
pascal@19068 88 rm -rf $1/home/$USER/$BAK_DIR/$BAK_FILE
pascal@19068 89 rm -rf $1/home/$USER/$BAK_DIR/README
hackdorte@19066 90 else
hackdorte@19069 91 rm -irf $1/home/$USER/.conkyrc
hackdorte@19066 92 fi
hackdorte@19066 93 }
hackdorte@19066 94
hackdorte@19066 95 post_remove()
hackdorte@19066 96 {
hackdorte@19066 97 # Check the conky process and run old theme.
hackdorte@19069 98 [ "$1" ] ||
hackdorte@19066 99 if busybox pidof conky >>/dev/null 2>&1; then
hackdorte@19066 100 su - $USER -c "killall conky" && su - $USER -c "conky &";
hackdorte@19066 101 else
hackdorte@19066 102 su - $USER -c "conky &";
hackdorte@19066 103 fi
hackdorte@19066 104 }