wok annotate memtest/receipt @ rev 24046

memtest,plop: tune lzma compression (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri May 07 14:52:36 2021 +0000 (2021-05-07)
parents c4968381aed9
children ee53899c6189
rev   line source
pascal@524 1 # SliTaz package receipt.
pascal@524 2
pascal@524 3 PACKAGE="memtest"
pascal@15468 4 VERSION="5.01"
pascal@524 5 CATEGORY="base-system"
pascal@524 6 SHORT_DESC="Memory failures detection tool."
pascal@524 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@17225 8 LICENSE="GPL2"
pascal@1734 9 SOURCE="memtest86+"
pascal@1734 10 TARBALL="$SOURCE-$VERSION.tar.gz"
pascal@524 11 WEB_SITE="http://www.memtest.org/"
pascal@1734 12 WGET_URL="${WEB_SITE}download/$VERSION/$TARBALL"
pascal@524 13
pascal@14798 14 BUILD_DEPENDS="xz"
pascal@13269 15
pascal@24045 16 tune_lzma()
pascal@24045 17 {
pascal@24045 18 cp $stuff/*.S $stuff/pack .
pascal@24045 19 sed "s/VERSION/$VERSION/;s|lzma1=|&nice=$1,|" -i pack
pascal@24045 20 while [ -n "$2" ]; do
pascal@24045 21 sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
pascal@24045 22 shift 2
pascal@24045 23 done
pascal@24045 24 for i in bootloader unpack ; do
pascal@24045 25 cc -o $i.o -Wa,-a=$i.lst -c $i.S
pascal@24045 26 objcopy -O binary $i.o $i.bin
pascal@24045 27 done
pascal@24045 28 ./pack --build bootloader.bin unpack.bin
pascal@24045 29 }
pascal@24045 30
pascal@524 31 # Rules to configure and make the package.
pascal@524 32 compile_rules()
pascal@524 33 {
pascal@24043 34 ls $stuff/memtest*-$VERSION-*.patch &&
pascal@24043 35 for i in $stuff/memtest*-$VERSION-*.patch ; do
pascal@24043 36 patch -p1 < $i
pascal@17225 37 done
pascal@1734 38 make
pascal@24046 39 tune_lzma 218,mf=bt2 LC 2
pascal@13269 40 ./pack memtest.bin memtest.packed
pascal@17227 41 mv memtest.bin memtest.bin.console
pascal@14796 42 sed -i -e 's/SERIAL_CONSOLE_DEFAULT 0/SERIAL_CONSOLE_DEFAULT 1/' \
pascal@14796 43 -e 's/SERIAL_BAUD_RATE 9600/SERIAL_BAUD_RATE 115200/' config.h
pascal@14796 44 make clean
pascal@14796 45 make
pascal@24046 46 tune_lzma 179,mf=bt2 LC 2
pascal@14796 47 ./pack memtest.bin memtest.packed-115200
pascal@17227 48 mv memtest.bin memtest.bin.serial
pascal@524 49 }
pascal@524 50
pascal@524 51
pascal@524 52 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@524 53 genpkg_rules()
pascal@524 54 {
pascal@20042 55 mkdir -p $fs/boot $install/usr/share/doc
pascal@20042 56 cp $src/README* $install/usr/share/doc
pascal@20042 57 cp $src/FAQ $install/usr/share/doc
pascal@20210 58 cp $src/memtest.packed $fs/boot/memtest.exe
pascal@524 59 }
pascal@20210 60
pascal@20210 61 # Pre and post install commands for Tazpkg.
pascal@20210 62 post_install()
pascal@20210 63 {
pascal@20210 64 [ -s $1/boot/isolinux/isolinux.cfg ] &&
pascal@20210 65 ! grep -qs 'Check memory' $1/boot/isolinux/isolinux.cfg && sed -i \
pascal@20210 66 's|LABEL md5|LABEL memtest mem ram\
pascal@20210 67 MENU LABEL Check memory\
pascal@20210 68 KERNEL /boot/memtest.exe\
pascal@20210 69 \n&|' $1/boot/isolinux/isolinux.cfg
pascal@20219 70 true
pascal@20210 71 }