SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "lzma"

# SliTaz package receipt.

PACKAGE="lzma"
VERSION="4.57"
CATEGORY="base-system"
SHORT_DESC="Compressor with a high compression ratio."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="LGPL2.1"
TARBALL="lzma$(echo $VERSION | sed 's/\.//').tar.bz2"
WEB_SITE="https://sourceforge.net/projects/sevenzip/"
WGET_URL="$SF_MIRROR/sevenzip/$TARBALL"
TAGS="compression archive"
HOST_ARCH="i486 arm"

DEPENDS="lzlib zlib gcc-lib-base"

# What is the latest version available today?
current_version()
{
    wget -O - https://sourceforge.net/projects/sevenzip/files/LZMA%20SDK/ 2>/dev/null | \
    sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
    sed "/$PACKAGE/!d;/tar/!d;s|.*$PACKAGE\\(.\\)\\(.*\\).tar.*\".*|\\1.\\2|;q"
}

# Rules to configure and make the package.
compile_rules()
{
    if [ ! -f done.lzlib.u ]; then
        patch -p0 < $stuff/lzlib.u || return 1
        touch done.lzlib.u
    fi
    cd CPP/7zip/Compress/LZMA_Alone
    
    # Handle cross compilation
    case "$ARCH" in
        arm)
            sed -i s'/g++/arm-slitaz-linux-gnueabi-c++/' makefile.gcc
            sed -i s'/gcc/arm-slitaz-linux-gnueabi-gcc/' makefile.gcc ;;
    esac

    # Remove copyright message.
    sed '/MY_VERSION_COPYRIGHT_DATE/d' -i LzmaAlone.cpp

    make -f makefile.gcc lzma 2> /dev/null
    make -f makefile.gcc liblz.so.1.0.0 &&
    make -f makefile.gcc lzma
}


# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/bin
    cp -a $src/CPP/7zip/Compress/LZMA_Alone/lzma-shared $fs/usr/bin/lzma-alone
    cp $stuff/lzma $fs/usr/bin
    chmod 755 $fs/usr/bin/lzma
    ln -s lzma $fs/usr/bin/unlzma
    ln -s lzma $fs/usr/bin/lzcat
}

post_remove()
{
    ln -s /bin/busybox "$1/usr/bin/unlzma"
    ln -s /bin/busybox "$1/usr/bin/lzcat"
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)