summaryrefslogtreecommitdiff
path: root/extra/leveldb/PKGBUILD
blob: 70f0ffc81f056fb7d02e632589ae8314330f7c52 (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
45
46
# $Id: PKGBUILD 169703 2012-10-26 19:01:07Z dreisner $
# Maintainer: Dave Reisner <dreisner@archlinux.org>
# Contributor: feydaykyn <feydaykyn@yahoo.fr>

pkgname=leveldb
pkgver=1.7.0
pkgrel=1
pkgdesc="A fast and lightweight key/value database library"
arch=('i686' 'x86_64' 'mips64el')
url="https://code.google.com/p/leveldb/"
license=('BSD')
depends=('gperftools' 'snappy')
source=("https://leveldb.googlecode.com/files/$pkgname-$pkgver.tar.gz")
sha1sums=('82332ac97d48ad5da02aab4785658c06d0351be1')

build() {
  # buildsys doesn't play nicely with -Wl,--as-needed
  LDFLAGS=-Wl,-O1,--sort-common,-z,relro

  make -C "$pkgname-$pkgver"
}

check() {
  make -C "$pkgname-$pkgver" check
}

package() {
  cd "$pkgname-$pkgver"

  install -dm755 \
      "$pkgdir"/usr/{include/leveldb,lib} \
      "$pkgdir"/usr/share/doc/"$pkgname"

  # libraries
  install -m755 -t "$pkgdir/usr/lib" "libleveldb.so.${pkgver%.?*}" libleveldb.a
  cp -P libleveldb.so{,.1} "$pkgdir/usr/lib"

  # headers
  install -m644 -t "$pkgdir/usr/include/leveldb" include/leveldb/*

  # documentation
  cp -r doc/* "$pkgdir/usr/share/doc/$pkgname"

  # license
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}