wok-current annotate kmod/receipt @ rev 19606

kmod: link dynamically with libkmod (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jan 04 11:24:10 2017 +0100 (2017-01-04)
parents 7f633571a56d
children 13daef3b4658
rev   line source
pankso@12484 1 # SliTaz package receipt.
pankso@12484 2
pankso@12484 3 PACKAGE="kmod"
pascal@19603 4 VERSION="23"
pankso@12484 5 CATEGORY="base-system"
pascal@13336 6 SHORT_DESC="Linux kernel modules tools."
pankso@12484 7 MAINTAINER="pankso@slitaz.org"
pascal@15001 8 LICENSE="GPL2"
pankso@12484 9 TARBALL="$PACKAGE-$VERSION.tar.xz"
pascal@17923 10 WEB_SITE="https://www.kernel.org/pub/linux/utils/kernel/kmod/"
pascal@17923 11 WGET_URL="$WEB_SITE$TARBALL"
pascal@13024 12 PROVIDE="modules-init-tools"
pankso@16067 13 HOST_ARCH="i486 arm"
pankso@12484 14
pankso@12531 15 DEPENDS="zlib liblzma"
pascal@17923 16 BUILD_DEPENDS="wget zlib-dev liblzma-dev tar"
pankso@12484 17
pankso@16067 18 # Handle cross compilation. ARM use build host: tar
pankso@16067 19 case "$ARCH" in
pascal@17923 20 arm) BUILD_DEPENDS="wget zlib-dev liblzma-dev" ;;
pankso@16067 21 esac
pankso@16067 22
pankso@12484 23 # Rules to configure and make the package.
pankso@12484 24 compile_rules()
pankso@12484 25 {
pascal@19605 26 # link dynamically with libkmod
pascal@19606 27 sed -i 's|\(.libkmod/libkmod\)-internal\.la|\1.la|' Makefile*
pascal@19605 28
pascal@19603 29 # Add lzma support
pascal@19603 30 sed -i -e 's/stream_decoder/auto_decoder/' \
pascal@19603 31 -e 's/.*c_xz\[.*/&\nstatic const char magic_lz[] = {0x5d, 0};/' \
pascal@19603 32 -e 's/.*c_xz,.*/&\n\t{sizeof(magic_lz), magic_lz, {load_xz, unload_xz}},/' \
pascal@19603 33 libkmod/libkmod-file.c
pankso@12484 34 ./configure \
pankso@12531 35 --bindir=/sbin \
erjo@15800 36 --with-rootlibdir=/lib \
pankso@12484 37 --sysconfdir=/etc \
pankso@12484 38 --with-zlib \
pankso@12531 39 --with-xz \
pankso@13605 40 --disable-manpages \
pankso@12531 41 $CONFIGURE_ARGS &&
pankso@12531 42 make && make pkgconfigdir=/usr/lib/pkgconfig install
pankso@12484 43 }
pankso@12484 44
pankso@12484 45 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@12484 46 genpkg_rules()
pankso@12484 47 {
pascal@19604 48 mkdir -p $fs/lib $fs/bin $fs/usr/lib $install/usr/share/man
pankso@16067 49 cp -a $install/sbin $fs
pankso@12531 50 cp -a $install/lib/*.so* $fs/lib
pankso@16067 51 cp -a $install/usr/lib/*.so* $fs/usr/lib
pankso@16067 52
pankso@12531 53 cd $fs/sbin
pankso@12531 54 # The kmod tools symlinks
pankso@12531 55 for tool in rmmod insmod modinfo modprobe depmod
pankso@12531 56 do
pankso@12531 57 ln -s kmod $tool
pankso@12531 58 done
pascal@12703 59 cd ../bin && ln -s ../sbin/kmod lsmod
pascal@19604 60 cp $src/man/*.? $install/usr/share/man
pankso@12484 61 }