wok-current view slitaz-base-files/receipt @ rev 23929

efivar: typo in post_install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Sep 01 10:25:24 2020 +0000 (2020-09-01)
parents eb79f91c84cc
children b57d2cbc7c42
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-base-files"
4 VERSION="339"
5 CATEGORY="base-system"
6 SHORT_DESC="Linux tree and the necessary files for the base system."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="BSD GPL3"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.slitaz.org/"
11 WGET_URL="http://hg.slitaz.org/$PACKAGE/archive/$VERSION.tar.gz"
12 HOST_ARCH="i486 arm"
14 DEPENDS="gettext-base"
16 CONFIG_FILES="\
17 /etc/adduser.conf \
18 /etc/passwd \
19 /etc/fstab \
20 /etc/issue \
21 /etc/hosts \
22 /etc/host.conf \
23 /etc/hostname \
24 /etc/group \
25 /etc/daemons.conf \
26 /etc/nsswitch.conf \
27 /etc/networks \
28 /etc/profile \
29 /etc/securetty \
30 /etc/services \
31 /etc/shells \
32 /etc/motd \
33 /etc/slitaz-release \
34 /etc/slitaz/slitaz.conf \
35 /etc/sysctl.conf"
37 SECRET_FILES="\
38 /etc/gshadow \
39 /etc/shadow"
41 # Rules to configure and make the package.
42 compile_rules()
43 {
44 make DESTDIR=$DESTDIR install
45 }
47 # Rules to gen a SliTaz package suitable for Tazpkg.
48 genpkg_rules()
49 {
50 mkdir -p \
51 $fs/bin \
52 $fs/dev \
53 $fs/home \
54 $fs/media/cdrom \
55 $fs/media/flash \
56 $fs/media/usbdisk \
57 $fs/mnt \
58 $fs/proc \
59 $fs/root \
60 $fs/run \
61 $fs/sbin \
62 $fs/sys \
63 $fs/tmp \
64 $fs/usr/bin \
65 $fs/usr/games \
66 $fs/usr/lib \
67 $fs/usr/sbin \
68 $fs/usr/share/doc \
69 $fs/var/cache \
70 $fs/var/games \
71 $fs/var/lib \
72 $fs/var/lock \
73 $fs/var/log/slitaz \
74 $fs/var/spool \
75 $fs/var/tmp \
76 $fs/var/run
78 # Daemons may store the pid files in /var/run
79 # from 5.0 /var/run is mounted as tmpfs
80 #ln -s /run $fs/var/run
82 # Copy all installed files and set permissions.
83 cp -a $install/* $fs
85 chown -R root.root $fs/*
86 chmod 1777 $fs/tmp
87 chmod 640 $fs/etc/shadow
88 chmod 640 $fs/etc/gshadow
89 chmod 0750 $fs/root
91 # Populate /dev with $fs/sbin/mktazdevs.sh.
92 $fs/sbin/mktazdevs.sh $fs/dev
94 # Create /etc/mtab symlink.
95 cd $fs/etc
96 ln -s /proc/mounts mtab
98 # Fix httphelper link
99 cd $fs/usr/lib/slitaz
100 ln -s httphelper.sh httphelper
102 # Update copyright year
103 grep -rl 'copy; 2' $fs/var/www | xargs \
104 sed -i "s/copy; [0-9]*/copy; $(date +%Y)/"
105 }
107 # Pre and post install to backup all /etc/settings
108 #
109 pre_install()
110 {
111 # cp -a "$1/etc" "$1/tmp/etc.bak" 2>/dev/null
112 [ -x "$1/usr/bin/sudo" ] && mv "$1/usr/bin/sudo" "$1/usr/bin/sudo.orig"
113 # Remove old /var/run symlink
114 [ -h "$1/var/run" ] && rm -f "$1/var/run"
115 :
116 }
118 post_install()
119 {
120 # if cp -a "$1/tmp/etc.bak"/* "$1/etc"; then
121 # rm -r "$1/tmp/etc.bak"
122 # fi 2>/dev/null
124 [ -x "$1/usr/bin/sudo.orig" ] && mv -f "$1/usr/bin/sudo.orig" "$1/usr/bin/sudo"
126 # Reset permission.
127 chmod 640 "$1/etc/shadow"
128 chmod 640 "$1/etc/gshadow"
130 if ! grep -q audio "$1/etc/group"; then
131 chroot "$1/" /bin/addgroup -g 20 audio
132 fi
133 sed -i "s|content: \"20..\"|content: \"$(date +%Y)\"|" \
134 $1/usr/share/doc/slitaz-doc.css
135 }
137 pre_remove()
138 {
139 # We can not remove this package!
140 exit 1
141 }