wok-stable view slitaz-base-files/receipt @ rev 1

Add 'slitaz-base-files' (provide linux tree + /etc)
author Christophe Lincoln <pankso@slitaz.org>
date Thu Dec 13 11:25:28 2007 +0100 (2007-12-13)
parents
children fa1dad350eb2
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-base-files"
4 VERSION="1.0"
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 # Copy all rootfs from the stuff and set permissions.
16 cp -a $src/rootfs/* $fs
18 chown -R root.root $fs/*
19 chmod 1777 $fs/tmp
20 chmod 640 $fs/etc/shadow
21 chmod 640 $fs/etc/gshadow
23 # Populate /dev with /$fs/sbin/mktazdevs.sh.
24 ./$fs/sbin/mktazdevs.sh $fs/dev
26 # Creat /etc/mtab symlink.
27 cd $fs/etc
28 ln -s /proc/mounts mtab
29 }
31 # Pre and post install to backup all /etc/settings
32 #
33 pre_install()
34 {
35 local root
36 root=$1
37 echo -n "Creating backup of all files in /etc..."
38 cp -a $root/etc $root/tmp/etc.bak
39 status
40 }
42 post_install()
43 {
44 local root
45 root=$1
46 echo -n "Restoring files from /etc/etc.bak..."
47 cp -a $root/tmp/etc.bak/* $root/etc
48 rm -rf $root/tmp/etc.bak
49 status
51 # Remove old base-file pkg info
52 rm -rf $root/var/lib/tazpkg/installed/base-files
54 # Reset permission.
55 chmod 640 $root/etc/shadow
56 chmod 640 $root/etc/gshadow
58 if ! grep -q audio $root/etc/group; then
59 if [ -n "$root" ]; then
60 cp /etc/group $root/etc/group
61 else
62 addgroup -g 20 audio
63 fi
64 fi
66 # Add crond to daemons confi file
67 if ! grep -q CROND_OPTIONS $root/etc/daemons.conf; then
68 echo '# Cron daemon options.' >> $root/etc/daemons.conf
69 echo 'CROND_OPTIONS="-b"' >> $root/etc/daemons.conf
70 echo '' >> $root/etc/daemons.conf
71 fi
72 }
73 SELF_INSTALL=1