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

slitaz-base-files: fix genpkg_rules
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri May 18 09:43:02 2012 +0200 (2012-05-18)
parents 1bcaaa36e32a
children 225ed201c21e
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-base-files"
4 VERSION="5.2.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 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 DEPENDS="gettext-base"
32 # Rules to configure and make the package.
33 compile_rules()
34 {
35 cd $src
36 make DESTDIR=$DESTDIR install
37 }
39 # Rules to gen a SliTaz package suitable for Tazpkg.
40 genpkg_rules()
41 {
42 mkdir -p \
43 $fs/bin \
44 $fs/dev \
45 $fs/home \
46 $fs/media/cdrom \
47 $fs/media/flash \
48 $fs/media/usbdisk \
49 $fs/mnt \
50 $fs/proc \
51 $fs/root \
52 $fs/sbin \
53 $fs/sys \
54 $fs/tmp \
55 $fs/usr/bin \
56 $fs/usr/games \
57 $fs/usr/lib \
58 $fs/usr/local \
59 $fs/usr/sbin \
60 $fs/usr/share/doc \
61 $fs/var/cache \
62 $fs/var/games \
63 $fs/var/lib \
64 $fs/var/lock \
65 $fs/var/log/slitaz \
66 $fs/var/run \
67 $fs/var/spool \
68 $fs/var/tmp
70 # Copy all installed files and set permissions.
71 cp -a $install/* $fs
73 chown -R root.root $fs/*
74 chmod 1777 $fs/tmp
75 chmod 640 $fs/etc/shadow
76 chmod 640 $fs/etc/gshadow
77 chmod 0750 $fs/root
79 # Populate /dev with $fs/sbin/mktazdevs.sh.
80 $fs/sbin/mktazdevs.sh $fs/dev
82 # Creat /etc/mtab symlink.
83 cd $fs/etc
84 ln -s /proc/mounts mtab
86 # Fix httphelper link
87 cd $fs/usr/lib/slitaz
88 ln -s httphelper.sh httphelper
89 }
91 # Pre and post install to backup all /etc/settings
92 #
93 pre_install()
94 {
95 local root
96 root=$1
97 echo "Creating backup of all files in /etc..."
98 cp -a $root/etc $root/tmp/etc.bak 2>/dev/null
99 }
101 post_install()
102 {
103 local root
104 root=$1
105 echo "Restoring files from /etc/etc.bak..."
106 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null
107 rm -rf $root/tmp/etc.bak
109 # Reset permission.
110 chmod 640 $root/etc/shadow
111 chmod 640 $root/etc/gshadow
113 if ! grep -q audio $root/etc/group; then
114 chroot $root/ /bin/addgroup -g 20 audio
115 fi
116 }
118 pre_remove()
119 {
120 # We can not remove this package !
121 exit 1
122 }