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