wok view memtest/receipt @ rev 25084

updated p4wn (1.0 -> 2.01)
author Hans-G?nter Theisgen
date Wed Jun 15 17:34:03 2022 +0100 (2022-06-15)
parents e171b422f9e7
children 81fc994927a6
line source
1 # SliTaz package receipt.
3 PACKAGE="memtest"
4 VERSION="5.01"
5 CATEGORY="base-system"
6 SHORT_DESC="Memory failures detection tool."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 SOURCE="memtest86+"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WEB_SITE="https://www.memtest.org/"
12 WGET_URL="${WEB_SITE}download/archives/$VERSION/$TARBALL"
14 BUILD_DEPENDS="xz"
16 current_version()
17 {
18 wget -O - $WEB_SITE 2>/dev/null | \
19 sed '/tar.gz"/!d;s|.*memtest86.-||;s|.tar.*||;q'
20 }
22 tune_lzma()
23 {
24 cp $stuff/*.S $stuff/pack .
25 sed "s/VERSION/$VERSION/;s|lzma1=|&nice=$1,|" -i pack
26 while [ -n "$2" ]; do
27 sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
28 shift 2
29 done
30 for i in bootloader unpack ; do
31 cc -o $i.o -Wa,-a=$i.lst -c $i.S
32 objcopy --only-section=.text -O binary $i.o $i.bin
33 done
34 ./pack --build bootloader.bin unpack.bin
35 }
37 # Rules to configure and make the package.
38 compile_rules()
39 {
40 # binutils 2.37 support
41 sed -i 's|\t}|&\n\t/DISCARD/ : { *(*) }|' memtest.bin.lds
43 ls $stuff/memtest*-$VERSION-*.patch &&
44 for i in $stuff/memtest*-$VERSION-*.patch ; do
45 patch -p1 < $i
46 done
47 make
48 tune_lzma 218,mf=bt2 LC 2
49 ./pack memtest.bin memtest.packed
50 mv memtest.bin memtest.bin.console
51 sed -i -e 's/SERIAL_CONSOLE_DEFAULT 0/SERIAL_CONSOLE_DEFAULT 1/' \
52 -e 's/SERIAL_BAUD_RATE 9600/SERIAL_BAUD_RATE 115200/' config.h
53 make clean
54 make
55 tune_lzma 179,mf=bt3 LC 2
56 ./pack memtest.bin memtest.packed-115200
57 mv memtest.bin memtest.bin.serial
58 }
61 # Rules to gen a SliTaz package suitable for Tazpkg.
62 genpkg_rules()
63 {
64 mkdir -p $fs/boot $install/usr/share/doc
65 cp $src/README* $install/usr/share/doc
66 cp $src/FAQ $install/usr/share/doc
67 cp $src/memtest.packed $fs/boot/memtest.exe
68 }
70 # Pre and post install commands for Tazpkg.
71 post_install()
72 {
73 [ -s $1/boot/isolinux/isolinux.cfg ] &&
74 ! grep -qs 'Check memory' $1/boot/isolinux/isolinux.cfg && sed -i \
75 's|LABEL md5|LABEL memtest mem ram\
76 MENU LABEL Check memory\
77 KERNEL /boot/memtest.exe\
78 \n&|' $1/boot/isolinux/isolinux.cfg
79 true
80 }