123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- # Maintainer (Arch): Dave Reisner <dreisner@archlinux.org>
- # Maintainer: André Silva <emulatorman@hyperbola.info>
- # Contributor: Márcio Silva <coadde@hyperbola.info>
- pkgname=kmod
- pkgver=27
- _debver=27+20200310
- _debrel=2
- pkgrel=2
- pkgdesc="Linux kernel module management tools and library"
- arch=('i686' 'x86_64')
- url='https://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary'
- license=('LGPL-2.1' 'GPL-2')
- depends=('zlib' 'libressl' 'xz')
- makedepends=('quilt')
- checkdepends=('linux-libre-lts-headers' 'libelf')
- options=('strip' 'debug')
- provides=('module-init-tools=3.16')
- conflicts=('module-init-tools')
- replaces=('module-init-tools')
- validpgpkeys=('EAB33C9690013C733916AC839BA2A5A630CBEA53') # Lucas DeMarchi
- source=("https://www.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar."{xz,sign}
- "https://deb.debian.org/debian/pool/main/k/kmod/kmod_$_debver-$_debrel.debian.tar.xz"
- 'depmod-search.conf'
- 'depmod.hook' 'depmod.script'
- 'dummy.conf')
- sha512sums=('e0513094935333fca1fb4c3e3493b232507a579ab00a6457cc9ed3e928363d05aad80634fb65a8287a336bf9895194c7be8ddc41bb088a6c2cca44fc1bfbdb6c'
- 'SKIP'
- '2a9c5c6893659b6b157f7d1172b3a4dd99213cd886a1e48ed7950944a5573b5bf43cf42c3f837b1a1e862f4592f697671588d3d38bc4e3d51fdfb11ce336e286'
- 'a3fde7af956736fbc1c5f7a4b738c6562eff017e6506d448513c8c72215a66ce2558bf0cf3dbc8c7571a90bc5e3b83d1d4feeeb06d1333408e6f9c6bdfe4d4ad'
- '6c343d30b3e9c859dd1f251d88810f0515cbff2d9b7851a3b22385f3ed15a59df4365e92435229eab1ff2b0d5a240d4866c9cbba6d8bcb9f042907ad0b7e89ec'
- '43ee0ca3a5f015120095804950ee1191c6d0d3e5048e00ff1f62ef5105a675e8bd914939b88814a742faf445adede3d3717886ab4b025c7f1620fc3d208648c9'
- '023648ac2d1249ca8b692d350c753ac6be837d948c0da24fe47bf4ac3bfe0eda7f997dfa1b96efe92d52d415e7e0371221f014e66eb82f42d6d3eda075bd9ea4')
- prepare() {
- cd $srcdir/$pkgname-$pkgver
- if [[ $pkgver = ${_debver%+*} ]]; then
- # Debian patches
- export QUILT_PATCHES=debian/patches
- export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
- export QUILT_DIFF_ARGS='--no-timestamps'
- mv "$srcdir"/debian .
- # Doesn't apply and seems unimportant
- rm -v debian/patches/debian_manpages || true
- quilt push -av
- fi
- }
- build() {
- cd "$pkgname-$pkgver"
- ./configure \
- --bindir=/bin \
- --libdir=/usr/lib \
- --sysconfdir=/etc \
- --with-rootlibdir=/lib \
- --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-libre-lts-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=(/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,lib}/{depmod,modprobe}.d "$pkgdir/sbin"
- ln -s kmod "$pkgdir/bin/lsmod"
- for tool in {ins,ls,rm,dep}mod mod{probe,info}; do
- ln -s ../bin/kmod "$pkgdir/sbin/$tool"
- done
- # install depmod.d file for search/ dir
- install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/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"
- # disable numdummies option
- # https://issues.hyperbola.info/index.php?do=details&task_id=700
- install -Dm644 "$srcdir/dummy.conf" "$pkgdir/lib/modprobe.d/dummy.conf"
- # install licenses
- install -Dm644 "$pkgname-$pkgver/COPYING" "$pkgdir/usr/share/licenses/$pkgname/COPYING.LIB"
- install -Dm644 "$pkgname-$pkgver/tools/COPYING" "$pkgdir/usr/share/licenses/$pkgname/COPYING"
- }
- # vim: ft=sh syn=sh et
|