wok-6.x annotate slitaz-base-files/receipt @ rev 581
Add: newt-dev
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Tue Apr 15 14:36:35 2008 +0200 (2008-04-15) |
parents | 2ac4fc760d5c |
children | 0ae3a5e4f21a |
rev | line source |
---|---|
pankso@1 | 1 # SliTaz package receipt. |
pankso@1 | 2 |
pankso@1 | 3 PACKAGE="slitaz-base-files" |
pankso@492 | 4 VERSION="1.5" |
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@347 | 41 $fs/var/tmp |
pankso@131 | 42 |
pankso@1 | 43 # Copy all rootfs from the stuff and set permissions. |
pankso@1 | 44 cp -a $src/rootfs/* $fs |
pankso@1 | 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@1 | 50 |
pankso@1 | 51 # Populate /dev with /$fs/sbin/mktazdevs.sh. |
pankso@1 | 52 ./$fs/sbin/mktazdevs.sh $fs/dev |
pankso@1 | 53 |
pankso@1 | 54 # Creat /etc/mtab symlink. |
pankso@1 | 55 cd $fs/etc |
pankso@1 | 56 ln -s /proc/mounts mtab |
pankso@1 | 57 } |
pankso@1 | 58 |
pankso@1 | 59 # Pre and post install to backup all /etc/settings |
pankso@1 | 60 # |
pankso@1 | 61 pre_install() |
pankso@1 | 62 { |
pankso@1 | 63 local root |
pankso@1 | 64 root=$1 |
pankso@52 | 65 echo "Creating backup of all files in /etc..." |
pankso@52 | 66 cp -a $root/etc $root/tmp/etc.bak 2>/dev/null |
pankso@1 | 67 } |
pankso@1 | 68 |
pankso@1 | 69 post_install() |
pankso@1 | 70 { |
pankso@1 | 71 local root |
pankso@1 | 72 root=$1 |
pankso@52 | 73 echo "Restoring files from /etc/etc.bak..." |
pankso@52 | 74 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null |
pankso@1 | 75 rm -rf $root/tmp/etc.bak |
pankso@1 | 76 |
pankso@1 | 77 # Reset permission. |
pankso@1 | 78 chmod 640 $root/etc/shadow |
pankso@1 | 79 chmod 640 $root/etc/gshadow |
pankso@1 | 80 |
pankso@1 | 81 if ! grep -q audio $root/etc/group; then |
pankso@1 | 82 if [ -n "$root" ]; then |
pankso@1 | 83 cp /etc/group $root/etc/group |
pankso@1 | 84 else |
pankso@1 | 85 addgroup -g 20 audio |
pankso@1 | 86 fi |
pankso@1 | 87 fi |
pankso@1 | 88 } |
pankso@1 | 89 SELF_INSTALL=1 |