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