wok annotate slitaz-base-files/receipt @ rev 25556
created recipes for nted and nted-lang
author | Hans-G?nter Theisgen |
---|---|
date | Sat Apr 22 14:54:15 2023 +0100 (18 months ago) |
parents | b6120eeb6704 |
children |
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 |
pascal@24069 | 41 current_version() |
pascal@24069 | 42 { |
pascal@24069 | 43 wget -O - http://hg.slitaz.org/$PACKAGE/ 2>/dev/null | \ |
pascal@24069 | 44 sed '/^Changeset/!d;s|.*">|http://hg.slitaz.org/'$PACKAGE'/rev/|;s|<.*||' | \ |
pascal@24069 | 45 xargs wget -O - 2>/dev/null | sed '/rev /!d;s|.*rev ||;s| .*||' |
pascal@24069 | 46 } |
pascal@24069 | 47 |
pankso@12664 | 48 # Rules to configure and make the package. |
pankso@12664 | 49 compile_rules() |
pankso@12664 | 50 { |
pankso@12664 | 51 make DESTDIR=$DESTDIR install |
pankso@12664 | 52 } |
pankso@12664 | 53 |
pankso@1 | 54 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@1 | 55 genpkg_rules() |
pankso@1 | 56 { |
pankso@131 | 57 mkdir -p \ |
pankso@132 | 58 $fs/bin \ |
pankso@132 | 59 $fs/dev \ |
pankso@132 | 60 $fs/home \ |
pankso@132 | 61 $fs/media/cdrom \ |
pankso@132 | 62 $fs/media/flash \ |
pankso@132 | 63 $fs/media/usbdisk \ |
pankso@132 | 64 $fs/mnt \ |
pankso@132 | 65 $fs/proc \ |
pankso@132 | 66 $fs/root \ |
pascal@12984 | 67 $fs/run \ |
pankso@132 | 68 $fs/sbin \ |
pankso@132 | 69 $fs/sys \ |
pankso@132 | 70 $fs/tmp \ |
pankso@132 | 71 $fs/usr/bin \ |
pankso@132 | 72 $fs/usr/games \ |
pankso@132 | 73 $fs/usr/lib \ |
pankso@132 | 74 $fs/usr/sbin \ |
pankso@132 | 75 $fs/usr/share/doc \ |
pankso@132 | 76 $fs/var/cache \ |
pankso@132 | 77 $fs/var/games \ |
pankso@132 | 78 $fs/var/lib \ |
pankso@132 | 79 $fs/var/lock \ |
pankso@12664 | 80 $fs/var/log/slitaz \ |
pankso@132 | 81 $fs/var/spool \ |
pankso@16572 | 82 $fs/var/tmp \ |
pankso@16572 | 83 $fs/var/run |
pankso@801 | 84 |
pankso@16572 | 85 # Daemons may store the pid files in /var/run |
al@18479 | 86 # from 5.0 /var/run is mounted as tmpfs |
pankso@16572 | 87 #ln -s /run $fs/var/run |
pascal@15920 | 88 |
pankso@12664 | 89 # Copy all installed files and set permissions. |
pankso@12664 | 90 cp -a $install/* $fs |
pankso@801 | 91 |
pankso@1 | 92 chown -R root.root $fs/* |
pankso@1 | 93 chmod 1777 $fs/tmp |
al@18479 | 94 chmod 640 $fs/etc/shadow |
al@18479 | 95 chmod 640 $fs/etc/gshadow |
pankso@607 | 96 chmod 0750 $fs/root |
pankso@801 | 97 |
slaxemulator@8726 | 98 # Populate /dev with $fs/sbin/mktazdevs.sh. |
slaxemulator@8726 | 99 $fs/sbin/mktazdevs.sh $fs/dev |
pankso@801 | 100 |
al@18009 | 101 # Create /etc/mtab symlink. |
pankso@1 | 102 cd $fs/etc |
pankso@1 | 103 ln -s /proc/mounts mtab |
pankso@12664 | 104 |
pankso@12664 | 105 # Fix httphelper link |
pankso@12664 | 106 cd $fs/usr/lib/slitaz |
pascal@12795 | 107 ln -s httphelper.sh httphelper |
pascal@18006 | 108 |
pascal@18006 | 109 # Update copyright year |
pascal@18007 | 110 grep -rl 'copy; 2' $fs/var/www | xargs \ |
pascal@18006 | 111 sed -i "s/copy; [0-9]*/copy; $(date +%Y)/" |
pankso@1 | 112 } |
pankso@1 | 113 |
pankso@1 | 114 # Pre and post install to backup all /etc/settings |
pankso@1 | 115 # |
pankso@1 | 116 pre_install() |
pankso@1 | 117 { |
pascal@23944 | 118 for i in passwd shadow group gshadow ; do |
pascal@23944 | 119 [ -s /etc/$i ] && cp /etc/$i /etc/$i.orig |
pascal@23944 | 120 done |
al@18472 | 121 [ -x "$1/usr/bin/sudo" ] && mv "$1/usr/bin/sudo" "$1/usr/bin/sudo.orig" |
pankso@16573 | 122 # Remove old /var/run symlink |
al@18479 | 123 [ -h "$1/var/run" ] && rm -f "$1/var/run" |
al@18582 | 124 : |
pankso@1 | 125 } |
pankso@1 | 126 |
pankso@1 | 127 post_install() |
pankso@1 | 128 { |
pascal@23944 | 129 for i in passwd shadow group gshadow ; do |
pascal@23944 | 130 [ -s $1/etc/$i.orig ] || continue |
pascal@23944 | 131 while read line; do |
pascal@23944 | 132 grep -q "^${line%%:*}:" $1/etc/$i.orig || echo "$line" >> $1/etc/$i.orig |
pascal@23944 | 133 done < $1/etc/$i |
pascal@23944 | 134 mv -f $1/etc/$i.orig $1/etc/$i |
pascal@23944 | 135 done |
al@18472 | 136 |
al@18472 | 137 [ -x "$1/usr/bin/sudo.orig" ] && mv -f "$1/usr/bin/sudo.orig" "$1/usr/bin/sudo" |
pankso@801 | 138 |
pankso@1 | 139 # Reset permission. |
al@18472 | 140 chmod 640 "$1/etc/shadow" |
al@18472 | 141 chmod 640 "$1/etc/gshadow" |
pankso@801 | 142 |
al@18472 | 143 if ! grep -q audio "$1/etc/group"; then |
al@18472 | 144 chroot "$1/" /bin/addgroup -g 20 audio |
pankso@1 | 145 fi |
pascal@20101 | 146 sed -i "s|content: \"20..\"|content: \"$(date +%Y)\"|" \ |
pascal@20101 | 147 $1/usr/share/doc/slitaz-doc.css |
pankso@1 | 148 } |
pascal@8932 | 149 |
pascal@8932 | 150 pre_remove() |
pascal@8932 | 151 { |
al@18009 | 152 # We can not remove this package! |
pascal@8932 | 153 exit 1 |
pascal@8932 | 154 } |