wok view plop/receipt @ rev 25779

Up fdutils (5.6), lite (1.11), again
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 20 09:24:30 2024 +0000 (2 months ago)
parents cb71c3a76f5a
children
line source
1 # SliTaz package receipt.
3 PACKAGE="plop"
4 VERSION="5.0.15"
5 CATEGORY="base-system"
6 SHORT_DESC="USB / IDE-CD / PCMCIA CardBus and others boot utility."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="other"
9 WEB_SITE="https://www.plop.at/en/bootmanagers.html"
10 TARBALL="plpbt-$VERSION.zip"
11 WGET_URL="https://download.plop.at/files/bootmngr/$TARBALL"
13 BUILD_DEPENDS="xz lz4 lzsa salvador shrinkler"
15 # What is the latest version available today?
16 current_version()
17 {
18 wget -O - $WEB_SITE 2>/dev/null | \
19 sed '/td align=center/!d;s|.*center>||;s|</.*||;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 cp $stuff/*.S .
31 nice=$1
32 while [ -n "$2" ]; do
33 sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
34 shift 2
35 done
36 cp plpbt.bin plop
37 cp plpbt.bin plop.bin
38 dd if=/dev/zero bs=1 count=500 seek=3 conv=notrunc of=plop.bin 2> /dev/null
39 for c in lzma lz4x2 lzsa1x2 lzsa2x2 zx0 shr ; do
40 sed "s|uncompress|un${c%x2}|" < $stuff/unpack.S > unpack.S
41 cp $stuff/pack .
42 sed "s/VERSION/$VERSION/;s|lzma1=|&nice=$nice,|" -i pack
43 cp pack pack.bak
44 asm bootloader
45 asm unpack
46 cp unpack.lst unpack.lst.${c%x2}
47 ./pack --build bootloader.bin unpack.bin
48 PACKER=${c%x2} ./pack plop.bin plop.${c%x2}
49 [ $(stat -c %s plop.${c%x2}) -lt $(stat -c %s plop) ] && cp plop.${c%x2} plop
50 if [ "${c#*x}" = "2" ]; then
51 cp pack.bak pack
52 sed -e "s|^#define DOUBLE_PACKED|#define DOUBLE_PACKED 1 // $i|" -i unpack.S
53 asm unpack
54 ./pack --build bootloader.bin unpack.bin
55 PACKER=${c%x2} ./pack plop.bin plop.$c
56 mv unpack.lst unpack.lst.$c
57 fi
58 done
59 true
60 }
62 # Rules to configure and make the package.
63 compile_rules()
64 {
65 while read ofs data name; do
66 echo -en "\x$data" | \
67 dd conv=notrunc of=plpbt.bin bs=1 seek=$((0x$ofs)) 2> /dev/null
68 done <<EOT
69 0288 00 videoMode=text
70 0295 00 stars=off
71 0299 01 font=bios
72 029A 00 zoomanimation=off
73 EOT
74 tune_lzma 76,mf=bt2 LC 0 PB 0
75 }
77 # Rules to gen a SliTaz package suitable for Tazpkg.
78 genpkg_rules()
79 {
80 mkdir -p $fs/boot $install/usr/share
81 cp $src/plop $fs/boot/plop.exe
82 cp -a $src/doc $install/usr/share
83 cp -a $src/*.txt $src/*.TXT $install/usr/share/doc
84 }
86 # Pre and post install commands for Tazpkg.
87 post_install()
88 {
89 [ -s $1/boot/isolinux/isolinux.cfg ] &&
90 ! grep -qs '/plop.exe' $1/boot/isolinux/isolinux.cfg &&
91 sed -i 's|i18n.cfg|&\n\
92 LABEL plop usb pcmcia\
93 MENU LABEL USB/PCMCIA boot\
94 KERNEL /boot/plop.exe|' $1/boot/isolinux/isolinux.cfg
95 true
96 }