SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "kmod"

# SliTaz package receipt.

PACKAGE="kmod"
VERSION="23"
CATEGORY="base-system"
SHORT_DESC="Linux kernel modules tools."
MAINTAINER="pankso@slitaz.org"
LICENSE="GPL2"
TARBALL="$PACKAGE-$VERSION.tar.xz"
WEB_SITE="https://www.kernel.org/pub/linux/utils/kernel/kmod/"
WGET_URL="$WEB_SITE$TARBALL"
PROVIDE="modules-init-tools depmod"
HOST_ARCH="i486 arm"

DEPENDS="zlib liblzma"
BUILD_DEPENDS="wget zlib-dev liblzma-dev tar"

# Handle cross compilation. ARM use build host: tar
case "$ARCH" in
    arm) BUILD_DEPENDS="wget zlib-dev liblzma-dev" ;;
esac

current_version()
{
    wget -O - $WEB_SITE 2>/dev/null | \
    sed '/tar.xz/!d;s|.*>kmod-||;s|.tar.*||' | sort -n -r | sed q
}

# Rules to configure and make the package.
compile_rules()
{
    # link dynamically with libkmod
    sed -i 's|\(.libkmod/libkmod\)-internal\.la|\1.la|' Makefile*

    # Add lzma support
    sed -i -e 's/stream_decoder/auto_decoder/' \
     -e 's/.*c_xz\[.*/&\nstatic const char magic_lz[] = {0x5d, 0};/' \
     -e 's/.*c_xz,.*/&\n\t{sizeof(magic_lz), magic_lz, {load_xz, unload_xz}},/' \
            libkmod/libkmod-file.c
    ./configure \
        --bindir=/sbin \
        --with-rootlibdir=/lib \
        --sysconfdir=/etc \
        --with-zlib \
        --with-xz \
        --disable-manpages \
        $CONFIGURE_ARGS &&
    make && make pkgconfigdir=/usr/lib/pkgconfig install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/lib $fs/bin $fs/usr/lib $install/usr/share/man
    cp -a $install/sbin $fs
    cp -a $install/lib/*.so* $fs/lib
    cp -a $install/usr/lib/*.so* $fs/usr/lib
    
    cd $fs/sbin
    # The kmod tools symlinks
    for tool in rmmod insmod modinfo modprobe depmod
    do
        ln -s kmod $tool
    done
    cd ../bin && ln -s ../sbin/kmod lsmod
    cp $src/man/*.? $install/usr/share/man
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)