wok view memtest64/receipt @ rev 25539

Up perl-test-compile (3.1.0)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 09 12:11:13 2023 +0000 (14 months ago)
parents 000946205748
children 3c71bb4367c3
line source
1 # SliTaz package receipt.
3 PACKAGE="memtest64"
4 VERSION="6.10"
5 CATEGORY="base-system"
6 SHORT_DESC="Memory failures detection tool."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.zip"
10 WEB_SITE="https://www.memtest.org/" # https://github.com/memtest86plus/memtest86plus/
11 WGET_URL="https://memtest.org/download/v$VERSION/mt86plus_${VERSION}.binaries.zip"
13 BUILD_DEPENDS="xz lz4 lzsa"
15 # What is the latest version available today?
16 current_version()
17 {
18 wget -O - $WEB_SITE 2>/dev/null | \
19 sed '/binaries.zip/!d;s|.*mt86plus_||;s|.binaries.zip.*||;q'
20 }
22 asm()
23 {
24 cc -o $1.o -Wa,-a=$1.lst -c $1.S
25 objcopy --only-section=.text -O binary $1.o $1.bin
26 }
28 tune_lzma()
29 {
30 file=$1
31 shift
32 for i in lzma lz4x2 lzsa1x2 lzsa2x2 ; do
33 cp $stuff/*.S $stuff/pack .
34 sed "s/VERSION/$VERSION/;s|lzma1=|&nice=${1:-64},|" -i pack
35 while [ -n "$2" ]; do
36 sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
37 shift 2
38 done
39 sed -i "s|uncompress|un${i%x2}|" unpack.S
40 asm bootloader
41 asm unpack
42 cp pack pack.bak
43 ./pack --build bootloader.bin unpack.bin
44 PACKER=${i%x2} ./pack $file $file.${i%x2}
45 if [ $(stat -c %s $file.${i%x2}) -ge $((0x101F0)) ]; then
46 rm $file.${i%x2}
47 cp pack.bak pack
48 sed -e "s|^#define FLAT16.*// lzma case|#define FLAT16 0 // ${i%x2}|" -i unpack.S
49 asm unpack
50 ./pack --build bootloader.bin unpack.bin
51 PACKER=${i%x2} ./pack $file $file.${i%x2}
52 fi
53 mv unpack.lst unpack.lst.${i%x2}
54 if [ "${i#*x}" = "2" ]; then
55 cp pack.bak pack
56 sed -e "s|^#define DOUBLE_PACKED|#define DOUBLE_PACKED 1 // $i|" -i unpack.S
57 asm unpack
58 ./pack --build bootloader.bin unpack.bin
59 PACKER=${i%x2} ./pack $file $file.$i
60 mv unpack.lst unpack.lst.$i
61 fi
62 done
63 }
65 # Rules to configure and make the package.
66 compile_rules()
67 {
68 tune_lzma memtest64.bin 55,mf=bt2 LC 3 PB 2
69 }
71 # Rules to gen a SliTaz package suitable for Tazpkg.
72 genpkg_rules()
73 {
74 mkdir -p $fs/boot
75 cp $src/memtest64.bin.lzma $fs/boot/memtest64.exe
76 }
78 # Pre and post install commands for Tazpkg.
79 post_install()
80 {
81 [ -s $1/boot/isolinux/isolinux.cfg ] &&
82 ! grep -qs 'Check 64 bits memory' $1/boot/isolinux/isolinux.cfg && sed -i \
83 's|LABEL md5|LABEL memtest64 mem64 ram64\
84 MENU LABEL Check 64 bits memory\
85 KERNEL /boot/memtest64.exe\
86 \n&|' $1/boot/isolinux/isolinux.cfg
87 true
88 }