wok-current view slitaz-base-files/receipt @ rev 131

Creat base dir with slitaz-base-files receipt
author Christophe Lincoln <pankso@slitaz.org>
date Sun Jan 06 21:17:31 2008 +0100 (2008-01-06)
parents 34227d699aa0
children d703295403ca
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-base-files"
4 VERSION="1.1"
5 CATEGORY="base-system"
6 SHORT_DESC="Linux tree and the necessary files for the base system."
7 MAINTAINER="pankso@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.slitaz.org/"
10 WGET_URL="http://download.tuxfamily.org/slitaz/sources/base-files/$TARBALL"
12 # Rules to gen a SliTaz package suitable for Tazpkg.
13 genpkg_rules()
14 {
15 mkdir -p \
16 $fs/bin
17 $fs/dev
18 $fs/home
19 $fs/media/cdrom
20 $fs/media/flash
21 $fs/media/usbdisk
22 $fs/mnt
23 $fs/proc
24 $fs/root
25 $fs/sbin
26 $fs/sys
27 $fs/tmp
28 $fs/usr/bin
29 $fs/usr/games
30 $fs/usr/lib
31 $fs/usr/local
32 $fs/usr/sbin
33 $fs/usr/share/doc
34 $fs/var/cache
35 $fs/var/games
36 $fs/var/lib
37 $fs/var/lock
38 $fs/var/log
39 $fs/var/run
40 $fs/var/spool
41 $fs/var/tmp
44 # Copy all rootfs from the stuff and set permissions.
45 cp -a $src/rootfs/* $fs
47 chown -R root.root $fs/*
48 chmod 1777 $fs/tmp
49 chmod 640 $fs/etc/shadow
50 chmod 640 $fs/etc/gshadow
52 # Populate /dev with /$fs/sbin/mktazdevs.sh.
53 ./$fs/sbin/mktazdevs.sh $fs/dev
55 # Creat /etc/mtab symlink.
56 cd $fs/etc
57 ln -s /proc/mounts mtab
58 }
60 # Pre and post install to backup all /etc/settings
61 #
62 pre_install()
63 {
64 local root
65 root=$1
66 echo "Creating backup of all files in /etc..."
67 cp -a $root/etc $root/tmp/etc.bak 2>/dev/null
68 }
70 post_install()
71 {
72 local root
73 root=$1
74 echo "Restoring files from /etc/etc.bak..."
75 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null
76 rm -rf $root/tmp/etc.bak
78 # Remove old base-file pkg info
79 rm -rf $root/var/lib/tazpkg/installed/base-files
81 # Reset permission.
82 chmod 640 $root/etc/shadow
83 chmod 640 $root/etc/gshadow
85 if ! grep -q audio $root/etc/group; then
86 if [ -n "$root" ]; then
87 cp /etc/group $root/etc/group
88 else
89 addgroup -g 20 audio
90 fi
91 fi
93 # Add crond to daemons confi file (compatibility)
94 if ! grep -q CROND_OPTIONS $root/etc/daemons.conf; then
95 echo '# Cron daemon options.' >> $root/etc/daemons.conf
96 echo 'CROND_OPTIONS="-b"' >> $root/etc/daemons.conf
97 echo '' >> $root/etc/daemons.conf
98 fi
99 }
100 SELF_INSTALL=1