wok-6.x annotate slitaz-base-files/receipt @ rev 23997
linld: add iso support (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jan 08 20:36:59 2021 +0000 (2021-01-08) |
parents | a17c0b257e47 |
children | 7e911016a644 |
rev | line source |
---|---|
pankso@1 | 1 # SliTaz package receipt. |
pankso@1 | 2 |
pankso@1 | 3 PACKAGE="slitaz-base-files" |
pascal@23977 | 4 VERSION="343" |
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" |
pascal@15021 | 8 LICENSE="BSD GPL3" |
gokhlayeh@8012 | 9 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pankso@1 | 10 WEB_SITE="http://www.slitaz.org/" |
pascal@13580 | 11 WGET_URL="http://hg.slitaz.org/$PACKAGE/archive/$VERSION.tar.gz" |
pankso@12856 | 12 HOST_ARCH="i486 arm" |
pankso@12856 | 13 |
pankso@12856 | 14 DEPENDS="gettext-base" |
pankso@12856 | 15 |
al@20095 | 16 CONFIG_FILES="\ |
al@20095 | 17 /etc/adduser.conf \ |
al@20095 | 18 /etc/passwd \ |
al@20095 | 19 /etc/fstab \ |
al@20095 | 20 /etc/issue \ |
al@20095 | 21 /etc/hosts \ |
al@20095 | 22 /etc/host.conf \ |
al@20095 | 23 /etc/hostname \ |
al@20095 | 24 /etc/group \ |
al@20095 | 25 /etc/daemons.conf \ |
al@20095 | 26 /etc/nsswitch.conf \ |
al@20095 | 27 /etc/networks \ |
al@20095 | 28 /etc/profile \ |
al@20095 | 29 /etc/securetty \ |
al@20095 | 30 /etc/services \ |
al@20095 | 31 /etc/shells \ |
al@20095 | 32 /etc/motd \ |
al@20095 | 33 /etc/slitaz-release \ |
al@20095 | 34 /etc/slitaz/slitaz.conf \ |
al@20095 | 35 /etc/sysctl.conf" |
pankso@1 | 36 |
pascal@23902 | 37 SECRET_FILES="\ |
pascal@23902 | 38 /etc/gshadow \ |
pascal@23902 | 39 /etc/shadow" |
pascal@23902 | 40 |
pankso@12664 | 41 # Rules to configure and make the package. |
pankso@12664 | 42 compile_rules() |
pankso@12664 | 43 { |
pankso@12664 | 44 make DESTDIR=$DESTDIR install |
pankso@12664 | 45 } |
pankso@12664 | 46 |
pankso@1 | 47 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@1 | 48 genpkg_rules() |
pankso@1 | 49 { |
pankso@131 | 50 mkdir -p \ |
pankso@132 | 51 $fs/bin \ |
pankso@132 | 52 $fs/dev \ |
pankso@132 | 53 $fs/home \ |
pankso@132 | 54 $fs/media/cdrom \ |
pankso@132 | 55 $fs/media/flash \ |
pankso@132 | 56 $fs/media/usbdisk \ |
pankso@132 | 57 $fs/mnt \ |
pankso@132 | 58 $fs/proc \ |
pankso@132 | 59 $fs/root \ |
pascal@12984 | 60 $fs/run \ |
pankso@132 | 61 $fs/sbin \ |
pankso@132 | 62 $fs/sys \ |
pankso@132 | 63 $fs/tmp \ |
pankso@132 | 64 $fs/usr/bin \ |
pankso@132 | 65 $fs/usr/games \ |
pankso@132 | 66 $fs/usr/lib \ |
pankso@132 | 67 $fs/usr/sbin \ |
pankso@132 | 68 $fs/usr/share/doc \ |
pankso@132 | 69 $fs/var/cache \ |
pankso@132 | 70 $fs/var/games \ |
pankso@132 | 71 $fs/var/lib \ |
pankso@132 | 72 $fs/var/lock \ |
pankso@12664 | 73 $fs/var/log/slitaz \ |
pankso@132 | 74 $fs/var/spool \ |
pankso@16572 | 75 $fs/var/tmp \ |
pankso@16572 | 76 $fs/var/run |
pankso@801 | 77 |
pankso@16572 | 78 # Daemons may store the pid files in /var/run |
al@18479 | 79 # from 5.0 /var/run is mounted as tmpfs |
pankso@16572 | 80 #ln -s /run $fs/var/run |
pascal@15920 | 81 |
pankso@12664 | 82 # Copy all installed files and set permissions. |
pankso@12664 | 83 cp -a $install/* $fs |
pankso@801 | 84 |
pankso@1 | 85 chown -R root.root $fs/* |
pankso@1 | 86 chmod 1777 $fs/tmp |
al@18479 | 87 chmod 640 $fs/etc/shadow |
al@18479 | 88 chmod 640 $fs/etc/gshadow |
pankso@607 | 89 chmod 0750 $fs/root |
pankso@801 | 90 |
slaxemulator@8726 | 91 # Populate /dev with $fs/sbin/mktazdevs.sh. |
slaxemulator@8726 | 92 $fs/sbin/mktazdevs.sh $fs/dev |
pankso@801 | 93 |
al@18009 | 94 # Create /etc/mtab symlink. |
pankso@1 | 95 cd $fs/etc |
pankso@1 | 96 ln -s /proc/mounts mtab |
pankso@12664 | 97 |
pankso@12664 | 98 # Fix httphelper link |
pankso@12664 | 99 cd $fs/usr/lib/slitaz |
pascal@12795 | 100 ln -s httphelper.sh httphelper |
pascal@18006 | 101 |
pascal@18006 | 102 # Update copyright year |
pascal@18007 | 103 grep -rl 'copy; 2' $fs/var/www | xargs \ |
pascal@18006 | 104 sed -i "s/copy; [0-9]*/copy; $(date +%Y)/" |
pankso@1 | 105 } |
pankso@1 | 106 |
pankso@1 | 107 # Pre and post install to backup all /etc/settings |
pankso@1 | 108 # |
pankso@1 | 109 pre_install() |
pankso@1 | 110 { |
pascal@23944 | 111 for i in passwd shadow group gshadow ; do |
pascal@23944 | 112 [ -s /etc/$i ] && cp /etc/$i /etc/$i.orig |
pascal@23944 | 113 done |
al@18472 | 114 [ -x "$1/usr/bin/sudo" ] && mv "$1/usr/bin/sudo" "$1/usr/bin/sudo.orig" |
pankso@16573 | 115 # Remove old /var/run symlink |
al@18479 | 116 [ -h "$1/var/run" ] && rm -f "$1/var/run" |
al@18582 | 117 : |
pankso@1 | 118 } |
pankso@1 | 119 |
pankso@1 | 120 post_install() |
pankso@1 | 121 { |
pascal@23944 | 122 for i in passwd shadow group gshadow ; do |
pascal@23944 | 123 [ -s $1/etc/$i.orig ] || continue |
pascal@23944 | 124 while read line; do |
pascal@23944 | 125 grep -q "^${line%%:*}:" $1/etc/$i.orig || echo "$line" >> $1/etc/$i.orig |
pascal@23944 | 126 done < $1/etc/$i |
pascal@23944 | 127 mv -f $1/etc/$i.orig $1/etc/$i |
pascal@23944 | 128 done |
al@18472 | 129 |
al@18472 | 130 [ -x "$1/usr/bin/sudo.orig" ] && mv -f "$1/usr/bin/sudo.orig" "$1/usr/bin/sudo" |
pankso@801 | 131 |
pankso@1 | 132 # Reset permission. |
al@18472 | 133 chmod 640 "$1/etc/shadow" |
al@18472 | 134 chmod 640 "$1/etc/gshadow" |
pankso@801 | 135 |
al@18472 | 136 if ! grep -q audio "$1/etc/group"; then |
al@18472 | 137 chroot "$1/" /bin/addgroup -g 20 audio |
pankso@1 | 138 fi |
pascal@20101 | 139 sed -i "s|content: \"20..\"|content: \"$(date +%Y)\"|" \ |
pascal@20101 | 140 $1/usr/share/doc/slitaz-doc.css |
pankso@1 | 141 } |
pascal@8932 | 142 |
pascal@8932 | 143 pre_remove() |
pascal@8932 | 144 { |
al@18009 | 145 # We can not remove this package! |
pascal@8932 | 146 exit 1 |
pascal@8932 | 147 } |