summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6e9e23e9a832b156f59408659ee5c7d4da856b8d (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
pkgname=psflib-git
pkgver=r48.77dfb4a
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)
provides=(${pkgname%-git})
conflicts=(${pkgname%-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: