summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c132889ff3d66afc1cd5e3a6f7fa6674944780b7 (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
pkgname=psflib-git
pkgver=r32.936a2bd
pkgrel=1
pkgdesc="A small C library for reading Portable Sound Format files"
arch=(i686 x86_64)
url='https://bitbucket.org/losnoco/psflib'
license=(MIT)
depends=(glibc zlib)
makedepends=(git)
source=(${pkgname}::git+https://bitbucket.org/losnoco/psflib.git)
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/$pkgname"
  ( set -o pipefail
    git describe --long 2>/dev/null | sed -r 's/([^-]*-g)/r\1/;s/-/./g' ||
      printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  cd "$srcdir/$pkgname"
  make CFLAGS="$CFLAGS -fPIC -c"
  "${CC-cc}" "$CFLAGS" -shared -lz -o libpsflib.so *.o
}

package() {
  cd "$srcdir/$pkgname"
  install -D -m644 -t "$pkgdir/usr/include" psflib.h psf2fs.h
  install -D -m644 -t "$pkgdir/usr/lib" libpsflib.{a,so}
  install -D -m644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}

# vim:set sw=2 et: