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