wok rev 198

Add pkg slitaz-hacker (user hacker for LiveCD)
author Christophe Lincoln <pankso@slitaz.org>
date Wed Feb 13 00:12:35 2008 +0100 (2008-02-13)
parents 03c68ab3133c
children 3e085751bf3a
files slitaz-hacker/receipt slitaz-hacker/stuff/README slitaz-hacker/stuff/ash_history slitaz-hacker/stuff/profile
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/slitaz-hacker/receipt	Wed Feb 13 00:12:35 2008 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="slitaz-hacker"
     1.7 +VERSION="1.0"
     1.8 +CATEGORY="base-system"
     1.9 +SHORT_DESC="SliTaz user hacker."
    1.10 +MAINTAINER="pankso@slitaz.org"
    1.11 +WEB_SITE="http://www.slitaz.org/"
    1.12 +
    1.13 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.14 +genpkg_rules()
    1.15 +{
    1.16 +	# /home/hacker directories.
    1.17 +	#
    1.18 +	mkdir -p $fs/home/hacker/Documents \
    1.19 +		$fs/home/hacker/Downloads \
    1.20 +		$fs/home/hacker/Templates \
    1.21 +		$fs/home/hacker/.local/bin \
    1.22 +		$fs/home/hacker/.local/share
    1.23 +	cp -a stuff/ash_history $fs/home/hacke/.ash_history
    1.24 +	cp -a stuff/profile $fs/home/hacke/.profile
    1.25 +}
    1.26 +
    1.27 +pre_install()
    1.28 +{
    1.29 +	local root
    1.30 +	root=$1
    1.31 +	# Go for echoing on configuration files if any hacker was found.
    1.32 +	#
    1.33 +	if ! grep -q hacker $root/etc/passwd; then
    1.34 +		echo -n "Configuring $root/etc..."
    1.35 +		echo 'hacker:x:500:500:Linux User,,,:/home/hacker:/bin/ash' >> $root/etc/passwd
    1.36 +		echo 'hacker::13646:0:99999:7:::' >> $root/etc/shadow
    1.37 +		echo 'hacker:x:500:' >> $root/etc/group
    1.38 +		echo 'hacker:!::' >> $root/etc/gshadow
    1.39 +		status
    1.40 +	else
    1.41 +		echo "Hacker is already in : $root/etc/passwd"
    1.42 +	fi
    1.43 +	# Hacker can listen to music
    1.44 +	#
    1.45 +	if grep -q audio $root/etc/group; then
    1.46 +		if ! grep -q "audio:x:20:hacker" $root/etc/group; then
    1.47 +			sed -i s/'audio:x:20:'/'audio:x:20:hacker'/ $root/etc/group
    1.48 +		fi
    1.49 +	fi
    1.50 +	# Change permissions.
    1.51 +	#
    1.52 +	echo -n "Chmodig all files in /home/hacker..."
    1.53 +	chown -R 500.500 $root/home/hacker
    1.54 +	status
    1.55 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/slitaz-hacker/stuff/README	Wed Feb 13 00:12:35 2008 +0100
     2.3 @@ -0,0 +1,8 @@
     2.4 +README - slitaz-hacker (package)
     2.5 +================================================================================
     2.6 +
     2.7 +slitaz-hacker package provide SHell profile and Ash history, creat a few 
     2.8 +directories (done by the receipt) and configure system wide file such as
     2.9 +/etc/passwd or /etc/group. Note that some addfiles are installed for hacker 
    2.10 +when the LiveCD flavor is generated, depending on the flavor packages list.
    2.11 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/slitaz-hacker/stuff/ash_history	Wed Feb 13 00:12:35 2008 +0100
     3.3 @@ -0,0 +1,18 @@
     3.4 +ls -al
     3.5 +cat /proc/cpuinfo
     3.6 +cat /proc/partitions
     3.7 +free
     3.8 +ifconfig -a
     3.9 +exit
    3.10 +tazpkg list
    3.11 +cat Images/ASCII/tux.txt
    3.12 +less -EM /usr/share/doc/tazpkg/tazpkg.txt
    3.13 +less -EM /usr/share/doc/slitaz/apropos.txt
    3.14 +nInvaders
    3.15 +htop
    3.16 +rhapsody
    3.17 +nano
    3.18 +retawq 
    3.19 +retawq http://localhost/server-status
    3.20 +retawq http://localhost/
    3.21 +clex
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/slitaz-hacker/stuff/profile	Wed Feb 13 00:12:35 2008 +0100
     4.3 @@ -0,0 +1,51 @@
     4.4 +# ~/.profile: Executed by Bourne-compatible login SHells.
     4.5 +#
     4.6 +
     4.7 +# Path to personal scripts and executables (~/.local/bin).
     4.8 +#
     4.9 +if [ -d "$HOME/.local/bin" ] ; then
    4.10 +	PATH=$HOME/.local/bin:$PATH
    4.11 +	export PATH
    4.12 +fi
    4.13 +
    4.14 +# Java home directory path.
    4.15 +#
    4.16 +#JAVA_HOME=$HOME/Bin/jre1.6.0_03
    4.17 +#JAVA_BINDIR=$JAVA_HOME/bin
    4.18 +#if [ -d "$HOME/Bin" ] ; then
    4.19 +#	export PATH=$JAVA_BINDIR:$PATH
    4.20 +#fi
    4.21 +
    4.22 +# Environnement variables and prompt for Ash SHell
    4.23 +# or Bash.
    4.24 +#
    4.25 +
    4.26 +# Classic prompt.
    4.27 +PS1='\u@\h:\w\$ '
    4.28 +
    4.29 +# Light green and blue colored prompt.
    4.30 +#PS1='\e[1;32m\u@\h\e[0m:\e[1;34m\w\e[0m\$ '
    4.31 +
    4.32 +# Light blue or yellow.
    4.33 +#PS1='\e[1;34m\u@\h:\w\e[0m\$ '
    4.34 +#PS1='\[\033[1;33m\]\u@\h:\w\[\033[0m\]\$ '
    4.35 +
    4.36 +EDITOR='nano'
    4.37 +PAGER='less -EM'
    4.38 +
    4.39 +export PS1 EDITOR PAGER
    4.40 +
    4.41 +# Alias definitions.
    4.42 +#
    4.43 +alias df='df -h'
    4.44 +alias du='du -h'
    4.45 +
    4.46 +alias ls='ls -p'
    4.47 +alias ll='ls -l'
    4.48 +alias la='ls -la'
    4.49 +
    4.50 +# Avoid errors... use -f to skip confirmation.
    4.51 +alias rm='rm -i'
    4.52 +alias mv='mv -i'
    4.53 +
    4.54 +umask 022