summaryrefslogtreecommitdiff
path: root/core/gdbm
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-11-30 23:15:09 +0000
committerroot <root@rshg054.dnsready.net>2011-11-30 23:15:09 +0000
commitfd115d7057eb8243df6edfaf1ed440d6f3e70692 (patch)
tree0a32bcfa47c11eb3e1127b1de196fb6385ed8723 /core/gdbm
parent946f0c9fe48dfb648a8a0be065e92f237ce210fd (diff)
Wed Nov 30 23:15:09 UTC 2011
Diffstat (limited to 'core/gdbm')
-rw-r--r--core/gdbm/PKGBUILD60
-rw-r--r--core/gdbm/gdbm-1.10-zeroheaders.patch33
2 files changed, 62 insertions, 31 deletions
diff --git a/core/gdbm/PKGBUILD b/core/gdbm/PKGBUILD
index e36a059ac..30570ddf8 100644
--- a/core/gdbm/PKGBUILD
+++ b/core/gdbm/PKGBUILD
@@ -1,24 +1,22 @@
-# $Id: PKGBUILD 142193 2011-11-06 02:28:38Z stephane $
-# Maintainer: Allan McRae <allan@archlinux.org>
+# $Id: PKGBUILD 143800 2011-11-29 13:32:53Z stephane $
+# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
+# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>
pkgname=gdbm
-pkgver=1.8.3
-pkgrel=9
+pkgver=1.10
+pkgrel=1
pkgdesc="GNU database library"
url="http://www.gnu.org/software/gdbm/gdbm.html"
license=('GPL')
arch=('i686' 'x86_64')
depends=('glibc' 'sh')
source=(ftp://ftp.gnu.org/gnu/gdbm/${pkgname}-${pkgver}.tar.gz
- gdbm-1.8.3-zeroheaders.patch
- gdbm-1.8.3-fhs.patch)
+ gdbm-1.10-zeroheaders.patch)
options=('!libtool' '!makeflags')
install=gdbm.install
-md5sums=('1d1b1d5c0245b1c00aff92da751e9aa1'
- 'a2ed344be9258775bd718074cf2e4ec6'
- '66a7c235416c136dc89efc7d03352514')
-
+md5sums=('88770493c2559dc80b561293e39d3570'
+ 'ac255b10452005237836cd2d3a470733')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
@@ -28,32 +26,32 @@ build() {
# 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.8.3-zeroheaders.patch
-
- # Make gdbm buildable.
- patch -Np1 -i ../gdbm-1.8.3-fhs.patch
-
- libtoolize --force --copy
- aclocal
- autoconf
-
- ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
+ patch -Np1 -i ../gdbm-1.10-zeroheaders.patch
- # flock does not work on nfs, we use fcntl instead
- # https://bugzilla.redhat.com/show_bug.cgi?id=477300
- echo "/* We use fcntl locking (POSIX) instead of flock (BSD) */" >> autoconf.h
- echo "#undef HAVE_FLOCK" >> autoconf.h
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-libgdbm-compat
make prefix=/usr
}
-package() {
+check() {
cd "${srcdir}/${pkgname}-${pkgver}"
- make prefix=$pkgdir/usr \
- manprefix=$pkgdir/usr/share/man \
- man3dir=$pkgdir/usr/share/man/man3 \
- infodir=$pkgdir/usr/share/info \
- install install-compat
+ make check
+}
- ln -sf gdbm/gdbm.h $pkgdir/usr/include
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make prefix="${pkgdir}"/usr \
+ manprefix="${pkgdir}"/usr/share/man \
+ man3dir="${pkgdir}"/usr/share/man/man3 \
+ infodir="${pkgdir}"/usr/share/info \
+ 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
}
diff --git a/core/gdbm/gdbm-1.10-zeroheaders.patch b/core/gdbm/gdbm-1.10-zeroheaders.patch
new file mode 100644
index 000000000..a268f6bdf
--- /dev/null
+++ b/core/gdbm/gdbm-1.10-zeroheaders.patch
@@ -0,0 +1,33 @@
+diff -up gdbm-1.10/src/falloc.c.zeroheaders gdbm-1.10/src/falloc.c
+--- gdbm-1.10/src/falloc.c.zeroheaders 2011-11-11 11:59:11.000000000 +0100
++++ gdbm-1.10/src/falloc.c 2011-11-14 17:34:32.487604027 +0100
+@@ -255,7 +255,7 @@ push_avail_block (GDBM_FILE dbf)
+
+
+ /* Split the header block. */
+- temp = (avail_block *) malloc (av_size);
++ temp = (avail_block *) calloc (1, av_size);
+ if (temp == NULL) _gdbm_fatal (dbf, _("malloc error"));
+ /* Set the size to be correct AFTER the pop_avail_block. */
+ temp->size = dbf->header->avail.size;
+diff -up gdbm-1.10/src/gdbmopen.c.zeroheaders gdbm-1.10/src/gdbmopen.c
+--- gdbm-1.10/src/gdbmopen.c.zeroheaders 2011-11-11 19:39:42.000000000 +0100
++++ gdbm-1.10/src/gdbmopen.c 2011-11-14 17:33:24.867608650 +0100
+@@ -264,7 +264,7 @@ gdbm_open (const char *file, int block_s
+ (dbf->header->block_size - sizeof (hash_bucket))
+ / sizeof (bucket_element) + 1;
+ dbf->header->bucket_size = dbf->header->block_size;
+- dbf->bucket = (hash_bucket *) malloc (dbf->header->bucket_size);
++ dbf->bucket = (hash_bucket *) calloc (1, dbf->header->bucket_size);
+ if (dbf->bucket == NULL)
+ {
+ gdbm_close (dbf);
+@@ -456,7 +456,7 @@ _gdbm_init_cache(GDBM_FILE dbf, size_t s
+ for(index = 0; index < size; index++)
+ {
+ (dbf->bucket_cache[index]).ca_bucket
+- = (hash_bucket *) malloc (dbf->header->bucket_size);
++ = (hash_bucket *) calloc (1, dbf->header->bucket_size);
+ if ((dbf->bucket_cache[index]).ca_bucket == NULL)
+ {
+ gdbm_errno = GDBM_MALLOC_ERROR;