wok annotate plop/receipt @ rev 25705

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