wok view slitaz-hacker/receipt @ rev 718

Up: slitaz-hacker (1.5)
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 02 21:21:59 2008 +0200 (2008-05-02)
parents ffc85adee781
children 3b9b5086a37d
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-hacker"
4 VERSION="1.5"
5 CATEGORY="base-system"
6 SHORT_DESC="SliTaz user hacker."
7 DEPENDS="slitaz-base-files slitaz-configs"
8 MAINTAINER="pankso@slitaz.org"
9 WEB_SITE="http://www.slitaz.org/"
11 # Rules to gen a SliTaz package suitable for Tazpkg.
12 genpkg_rules()
13 {
14 # /home/hacker directories.
15 #
16 mkdir -p \
17 $fs/home/hacker/Documents \
18 $fs/home/hacker/Downloads \
19 $fs/home/hacker/Music \
20 $fs/home/hacker/Videos \
21 $fs/home/hacker/.local/bin \
22 $fs/home/hacker/.local/share \
23 $fs/home/hacker/.mozilla/plugins
24 cp -a stuff/hacker $fs/home
25 # Change permissions.
26 #
27 echo -n "Chmodig all files in $fs/home/hacker..."
28 chown -R 500.500 $fs/home/hacker
29 status
30 }
32 pre_install()
33 {
34 local root
35 root=$1
36 # Go for echoing on configuration files if any hacker was found.
37 #
38 if ! grep -q hacker $root/etc/passwd; then
39 echo -n "Configuring $root/etc..."
40 echo 'hacker:x:500:500:Linux User,,,:/home/hacker:/bin/ash' >> $root/etc/passwd
41 echo 'hacker::13646:0:99999:7:::' >> $root/etc/shadow
42 echo 'hacker:x:500:' >> $root/etc/group
43 echo 'hacker:!::' >> $root/etc/gshadow
44 status
45 else
46 echo "Hacker is already in : $root/etc/passwd"
47 fi
48 # Hacker can listen to music
49 #
50 if grep -q audio $root/etc/group; then
51 if ! grep -q "audio:x:20:hacker" $root/etc/group; then
52 sed -i s/'audio:x:20:'/'audio:x:20:hacker'/ $root/etc/group
53 fi
54 fi
55 # Backups
56 for i in '.ash_history .profile .gtk-bookmarks'
57 do
58 if [ -f $root/home/hacker/$i ]; then
59 cp -a $root/home/hacker/$i $root/home/hacker/$i.bak
60 fi
61 done
62 }
64 # Restore backups
65 pre_install()
66 {
67 for i in '.ash_history .profile .gtk-bookmarks'
68 do
69 if [ -f $root/home/hacker/$i.bak ]; then
70 cp -a $root/home/hacker/$i.bak $root/home/hacker/$i
71 fi
72 done
73 }