# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Robin Candau <antiz@archlinux.org>
# Contributor: Tom Gundersen <teg@jklm.no>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Aaron Griffin <aaron@archlinux.org>
# Contributor: Jochem Kossen <j.kossen@home.nl>
# Contributor: Hendrik Meyer <archlinux@t4cc0.re>

pkgname=lsof
pkgver=4.99.6
pkgrel=1
pkgdesc='Lists open files for running Unix processes'
url='https://github.com/lsof-org/lsof'
arch=('x86_64' 'aarch64')
license=('custom')
depends=(
  glibc
  libtirpc
)
makedepends=(
  groff
)
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=('2ce65158694e9c44dfc54916f5b843d887763c03128e0a1c77d62ae106537009')
b2sums=('32a5f2757b67e24fe5d2263d3134d2b7643a461340787dc212d08a3284f0e3d1b4945865edea81f03e35b9210e5fd88b54b810ca52078845d5b8602dc3d74a3a')

build() {
  cd "${pkgname}-${pkgver}"
  autoreconf -fiv
  ./configure \
    --prefix=/usr \
    --enable-security \
    --enable-no-sock-security \
    --with-libtirpc
  make
}

package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -Dm 644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}

# vim: ts=2 sw=2 et:
