wok-current 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 | 36917db46db6 |
children | 47ae9d067aef |
files | slitaz-base-files/receipt |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/slitaz-base-files/receipt Thu Dec 13 11:25:28 2007 +0100 1.3 @@ -0,0 +1,73 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="slitaz-base-files" 1.7 +VERSION="1.0" 1.8 +CATEGORY="base-system" 1.9 +SHORT_DESC="Linux tree and the necessary files for the base system." 1.10 +MAINTAINER="pankso@slitaz.org" 1.11 +TARBALL="$PACKAGE-$VERSION.tar.gz" 1.12 +WEB_SITE="http://www.slitaz.org/" 1.13 +WGET_URL="http://download.tuxfamily.org/slitaz/sources/base-files/$TARBALL" 1.14 + 1.15 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.16 +genpkg_rules() 1.17 +{ 1.18 + # Copy all rootfs from the stuff and set permissions. 1.19 + cp -a $src/rootfs/* $fs 1.20 + 1.21 + chown -R root.root $fs/* 1.22 + chmod 1777 $fs/tmp 1.23 + chmod 640 $fs/etc/shadow 1.24 + chmod 640 $fs/etc/gshadow 1.25 + 1.26 + # Populate /dev with /$fs/sbin/mktazdevs.sh. 1.27 + ./$fs/sbin/mktazdevs.sh $fs/dev 1.28 + 1.29 + # Creat /etc/mtab symlink. 1.30 + cd $fs/etc 1.31 + ln -s /proc/mounts mtab 1.32 +} 1.33 + 1.34 +# Pre and post install to backup all /etc/settings 1.35 +# 1.36 +pre_install() 1.37 +{ 1.38 + local root 1.39 + root=$1 1.40 + echo -n "Creating backup of all files in /etc..." 1.41 + cp -a $root/etc $root/tmp/etc.bak 1.42 + status 1.43 +} 1.44 + 1.45 +post_install() 1.46 +{ 1.47 + local root 1.48 + root=$1 1.49 + echo -n "Restoring files from /etc/etc.bak..." 1.50 + cp -a $root/tmp/etc.bak/* $root/etc 1.51 + rm -rf $root/tmp/etc.bak 1.52 + status 1.53 + 1.54 + # Remove old base-file pkg info 1.55 + rm -rf $root/var/lib/tazpkg/installed/base-files 1.56 + 1.57 + # Reset permission. 1.58 + chmod 640 $root/etc/shadow 1.59 + chmod 640 $root/etc/gshadow 1.60 + 1.61 + if ! grep -q audio $root/etc/group; then 1.62 + if [ -n "$root" ]; then 1.63 + cp /etc/group $root/etc/group 1.64 + else 1.65 + addgroup -g 20 audio 1.66 + fi 1.67 + fi 1.68 + 1.69 + # Add crond to daemons confi file 1.70 + if ! grep -q CROND_OPTIONS $root/etc/daemons.conf; then 1.71 + echo '# Cron daemon options.' >> $root/etc/daemons.conf 1.72 + echo 'CROND_OPTIONS="-b"' >> $root/etc/daemons.conf 1.73 + echo '' >> $root/etc/daemons.conf 1.74 + fi 1.75 +} 1.76 +SELF_INSTALL=1