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

Up tazinst (107)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 18 15:48:56 2020 +0000 (2020-09-18)
parents a8546de77bcc
children a17c0b257e47
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 for i in passwd shadow group gshadow ; do
112 [ -s /etc/$i ] && cp /etc/$i /etc/$i.orig
113 done
114 [ -x "$1/usr/bin/sudo" ] && mv "$1/usr/bin/sudo" "$1/usr/bin/sudo.orig"
115 # Remove old /var/run symlink
116 [ -h "$1/var/run" ] && rm -f "$1/var/run"
117 :
118 }
120 post_install()
121 {
122 for i in passwd shadow group gshadow ; do
123 [ -s $1/etc/$i.orig ] || continue
124 while read line; do
125 grep -q "^${line%%:*}:" $1/etc/$i.orig || echo "$line" >> $1/etc/$i.orig
126 done < $1/etc/$i
127 mv -f $1/etc/$i.orig $1/etc/$i
128 done
130 [ -x "$1/usr/bin/sudo.orig" ] && mv -f "$1/usr/bin/sudo.orig" "$1/usr/bin/sudo"
132 # Reset permission.
133 chmod 640 "$1/etc/shadow"
134 chmod 640 "$1/etc/gshadow"
136 if ! grep -q audio "$1/etc/group"; then
137 chroot "$1/" /bin/addgroup -g 20 audio
138 fi
139 sed -i "s|content: \"20..\"|content: \"$(date +%Y)\"|" \
140 $1/usr/share/doc/slitaz-doc.css
141 }
143 pre_remove()
144 {
145 # We can not remove this package!
146 exit 1
147 }