wok-next annotate slitaz-base-files/receipt @ rev 20337

orpheus: tiny patch
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Nov 16 21:37:29 2017 +0100 (2017-11-16)
parents ec4ebc01cb25
children 0e7893ac206d
rev   line source
al@19863 1 # SliTaz package receipt v2.
pankso@1 2
pankso@1 3 PACKAGE="slitaz-base-files"
al@19881 4 VERSION="333"
pankso@1 5 CATEGORY="base-system"
al@19863 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"
pankso@1 9 WEB_SITE="http://www.slitaz.org/"
pankso@12856 10 HOST_ARCH="i486 arm"
pankso@12856 11
al@19588 12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
al@19588 13 WGET_URL="http://hg.slitaz.org/$PACKAGE/archive/$VERSION.tar.bz2"
al@19588 14
al@19653 15 BUILD_DEPENDS="gettext"
pankso@12856 16
pankso@12664 17 # Rules to configure and make the package.
pankso@12664 18 compile_rules()
pankso@12664 19 {
al@19863 20 make DESTDIR=$install install
al@19863 21
al@19863 22 for i in /bin /dev /home /media/cdrom /media/flash /media/usbdisk /mnt \
al@19863 23 /proc /root /run /sbin /sys /tmp /usr/bin /usr/games /usr/lib /usr/sbin \
al@19863 24 /usr/share/doc /var/cache /var/games /var/lib /var/lock /var/log/slitaz \
al@19863 25 /var/spool /var/tmp /var/run
al@19863 26 do
al@19863 27 mkdir -p $install$i
al@19863 28 done
al@19863 29
al@19863 30 # Create /etc/mtab symlink
al@19863 31 ln -s /proc/mounts $install/etc/mtab
al@19863 32
al@19863 33 # Add httphelper link
al@19863 34 ln -s httphelper.sh $install/usr/lib/slitaz/httphelper
al@19863 35
al@19863 36 # Populate /dev with $fs/sbin/mktazdevs.sh.
al@19863 37 # Not required with udev.
al@19863 38 # $fs/sbin/mktazdevs.sh $fs/dev
al@19863 39
al@19863 40 # Update copyright year
al@19864 41 grep -rl 'copy; 2' $install/var/www | xargs \
al@19863 42 sed -i "s/copy; [0-9]*/copy; $(date +%Y)/"
al@19863 43
al@19863 44 # Set release
al@19865 45 echo 'next' > $install/etc/slitaz-release
al@20317 46 # Set mirror1 as default mirror
al@20317 47 sed -i 's|mirror\.slitaz\.org|mirror1.slitaz.org|' $install/etc/slitaz/slitaz.conf
al@19863 48
al@19863 49 chown -R root:root $install
al@19863 50 chmod 1777 $install/tmp
al@19863 51 chmod 640 $install/etc/shadow
al@19863 52 chmod 640 $install/etc/gshadow
al@19863 53 chmod 0750 $install/root
pankso@12664 54 }
pankso@12664 55
pankso@1 56 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@1 57 genpkg_rules()
pankso@1 58 {
pankso@12664 59 cp -a $install/* $fs
al@19863 60 DEPENDS="gettext-base"
al@19881 61 CONFIG_FILES="/etc/adduser.conf /etc/daemons.conf /etc/fstab /etc/group \
al@19881 62 /etc/gshadow /etc/host.conf /etc/hostname /etc/hosts /etc/issue /etc/motd \
al@19881 63 /etc/networks /etc/nsswitch.conf /etc/passwd /etc/profile /etc/securetty \
al@19881 64 /etc/services /etc/shadow /etc/shells /etc/slitaz-release \
al@19881 65 /etc/slitaz/slitaz.conf /etc/sysctl.conf"
pankso@1 66 }
pankso@1 67
al@19863 68 # Pre and post install to backup all /etc settings
pankso@1 69 #
al@19863 70 pre_install() {
al@18472 71 [ -x "$1/usr/bin/sudo" ] && mv "$1/usr/bin/sudo" "$1/usr/bin/sudo.orig"
pankso@16573 72 # Remove old /var/run symlink
al@18479 73 [ -h "$1/var/run" ] && rm -f "$1/var/run"
al@18582 74 :
pankso@1 75 }
pankso@1 76
al@19863 77 post_install() {
al@19863 78 [ -x "$1/usr/bin/sudo.orig" ] &&
al@19863 79 mv -f "$1/usr/bin/sudo.orig" "$1/usr/bin/sudo"
pankso@801 80
pankso@1 81 # Reset permission.
al@18472 82 chmod 640 "$1/etc/shadow"
al@18472 83 chmod 640 "$1/etc/gshadow"
pankso@801 84
al@18472 85 if ! grep -q audio "$1/etc/group"; then
al@18472 86 chroot "$1/" /bin/addgroup -g 20 audio
pankso@1 87 fi
pankso@1 88 }
pascal@8932 89
al@19863 90 # We can not remove this package!
al@19863 91 pre_remove() {
pascal@8932 92 exit 1
pascal@8932 93 }