96 lines
3.1 KiB
Bash
96 lines
3.1 KiB
Bash
#!/usr/bin/bash
|
|
# JOBoRun : Jwm OpenBox Obarun RUNit
|
|
# Maintainer : Joe Bo Run <joborun@disroot.org>
|
|
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
|
|
# Website : https://pozol.eu
|
|
#-----------------------------------------| DESCRIPTION |---------------------------------------
|
|
|
|
pkgname=kmod
|
|
pkgver=32
|
|
pkgrel=01
|
|
pkgdesc="Linux kernel module management tools and library"
|
|
url='https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git'
|
|
depends=('glibc' 'zlib' 'openssl' 'xz')
|
|
checkdepends=('linux-lts-headers' 'libelf')
|
|
#options=('strip' 'debug')
|
|
options=(strip)
|
|
provides=('module-init-tools=3.16' 'libkmod.so') conflicts=('module-init-tools')
|
|
replaces=('module-init-tools')
|
|
source=("https://www.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar."{xz,sign}
|
|
# '0001-master.patch'
|
|
'depmod-search.conf'
|
|
'depmod.hook'
|
|
'depmod.script')
|
|
|
|
prepare() {
|
|
cd "$pkgname-$pkgver"
|
|
|
|
# patch -Np1 < ../0001-master.patch
|
|
}
|
|
|
|
build() {
|
|
cd "$pkgname-$pkgver"
|
|
|
|
./configure \
|
|
--sysconfdir=/etc \
|
|
--with-xz \
|
|
--with-zlib \
|
|
--with-openssl
|
|
|
|
make
|
|
}
|
|
|
|
check() {
|
|
# As of kmod v20, the test suite needs to build some kernel modules, and thus
|
|
# needs headers available in order to run. We depend on linux-headers, but
|
|
# this is really only to try and make sure that *some* useable tree of kernel
|
|
# headers exist. The first useable tree we find is good enough, as these
|
|
# modules will never be loaded by tests.
|
|
|
|
local kdirs=(/usr/lib/modules/*/build/Makefile)
|
|
if [[ ! -f ${kdirs[0]} ]]; then
|
|
printf '==> Unable to find kernel headers to build modules for tests\n' >&2
|
|
return 1
|
|
fi
|
|
|
|
local kver kdir=${kdirs[0]%/Makefile}
|
|
IFS=/ read _ _ _ kver _ <<<"$kdir"
|
|
|
|
make -C "$pkgname-$pkgver" check KDIR="$kdir" KVER="$kver"
|
|
}
|
|
|
|
package() {
|
|
make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
|
|
|
|
# extra directories
|
|
install -dm755 "$pkgdir"/{etc,usr/lib}/{depmod,modprobe}.d
|
|
|
|
# for tool in {ins,ls,rm,dep}mod mod{probe,info}; do
|
|
# ln -s kmod "$pkgdir/usr/bin/$tool"
|
|
# done
|
|
|
|
# install depmod.d file for search/ dir
|
|
install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/usr/lib/depmod.d/search.conf"
|
|
|
|
# hook
|
|
install -Dm644 "$srcdir/depmod.hook" "$pkgdir/usr/share/libalpm/hooks/60-depmod.hook"
|
|
install -Dm755 "$srcdir/depmod.script" "$pkgdir/usr/share/libalpm/scripts/depmod"
|
|
}
|
|
|
|
#---- arch license gpg-key & sha256sums ----
|
|
|
|
arch=(x86_64)
|
|
|
|
license=('GPL2')
|
|
|
|
validpgpkeys=('EAB33C9690013C733916AC839BA2A5A630CBEA53') # Lucas DeMarchi
|
|
|
|
sha256sums=(630ed0d92275a88cb9a7bf68f5700e911fdadaf02e051cf2e4680ff8480bd492 # kmod-32.tar.xz
|
|
6d724cf54e7101651e6963e59cafcee79cae8bbc24946138debb222d5a399fd6 # kmod-32.tar.sign
|
|
# 99a02347c809307675a9a643ec34704ec5289b754d53dd4d319b32849b299c60 # 0001-master.patch
|
|
1a92bfeae870f61ce814577e69d2a147a9c0caf6aed1131243e4179241fcc4a8 # depmod-search.conf
|
|
c11c2a0f66ea405493e8617689ca10818dc81dd1dddc19bdb220c8b2917119c1 # depmod.hook
|
|
d2cd04a09feba30e1376144a8110ec7521892acb0940c3c4ba459aeecf0452ed) # depmod.script
|
|
|
|
## d51e12a0243d442e8878911bc7b120471eb3b034be0e8032b43a1bebea76d7d6 kmod-32-01-x86_64.pkg.tar.lz
|
|
|