summaryrefslogtreecommitdiff
path: root/core/gdbm/PKGBUILD
blob: 9ae79e6cb54982ee7e19db7a0daedc381aaf6191 (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
47
48
49
50
51
52
53
54
55
# $Id: PKGBUILD 203669 2014-01-13 20:48:15Z eric $
# Maintainer: 
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

pkgname=gdbm
pkgver=1.11
pkgrel=1
pkgdesc="GNU database library"
url="http://www.gnu.org/software/gdbm/gdbm.html"
license=('GPL3')
arch=('i686' 'x86_64')
depends=('glibc' 'sh')
source=(ftp://ftp.gnu.org/gnu/gdbm/${pkgname}-${pkgver}.tar.gz{,.sig}
        gdbm-1.10-zeroheaders.patch)
options=('!makeflags')
install=gdbm.install
md5sums=('72c832680cf0999caedbe5b265c8c1bd'
         'SKIP'
         'ac255b10452005237836cd2d3a470733')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # Prevent gdbm from storing uninitialized memory content
  # to database files. This patch improves security, as the
  # uninitialized memory might contain sensitive informations
  # from other applications.
  # https://bugzilla.redhat.com/show_bug.cgi?id=4457
  # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=208927
  patch -Np1 -i ../gdbm-1.10-zeroheaders.patch
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure --prefix=/usr --enable-libgdbm-compat
  make
}

check() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make check
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  # create symlinks for compatibility
  install -dm755 "${pkgdir}"/usr/include/gdbm
  ln -sf ../gdbm.h "${pkgdir}"/usr/include/gdbm/gdbm.h
  ln -sf ../ndbm.h "${pkgdir}"/usr/include/gdbm/ndbm.h
  ln -sf ../dbm.h  "${pkgdir}"/usr/include/gdbm/dbm.h
}