SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "file"

# SliTaz package receipt.

PACKAGE="file"
VERSION="5.45"
CATEGORY="system-tools"
SHORT_DESC="Determines file type using 'magic' numbers."
MAINTAINER="erjo@slitaz.org"
LICENSE="BSD"
WEB_SITE="https://github.com/file/file"

TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="ftp://ftp.astron.com/pub/file/$TARBALL"

DEPENDS="gcc83-lib-base libmagic zlib"
BUILD_DEPENDS="gcc83 python python-setuptools zlib-dev"

HOST_ARCH="i486 arm"

# @maintainer: Please, update also: libmagic, libmagic-dev, python-magic.

# Handle cross compilation. python is installed in a ARM cook env.
case "$ARCH" in
    (arm)    BUILD_DEPENDS=""
        ;;
esac

# What is the latest version available today?
current_version()
{
    wget -O - $WEB_SITE/tags 2>/dev/null | \
    sed '/archive.*tar/!d;s|.*/[A-Za-z_-]*\(.*\).tar.*|\1|;s|_|.|g;q'
}

# Rules to configure and make the package.
compile_rules()
{
    sed -i 's/, has_debug_info = 1/, has_debug_info = 0/' \
        src/readelf.c

    ./configure                \
        CC=gcc-83            \
        --datarootdir=/usr/share    \
        $CONFIGURE_ARGS &&
    make &&
    make install &&
    cd python &&
    python setup.py build &&
    python setup.py install --root=$DESTDIR
}

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

    cp -a $install/usr/bin        $fs/usr
    cp -a $install/usr/share/misc    $fs/usr/share
}

# Be sure it as cross compile.
testsuite()
{
    readelf -h $install/usr/bin/file
}
5935 packages and 845883 files in cooking database (Sun Jun 2 00:46:56 2024)