SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "efivar"

# SliTaz package receipt.

PACKAGE="efivar"
VERSION="37"
CATEGORY="system-tools"
SHORT_DESC="Manage UEFI variables."
MAINTAINER="developer@slitaz.org"
LICENSE="LGPLv2.1"
WEB_SITE="https://github.com/rhboot/efivar"

TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="$WEB_SITE/archive/$VERSION/$TARBALL"

BUILD_DEPENDS="icu-dev"

current_version()
{
    wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
    sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;q'
}

# Rules to configure and make the package.
compile_rules()
{
    export CFLAGS="$CFLAGS -I/usr/include/unicode"

    # replace char16_t by wchar_t:
    sed -i 's|char16_t|wchar_t|g'    src/export.c

    make libdir=/usr/lib &&
    make libdir=/usr/lib DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/lib

    cp -a $install/usr/bin        $fs/usr
    cp -a $install/usr/lib/*.so*    $fs/usr/lib
}

pre_install()
{
    # Ensure we remove previous post_install step
    if [ -f $1/etc/init.d/local.sh ]; then
        sed -i -e '/inserted/,/END-efivar/!b' -e '/#END-efivar/!d;' \
        -e 'd' $1/etc/init.d/local.sh
    fi
}

post_install()
{
    # if SliTaz was booted by EFI, mount evivarfs now
    if [ -d /sys/firmware/efi/efivars ]; then
        grep "^nodev.efivarfs$" /proc/filesystems || modprobe efivarfs     
         mount -t efivarfs none /sys/firmware/efi/efivars
    fi
    # and after reboot:
    # insert mount into /etc/init.d/local.sh
    if [ -f /etc/init.d/local.sh ]; then
    grep -qs efivarfs $1/etc/init.d/local.sh ||
    echo -e "#inserted by post_install of evifar up to END-efivar:
if [ -d /sys/firmware/efi/efivars ]; then
 grep \"^nodev.efivarfs$\" /proc/filesystems || modprobe efivarfs
 mount -t efivarfs none /sys/firmware/efi/efivars
fi
#END-efivar" >>$1/etc/init.d/local.sh
fi
}
6025 packages and 203662 files in current database (Sun Jun 2 13:53:43 2024)