rev |
line source |
pankso@1
|
1 # SliTaz package receipt.
|
pankso@1
|
2
|
pankso@1
|
3 PACKAGE="slitaz-base-files"
|
pankso@129
|
4 VERSION="1.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"
|
pankso@1
|
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
|
pankso@1
|
9 WEB_SITE="http://www.slitaz.org/"
|
pankso@1
|
10 WGET_URL="http://download.tuxfamily.org/slitaz/sources/base-files/$TARBALL"
|
pankso@1
|
11
|
pankso@1
|
12 # Rules to gen a SliTaz package suitable for Tazpkg.
|
pankso@1
|
13 genpkg_rules()
|
pankso@1
|
14 {
|
pankso@131
|
15 mkdir -p \
|
pankso@131
|
16 $fs/bin
|
pankso@131
|
17 $fs/dev
|
pankso@131
|
18 $fs/home
|
pankso@131
|
19 $fs/media/cdrom
|
pankso@131
|
20 $fs/media/flash
|
pankso@131
|
21 $fs/media/usbdisk
|
pankso@131
|
22 $fs/mnt
|
pankso@131
|
23 $fs/proc
|
pankso@131
|
24 $fs/root
|
pankso@131
|
25 $fs/sbin
|
pankso@131
|
26 $fs/sys
|
pankso@131
|
27 $fs/tmp
|
pankso@131
|
28 $fs/usr/bin
|
pankso@131
|
29 $fs/usr/games
|
pankso@131
|
30 $fs/usr/lib
|
pankso@131
|
31 $fs/usr/local
|
pankso@131
|
32 $fs/usr/sbin
|
pankso@131
|
33 $fs/usr/share/doc
|
pankso@131
|
34 $fs/var/cache
|
pankso@131
|
35 $fs/var/games
|
pankso@131
|
36 $fs/var/lib
|
pankso@131
|
37 $fs/var/lock
|
pankso@131
|
38 $fs/var/log
|
pankso@131
|
39 $fs/var/run
|
pankso@131
|
40 $fs/var/spool
|
pankso@131
|
41 $fs/var/tmp
|
pankso@131
|
42
|
pankso@131
|
43
|
pankso@1
|
44 # Copy all rootfs from the stuff and set permissions.
|
pankso@1
|
45 cp -a $src/rootfs/* $fs
|
pankso@1
|
46
|
pankso@1
|
47 chown -R root.root $fs/*
|
pankso@1
|
48 chmod 1777 $fs/tmp
|
pankso@1
|
49 chmod 640 $fs/etc/shadow
|
pankso@1
|
50 chmod 640 $fs/etc/gshadow
|
pankso@1
|
51
|
pankso@1
|
52 # Populate /dev with /$fs/sbin/mktazdevs.sh.
|
pankso@1
|
53 ./$fs/sbin/mktazdevs.sh $fs/dev
|
pankso@1
|
54
|
pankso@1
|
55 # Creat /etc/mtab symlink.
|
pankso@1
|
56 cd $fs/etc
|
pankso@1
|
57 ln -s /proc/mounts mtab
|
pankso@1
|
58 }
|
pankso@1
|
59
|
pankso@1
|
60 # Pre and post install to backup all /etc/settings
|
pankso@1
|
61 #
|
pankso@1
|
62 pre_install()
|
pankso@1
|
63 {
|
pankso@1
|
64 local root
|
pankso@1
|
65 root=$1
|
pankso@52
|
66 echo "Creating backup of all files in /etc..."
|
pankso@52
|
67 cp -a $root/etc $root/tmp/etc.bak 2>/dev/null
|
pankso@1
|
68 }
|
pankso@1
|
69
|
pankso@1
|
70 post_install()
|
pankso@1
|
71 {
|
pankso@1
|
72 local root
|
pankso@1
|
73 root=$1
|
pankso@52
|
74 echo "Restoring files from /etc/etc.bak..."
|
pankso@52
|
75 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null
|
pankso@1
|
76 rm -rf $root/tmp/etc.bak
|
pankso@1
|
77
|
pankso@1
|
78 # Remove old base-file pkg info
|
pankso@1
|
79 rm -rf $root/var/lib/tazpkg/installed/base-files
|
pankso@1
|
80
|
pankso@1
|
81 # Reset permission.
|
pankso@1
|
82 chmod 640 $root/etc/shadow
|
pankso@1
|
83 chmod 640 $root/etc/gshadow
|
pankso@1
|
84
|
pankso@1
|
85 if ! grep -q audio $root/etc/group; then
|
pankso@1
|
86 if [ -n "$root" ]; then
|
pankso@1
|
87 cp /etc/group $root/etc/group
|
pankso@1
|
88 else
|
pankso@1
|
89 addgroup -g 20 audio
|
pankso@1
|
90 fi
|
pankso@1
|
91 fi
|
pankso@1
|
92
|
pankso@131
|
93 # Add crond to daemons confi file (compatibility)
|
pankso@1
|
94 if ! grep -q CROND_OPTIONS $root/etc/daemons.conf; then
|
pankso@1
|
95 echo '# Cron daemon options.' >> $root/etc/daemons.conf
|
pankso@1
|
96 echo 'CROND_OPTIONS="-b"' >> $root/etc/daemons.conf
|
pankso@1
|
97 echo '' >> $root/etc/daemons.conf
|
pankso@1
|
98 fi
|
pankso@1
|
99 }
|
pankso@1
|
100 SELF_INSTALL=1
|