wok-current annotate plop/receipt @ rev 25504

Update some web_site / wget_url
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 05 09:28:51 2023 +0000 (21 months ago)
parents 66a052ff61b1
children a11b45a08141
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@25504 13 BUILD_DEPENDS="xz lz4 lzsa"
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@25504 37 for c in lzma lz4x2 lzsa1x2 lzsa2x2 ; do
pascal@25504 38 sed "s|uncompress|un${c%x2}|" < $stuff/unpack.S > unpack.S
pascal@25504 39 cp $stuff/pack .
pascal@25504 40 sed "s/VERSION/$VERSION/;s|lzma1=|&nice=$nice,|" -i pack
pascal@25504 41 cp pack pack.bak
pascal@25504 42 asm bootloader
pascal@25504 43 asm unpack
pascal@25504 44 cp unpack.lst unpack.lst.${c%x2}
pascal@25504 45 ./pack --build bootloader.bin unpack.bin
pascal@25504 46 PACKER=${c%x2} ./pack plpbt.bin plop.${c%x2}
pascal@25504 47 [ $(stat -c %s plop.${c%x2}) -lt $(stat -c %s plop) ] && cp plop.${c%x2} plop
pascal@25504 48 if [ "${c#*x}" = "2" ]; then
pascal@25504 49 cp pack.bak pack
pascal@25504 50 sed -e "s|^#define DOUBLE_PACKED|#define DOUBLE_PACKED 1 // $i|" -i unpack.S
pascal@25504 51 asm unpack
pascal@25504 52 ./pack --build bootloader.bin unpack.bin
pascal@25504 53 PACKER=${c%x2} ./pack plpbt.bin plop.$c
pascal@25504 54 mv unpack.lst unpack.lst.$c
pascal@25504 55 fi
pascal@24046 56 done
pascal@25504 57 true
pascal@24046 58 }
pascal@24046 59
pascal@23919 60 # Rules to configure and make the package.
pascal@23919 61 compile_rules()
pascal@23919 62 {
pascal@23919 63 while read ofs data name; do
pascal@23919 64 echo -en "\x$data" | \
pascal@25504 65 dd conv=notrunc of=plpbt.bin bs=1 seek=$((0x$ofs)) 2> /dev/null
pascal@23919 66 done <<EOT
pascal@23919 67 0288 00 videoMode=text
pascal@23919 68 0295 00 stars=off
pascal@23919 69 0299 01 font=bios
pascal@23919 70 029A 00 zoomanimation=off
pascal@23919 71 EOT
pascal@24046 72 tune_lzma 84,mf=bt2 LC 0 PB 0
pascal@23919 73 }
pascal@23919 74
pascal@23919 75 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@23919 76 genpkg_rules()
pascal@23919 77 {
pascal@23919 78 mkdir -p $fs/boot $install/usr/share
pascal@23919 79 cp $src/plop $fs/boot/plop.exe
pascal@23919 80 cp -a $src/doc $install/usr/share
pascal@23919 81 cp -a $src/*.txt $src/*.TXT $install/usr/share/doc
pascal@23919 82 }
pascal@23919 83
pascal@23919 84 # Pre and post install commands for Tazpkg.
pascal@23919 85 post_install()
pascal@23919 86 {
pascal@23919 87 [ -s $1/boot/isolinux/isolinux.cfg ] &&
pascal@23926 88 ! grep -qs '/plop.exe' $1/boot/isolinux/isolinux.cfg &&
pascal@23926 89 sed -i 's|i18n.cfg|&\n\
pascal@23926 90 LABEL plop usb pcmcia\
pascal@23919 91 MENU LABEL USB/PCMCIA boot\
pascal@23926 92 KERNEL /boot/plop.exe|' $1/boot/isolinux/isolinux.cfg
pascal@23919 93 true
pascal@23919 94 }