wok view slitaz-base-files/receipt @ rev 10908

mpd: add init script (thanks Mali)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jul 26 11:44:53 2011 +0200 (2011-07-26)
parents 2c795c9fface
children 82838cf0155a
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-base-files"
4 VERSION="4.4"
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 echo "Restoring files from /etc/etc.bak..."
93 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null
94 rm -rf $root/tmp/etc.bak
96 # Reset permission.
97 chmod 640 $root/etc/shadow
98 chmod 640 $root/etc/gshadow
100 if ! grep -q audio $root/etc/group; then
101 chroot $root/ /bin/addgroup -g 20 audio
102 fi
103 }
105 pre_remove()
106 {
107 # We can not remove this package !
108 exit 1
109 }