wok-4.x view slitaz-base-files/receipt @ rev 1172
get-google-earth: use bunzip2 instead of bzip2 -d
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Aug 02 08:15:51 2008 +0000 (2008-08-02) |
parents | 4ae1b641e09a |
children | 534023d6e005 |
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-base-files"
4 VERSION="2.3"
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://mirror.slitaz.org/sources/base-files/$TARBALL"
12 # Rules to gen a SliTaz package suitable for Tazpkg.
13 genpkg_rules()
14 {
15 mkdir -p \
16 $fs/bin \
17 $fs/dev \
18 $fs/home \
19 $fs/media/cdrom \
20 $fs/media/flash \
21 $fs/media/usbdisk \
22 $fs/mnt \
23 $fs/proc \
24 $fs/root \
25 $fs/sbin \
26 $fs/sys \
27 $fs/tmp \
28 $fs/usr/bin \
29 $fs/usr/games \
30 $fs/usr/lib \
31 $fs/usr/local \
32 $fs/usr/sbin \
33 $fs/usr/share/doc \
34 $fs/var/cache \
35 $fs/var/games \
36 $fs/var/lib \
37 $fs/var/lock \
38 $fs/var/log \
39 $fs/var/run \
40 $fs/var/spool \
41 $fs/var/tmp
43 # Copy all rootfs from the stuff and set permissions.
44 cp -a $src/rootfs/* $fs
46 chown -R root.root $fs/*
47 chmod 1777 $fs/tmp
48 chmod 640 $fs/etc/shadow
49 chmod 640 $fs/etc/gshadow
50 chmod 0750 $fs/root
52 # Populate /dev with /$fs/sbin/mktazdevs.sh.
53 ./$fs/sbin/mktazdevs.sh $fs/dev
55 # Creat /etc/mtab symlink.
56 cd $fs/etc
57 ln -s /proc/mounts mtab
58 }
60 # Pre and post install to backup all /etc/settings
61 #
62 pre_install()
63 {
64 local root
65 root=$1
66 echo "Creating backup of all files in /etc..."
67 cp -a $root/etc $root/tmp/etc.bak 2>/dev/null
68 }
70 post_install()
71 {
72 local root
73 root=$1
74 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
75 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
76 etc/adduser.conf
77 etc/passwd
78 etc/fstab
79 etc/issue
80 etc/hosts
81 etc/host.conf
82 etc/hostname
83 etc/group
84 etc/gshadow
85 etc/shadow
86 etc/daemons.conf
87 etc/nsswitch.conf
88 etc/networks
89 etc/profile
90 etc/securetty
91 etc/services
92 etc/shells
93 EOT
94 echo "Restoring files from /etc/etc.bak..."
95 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null
96 rm -rf $root/tmp/etc.bak
98 # Reset permission.
99 chmod 640 $root/etc/shadow
100 chmod 640 $root/etc/gshadow
102 if ! grep -q audio $root/etc/group; then
103 if [ -n "$root" ]; then
104 cp /etc/group $root/etc/group
105 else
106 addgroup -g 20 audio
107 fi
108 fi
110 # daemons.conf (tftp + dnsd)
111 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
112 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
113 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
114 echo '' >> $root/etc/daemons.conf
115 fi
116 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
117 echo '# Domain name server options.' >> $root/etc/daemons.conf
118 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
119 echo '' >> $root/etc/daemons.conf
120 fi
121 }
122 SELF_INSTALL=1
124 repack_cleanup()
125 {
126 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
127 }