wok-6.x annotate slitaz-base-files/receipt @ rev 941

xarchive: enhance tar and cpio support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jun 24 13:47:32 2008 +0000 (2008-06-24)
parents aae4d14184d9
children 293e658657ce
rev   line source
pankso@1 1 # SliTaz package receipt.
pankso@1 2
pankso@1 3 PACKAGE="slitaz-base-files"
pankso@801 4 VERSION="2.2"
pankso@1 5 CATEGORY="base-system"
pankso@1 6 SHORT_DESC="Linux tree and the necessary files for the base system."
pankso@1 7 MAINTAINER="pankso@slitaz.org"
pankso@1 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
pankso@1 9 WEB_SITE="http://www.slitaz.org/"
pankso@1 10 WGET_URL="http://download.tuxfamily.org/slitaz/sources/base-files/$TARBALL"
pankso@1 11
pankso@1 12 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@1 13 genpkg_rules()
pankso@1 14 {
pankso@131 15 mkdir -p \
pankso@132 16 $fs/bin \
pankso@132 17 $fs/dev \
pankso@132 18 $fs/home \
pankso@132 19 $fs/media/cdrom \
pankso@132 20 $fs/media/flash \
pankso@132 21 $fs/media/usbdisk \
pankso@132 22 $fs/mnt \
pankso@132 23 $fs/proc \
pankso@132 24 $fs/root \
pankso@132 25 $fs/sbin \
pankso@132 26 $fs/sys \
pankso@132 27 $fs/tmp \
pankso@132 28 $fs/usr/bin \
pankso@132 29 $fs/usr/games \
pankso@132 30 $fs/usr/lib \
pankso@132 31 $fs/usr/local \
pankso@132 32 $fs/usr/sbin \
pankso@132 33 $fs/usr/share/doc \
pankso@132 34 $fs/var/cache \
pankso@132 35 $fs/var/games \
pankso@132 36 $fs/var/lib \
pankso@132 37 $fs/var/lock \
pankso@132 38 $fs/var/log \
pankso@132 39 $fs/var/run \
pankso@132 40 $fs/var/spool \
pankso@801 41 $fs/var/tmp
pankso@801 42
pankso@1 43 # Copy all rootfs from the stuff and set permissions.
pankso@1 44 cp -a $src/rootfs/* $fs
pankso@801 45
pankso@1 46 chown -R root.root $fs/*
pankso@1 47 chmod 1777 $fs/tmp
pankso@1 48 chmod 640 $fs/etc/shadow
pankso@1 49 chmod 640 $fs/etc/gshadow
pankso@607 50 chmod 0750 $fs/root
pankso@801 51
pankso@1 52 # Populate /dev with /$fs/sbin/mktazdevs.sh.
pankso@1 53 ./$fs/sbin/mktazdevs.sh $fs/dev
pankso@801 54
pankso@1 55 # Creat /etc/mtab symlink.
pankso@1 56 cd $fs/etc
pankso@1 57 ln -s /proc/mounts mtab
pankso@1 58 }
pankso@1 59
pankso@1 60 # Pre and post install to backup all /etc/settings
pankso@1 61 #
pankso@1 62 pre_install()
pankso@1 63 {
pankso@1 64 local root
pankso@1 65 root=$1
pankso@52 66 echo "Creating backup of all files in /etc..."
pankso@52 67 cp -a $root/etc $root/tmp/etc.bak 2>/dev/null
pankso@1 68 }
pankso@1 69
pankso@1 70 post_install()
pankso@1 71 {
pankso@1 72 local root
pankso@1 73 root=$1
pankso@52 74 echo "Restoring files from /etc/etc.bak..."
pankso@52 75 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null
pankso@1 76 rm -rf $root/tmp/etc.bak
pankso@801 77
pankso@1 78 # Reset permission.
pankso@1 79 chmod 640 $root/etc/shadow
pankso@1 80 chmod 640 $root/etc/gshadow
pankso@801 81
pankso@1 82 if ! grep -q audio $root/etc/group; then
pankso@1 83 if [ -n "$root" ]; then
pankso@1 84 cp /etc/group $root/etc/group
pankso@1 85 else
pankso@1 86 addgroup -g 20 audio
pankso@1 87 fi
pankso@1 88 fi
pankso@801 89
pankso@607 90 # daemons.conf (tftp + dnsd)
pankso@607 91 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
pankso@607 92 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
pankso@607 93 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
pankso@607 94 echo '' >> $root/etc/daemons.conf
pankso@607 95 fi
pankso@607 96 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
pankso@607 97 echo '# Domain name server options.' >> $root/etc/daemons.conf
pankso@607 98 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
pankso@607 99 echo '' >> $root/etc/daemons.conf
pankso@607 100 fi
pankso@1 101 }
pankso@1 102 SELF_INSTALL=1