summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f2f89a7cb66af7d647cceee671f4fb1943452404 (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
41
42
43
44
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=libdnet-git
pkgver=1.16.4.r0.gb2b839d
pkgrel=1
pkgdesc="A simplified, portable interface to several low-level networking routines"
arch=('i686' 'x86_64')
url="https://github.com/dugsong/libdnet"
license=('BSD')
depends=('glibc' 'sh')
makedepends=('git')
provides=("libdnet=$pkgver")
conflicts=('libdnet')
options=('staticlibs')
source=("git+https://github.com/dugsong/libdnet.git")
sha256sums=('SKIP')


pkgver() {
  cd "libdnet"

  _tag=$(git tag -l --sort -v:refname | sed -n '1,1{s/libdnet-//p}')
  _rev=$(git rev-list --count libdnet-$_tag..HEAD)
  _hash=$(git rev-parse --short HEAD)
  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash"
}

build() {
  cd "libdnet"

  autoconf
  ./configure \
    --prefix="/usr" \
    --sbindir="/usr/bin" \
    --mandir="/usr/share/man"
  make
}

package() {
  cd "libdnet"

  make DESTDIR="$pkgdir" install
  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/libdnet"
}