wok-6.x view slitaz-base-files/receipt @ rev 1404

Add perl-crypt-smbhash
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Sep 23 14:14:01 2008 +0000 (2008-09-23)
parents 2120530d4ada
children 3b3cedd6c979
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"
11 CONFIG_FILES="
12 /etc/adduser.conf
13 /etc/passwd
14 /etc/fstab
15 /etc/issue
16 /etc/hosts
17 /etc/host.conf
18 /etc/hostname
19 /etc/group
20 /etc/gshadow
21 /etc/shadow
22 /etc/daemons.conf
23 /etc/nsswitch.conf
24 /etc/networks
25 /etc/profile
26 /etc/securetty
27 /etc/services
28 /etc/shells"
30 # Rules to gen a SliTaz package suitable for Tazpkg.
31 genpkg_rules()
32 {
33 mkdir -p \
34 $fs/bin \
35 $fs/dev \
36 $fs/home \
37 $fs/media/cdrom \
38 $fs/media/flash \
39 $fs/media/usbdisk \
40 $fs/mnt \
41 $fs/proc \
42 $fs/root \
43 $fs/sbin \
44 $fs/sys \
45 $fs/tmp \
46 $fs/usr/bin \
47 $fs/usr/games \
48 $fs/usr/lib \
49 $fs/usr/local \
50 $fs/usr/sbin \
51 $fs/usr/share/doc \
52 $fs/var/cache \
53 $fs/var/games \
54 $fs/var/lib \
55 $fs/var/lock \
56 $fs/var/log \
57 $fs/var/run \
58 $fs/var/spool \
59 $fs/var/tmp
61 # Copy all rootfs from the stuff and set permissions.
62 cp -a $src/rootfs/* $fs
64 chown -R root.root $fs/*
65 chmod 1777 $fs/tmp
66 chmod 640 $fs/etc/shadow
67 chmod 640 $fs/etc/gshadow
68 chmod 0750 $fs/root
70 # Populate /dev with /$fs/sbin/mktazdevs.sh.
71 ./$fs/sbin/mktazdevs.sh $fs/dev
73 # Creat /etc/mtab symlink.
74 cd $fs/etc
75 ln -s /proc/mounts mtab
76 }
78 # Pre and post install to backup all /etc/settings
79 #
80 pre_install()
81 {
82 local root
83 root=$1
84 echo "Creating backup of all files in /etc..."
85 cp -a $root/etc $root/tmp/etc.bak 2>/dev/null
86 }
88 post_install()
89 {
90 local root
91 root=$1
92 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
93 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
94 etc/adduser.conf
95 etc/passwd
96 etc/fstab
97 etc/issue
98 etc/hosts
99 etc/host.conf
100 etc/hostname
101 etc/group
102 etc/gshadow
103 etc/shadow
104 etc/daemons.conf
105 etc/nsswitch.conf
106 etc/networks
107 etc/profile
108 etc/securetty
109 etc/services
110 etc/shells
111 EOT
112 echo "Restoring files from /etc/etc.bak..."
113 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null
114 rm -rf $root/tmp/etc.bak
116 # Reset permission.
117 chmod 640 $root/etc/shadow
118 chmod 640 $root/etc/gshadow
120 if ! grep -q audio $root/etc/group; then
121 if [ -n "$root" ]; then
122 cp /etc/group $root/etc/group
123 else
124 addgroup -g 20 audio
125 fi
126 fi
128 # daemons.conf (tftp + dnsd)
129 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
130 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
131 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
132 echo '' >> $root/etc/daemons.conf
133 fi
134 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
135 echo '# Domain name server options.' >> $root/etc/daemons.conf
136 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
137 echo '' >> $root/etc/daemons.conf
138 fi
139 }
140 SELF_INSTALL=1
142 repack_cleanup()
143 {
144 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
145 }