SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "BootProg"

# SliTaz package receipt.

PACKAGE="BootProg"
VERSION="slitaz"
CATEGORY="base-system"
SHORT_DESC="FAT12/16/32 and exFAT Bootsector for .COMs/.EXEs"
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="MIT"
WEB_SITE="https://wiki.osdev.org/BootProg"

BUILD_DEPENDS="nasm xz advancecomp"

bootprog_data()
{
    sed "1,2d;s|FAT32SZ|$(stat -c %s boot32.bin)|" bootprog.sh
    cat ${1// /.bin }.bin
}

# Rules to configure and make the package.
compile_rules()
{
    mkdir -p $src && cd $src
    bs="boot12 boot16 bootex boot32"
    cp $stuff/boot??.asm .
    cp boot16.asm boot12.asm
    sed -i 's|^FAT12.*|FAT12          equ       0|' boot16.asm
    sed -i 's|^FAT16.*|FAT16          equ       0|' boot12.asm
    for i in $bs ; do
        nasm $i.asm -f bin -o $i.bin -l $i.lst || return 1
    done
    fna=$((0x$(awk '/times Name/{print $2}' bootex.lst)))
    sed "s|499 count=11;;|$fna count=$((510-$fna));;|" $stuff/bootprog.sh > bootprog.sh
    sed '1,2!d' bootprog.sh > bootprog.lzma
    bootprog_data "$bs" | xz -z --format=lzma --lzma1=lc=0,pb=0,nice=60,dict=4k >> bootprog.lzma
    bootprog_data "$bs" | gzip -9 > bootprog.gz
    advdef -z4 -i 1200 bootprog.gz
    sed '1,2!d;s|unlzma|zcat|' bootprog.sh | cat - bootprog.gz > bootprog.gzip
    rm bootprog.gz
    chmod +x bootprog.lzma bootprog.gzip
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/bin
    cp -a $src/bootprog.gzip $fs/usr/bin/bootprog
}
5935 packages and 845883 files in cooking database (Sun Jun 30 00:45:24 2024)