summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2eefb31c76f99295df8bc9f675347f4e085fdde5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=lsof-git
pkgver=4.98.0.r82.ge934d94
pkgrel=1
pkgdesc="List open files running processes"
arch=('i686' 'x86_64')
url="https://github.com/lsof-org/lsof"
license=('custom')
depends=('glibc' 'libtirpc')
makedepends=('git')
provides=("lsof=$pkgver")
conflicts=('lsof')
source=("git+https://github.com/lsof-org/lsof.git")
sha256sums=('SKIP')


pkgver() {
  cd "lsof"

  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "lsof"

  ./Configure -n linux
  make CC="cc $CFLAGS $CPPFLAGS $LDFLAGS"
}

package() {
  cd "lsof"

  install -Dm755 "lsof" -t "$pkgdir/usr/bin"
  install -Dm644 "Lsof.8" "$pkgdir/usr/share/man/man8/lsof.8"

  sed -n '/^ \* Copyright 1994 Purdue/,/removed or altered./p' "main.c" > "LICENSE"
  sed -i -e 's|^ \*||g;s|^ ||g' "LICENSE"
  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/lsof"
}