wok-6.x annotate slitaz-base-files/receipt @ rev 6988
Up: slitaz-base-files to 4.1.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sat Oct 30 02:35:54 2010 +0000 (2010-10-30) |
parents | 8161191e8919 |
children | d0c6a2d1c542 |
rev | line source |
---|---|
pankso@1 | 1 # SliTaz package receipt. |
pankso@1 | 2 |
pankso@1 | 3 PACKAGE="slitaz-base-files" |
slaxemulator@6988 | 4 VERSION="4.1" |
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" |
slaxemulator@6988 | 8 #TARBALL="$PACKAGE-$VERSION.tar.gz" |
slaxemulator@6988 | 9 TARBALL="$VERSION.tar.gz" |
pankso@1 | 10 WEB_SITE="http://www.slitaz.org/" |
slaxemulator@6988 | 11 #WGET_URL="http://mirror.slitaz.org/sources/base-files/$TARBALL" |
slaxemulator@6988 | 12 # using an hg URL because tarball is not avaible at this moment |
slaxemulator@6988 | 13 WGET_URL="http://hg.slitaz.org/$PACKAGE/archive/$TARBALL" |
pascal@1212 | 14 CONFIG_FILES=" |
pascal@1212 | 15 /etc/adduser.conf |
pascal@1212 | 16 /etc/passwd |
pascal@1212 | 17 /etc/fstab |
pascal@1212 | 18 /etc/issue |
pascal@1212 | 19 /etc/hosts |
pascal@1212 | 20 /etc/host.conf |
pascal@1212 | 21 /etc/hostname |
pascal@1212 | 22 /etc/group |
pascal@1212 | 23 /etc/gshadow |
pascal@1212 | 24 /etc/shadow |
pascal@1212 | 25 /etc/daemons.conf |
pascal@1212 | 26 /etc/nsswitch.conf |
pascal@1212 | 27 /etc/networks |
pascal@1212 | 28 /etc/profile |
pascal@1212 | 29 /etc/securetty |
pascal@1212 | 30 /etc/services |
pascal@1212 | 31 /etc/shells" |
pankso@1 | 32 |
pankso@1 | 33 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@1 | 34 genpkg_rules() |
pankso@1 | 35 { |
pankso@131 | 36 mkdir -p \ |
pankso@132 | 37 $fs/bin \ |
pankso@132 | 38 $fs/dev \ |
pankso@132 | 39 $fs/home \ |
pankso@132 | 40 $fs/media/cdrom \ |
pankso@132 | 41 $fs/media/flash \ |
pankso@132 | 42 $fs/media/usbdisk \ |
pankso@132 | 43 $fs/mnt \ |
pankso@132 | 44 $fs/proc \ |
pankso@132 | 45 $fs/root \ |
pankso@132 | 46 $fs/sbin \ |
pankso@132 | 47 $fs/sys \ |
pankso@132 | 48 $fs/tmp \ |
pankso@132 | 49 $fs/usr/bin \ |
pankso@132 | 50 $fs/usr/games \ |
pankso@132 | 51 $fs/usr/lib \ |
pankso@132 | 52 $fs/usr/local \ |
pankso@132 | 53 $fs/usr/sbin \ |
pankso@132 | 54 $fs/usr/share/doc \ |
pankso@132 | 55 $fs/var/cache \ |
pankso@132 | 56 $fs/var/games \ |
pankso@132 | 57 $fs/var/lib \ |
pankso@132 | 58 $fs/var/lock \ |
pankso@132 | 59 $fs/var/log \ |
pankso@132 | 60 $fs/var/run \ |
pankso@132 | 61 $fs/var/spool \ |
pankso@801 | 62 $fs/var/tmp |
pankso@801 | 63 |
pankso@1 | 64 # Copy all rootfs from the stuff and set permissions. |
pankso@1 | 65 cp -a $src/rootfs/* $fs |
pankso@801 | 66 |
pankso@1 | 67 chown -R root.root $fs/* |
pankso@1 | 68 chmod 1777 $fs/tmp |
pankso@1 | 69 chmod 640 $fs/etc/shadow |
pankso@1 | 70 chmod 640 $fs/etc/gshadow |
pankso@607 | 71 chmod 0750 $fs/root |
pankso@801 | 72 |
pankso@1 | 73 # Populate /dev with /$fs/sbin/mktazdevs.sh. |
pankso@1 | 74 ./$fs/sbin/mktazdevs.sh $fs/dev |
pankso@801 | 75 |
pankso@1 | 76 # Creat /etc/mtab symlink. |
pankso@1 | 77 cd $fs/etc |
pankso@1 | 78 ln -s /proc/mounts mtab |
pankso@1 | 79 } |
pankso@1 | 80 |
pankso@1 | 81 # Pre and post install to backup all /etc/settings |
pankso@1 | 82 # |
pankso@1 | 83 pre_install() |
pankso@1 | 84 { |
pankso@1 | 85 local root |
pankso@1 | 86 root=$1 |
pankso@52 | 87 echo "Creating backup of all files in /etc..." |
pankso@52 | 88 cp -a $root/etc $root/tmp/etc.bak 2>/dev/null |
pankso@1 | 89 } |
pankso@1 | 90 |
pankso@1 | 91 post_install() |
pankso@1 | 92 { |
pankso@1 | 93 local root |
pankso@1 | 94 root=$1 |
pankso@52 | 95 echo "Restoring files from /etc/etc.bak..." |
pankso@52 | 96 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null |
pankso@1 | 97 rm -rf $root/tmp/etc.bak |
pankso@801 | 98 |
pankso@1 | 99 # Reset permission. |
pankso@1 | 100 chmod 640 $root/etc/shadow |
pankso@1 | 101 chmod 640 $root/etc/gshadow |
pankso@801 | 102 |
pankso@1 | 103 if ! grep -q audio $root/etc/group; then |
pascal@5125 | 104 chroot $root/ /bin/addgroup -g 20 audio |
pankso@1 | 105 fi |
pankso@801 | 106 |
pankso@607 | 107 # daemons.conf (tftp + dnsd) |
pankso@607 | 108 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then |
pankso@607 | 109 echo '# Tftp daemon options.' >> $root/etc/daemons.conf |
pankso@607 | 110 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf |
pankso@607 | 111 echo '' >> $root/etc/daemons.conf |
pankso@607 | 112 fi |
pankso@607 | 113 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then |
pankso@607 | 114 echo '# Domain name server options.' >> $root/etc/daemons.conf |
pankso@607 | 115 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf |
pankso@607 | 116 echo '' >> $root/etc/daemons.conf |
pankso@607 | 117 fi |
pankso@1 | 118 } |