wok view slitaz-base-files/receipt @ rev 130

Fix slitaz-base-files (gen_pkg)
author Christophe Lincoln <pankso@slitaz.org>
date Sun Jan 06 21:08:42 2008 +0100 (2008-01-06)
parents e510cfe46815
children 19689337a3a5
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 $fs/dev $fs/tmp
16 # Copy all rootfs from the stuff and set permissions.
17 cp -a $src/rootfs/* $fs
19 chown -R root.root $fs/*
20 chmod 1777 $fs/tmp
21 chmod 640 $fs/etc/shadow
22 chmod 640 $fs/etc/gshadow
24 # Populate /dev with /$fs/sbin/mktazdevs.sh.
25 ./$fs/sbin/mktazdevs.sh $fs/dev
27 # Creat /etc/mtab symlink.
28 cd $fs/etc
29 ln -s /proc/mounts mtab
30 }
32 # Pre and post install to backup all /etc/settings
33 #
34 pre_install()
35 {
36 local root
37 root=$1
38 echo "Creating backup of all files in /etc..."
39 cp -a $root/etc $root/tmp/etc.bak 2>/dev/null
40 }
42 post_install()
43 {
44 local root
45 root=$1
46 echo "Restoring files from /etc/etc.bak..."
47 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null
48 rm -rf $root/tmp/etc.bak
50 # Remove old base-file pkg info
51 rm -rf $root/var/lib/tazpkg/installed/base-files
53 # Reset permission.
54 chmod 640 $root/etc/shadow
55 chmod 640 $root/etc/gshadow
57 if ! grep -q audio $root/etc/group; then
58 if [ -n "$root" ]; then
59 cp /etc/group $root/etc/group
60 else
61 addgroup -g 20 audio
62 fi
63 fi
65 # Add crond to daemons confi file
66 if ! grep -q CROND_OPTIONS $root/etc/daemons.conf; then
67 echo '# Cron daemon options.' >> $root/etc/daemons.conf
68 echo 'CROND_OPTIONS="-b"' >> $root/etc/daemons.conf
69 echo '' >> $root/etc/daemons.conf
70 fi
71 }
72 SELF_INSTALL=1