summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Filippov2015-09-02 18:04:01 +0400
committerAleksey Filippov2015-09-02 18:06:19 +0400
commitf727e79c66495dfa83bc0e2d948b3ed09a523a5f (patch)
treedcda9fda5f8f470d585deee8770802242c65eb01
downloadaur-f727e79c66495dfa83bc0e2d948b3ed09a523a5f.tar.gz
Imported 1.10 version from AUR mirror.
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD66
-rw-r--r--gdbm-1.10-zeroheaders.patch33
-rw-r--r--gdbm-win32-support.patch143
4 files changed, 264 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b4c0066de9e8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = mingw-w64-gdbm
+ pkgdesc = GNU database library (mingw-w64)
+ pkgver = 1.10
+ pkgrel = 2
+ url = http://www.gnu.org/software/gdbm/gdbm.html
+ arch = any
+ license = GPL
+ makedepends = mingw-w64-gcc
+ makedepends = mingw-w64-gettext
+ depends = mingw-w64-crt
+ options = staticlibs
+ options = !buildflags
+ options = !strip
+ source = http://ftp.gnu.org/gnu/gdbm/gdbm-1.10.tar.gz
+ source = gdbm-1.10-zeroheaders.patch
+ source = gdbm-win32-support.patch
+ md5sums = 88770493c2559dc80b561293e39d3570
+ md5sums = ac255b10452005237836cd2d3a470733
+ md5sums = 231f5c2a491af140e916ec1bd4825480
+
+pkgname = mingw-w64-gdbm
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..7c1922258dcb
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,66 @@
+# Maintainer: Aleksey Filippov <sarum9in@gmail.com>
+# Contributor: xantares <xantares09 at hotmail dot com>
+
+pkgname=mingw-w64-gdbm
+pkgver=1.10
+pkgrel=2
+pkgdesc="GNU database library (mingw-w64)"
+url="http://www.gnu.org/software/gdbm/gdbm.html"
+license=('GPL')
+arch=('any')
+depends=('mingw-w64-crt')
+makedepends=('mingw-w64-gcc' 'mingw-w64-gettext')
+source=("http://ftp.gnu.org/gnu/gdbm/gdbm-${pkgver}.tar.gz"
+ 'gdbm-1.10-zeroheaders.patch'
+ 'gdbm-win32-support.patch')
+options=('staticlibs' '!buildflags' '!strip')
+md5sums=('88770493c2559dc80b561293e39d3570'
+ 'ac255b10452005237836cd2d3a470733'
+ '231f5c2a491af140e916ec1bd4825480')
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+
+prepare() {
+ cd "${srcdir}/gdbm-${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
+
+ # http://pkgs.fedoraproject.org/cgit/mingw-gdbm.git/tree/gdbm-win32-support.patch
+ patch -Np0 -i ../gdbm-win32-support.patch
+
+ autoreconf -vfi
+}
+
+build() {
+ cd "${srcdir}/gdbm-${pkgver}"
+ for _arch in ${_architectures}; do
+ unset LDFLAGS
+ mkdir -p "build-${_arch}" && pushd "build-${_arch}"
+
+ ../configure \
+ --prefix=/usr/${_arch} \
+ --host=${_arch}
+ make
+ popd
+ done
+}
+
+package() {
+ for _arch in ${_architectures}; do
+ cd "${srcdir}/gdbm-${pkgver}/build-$_arch"
+ make DESTDIR="$pkgdir" install
+ rm -r "$pkgdir"/usr/${_arch}/share
+ rm "$pkgdir"/usr/${_arch}/bin/*.exe
+ ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
+ ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
+
+ # create symlinks for compatibility
+ install -dm755 "${pkgdir}"/usr/${_arch}/include/gdbm
+ ln -sf ../gdbm.h "${pkgdir}"/usr/${_arch}/include/gdbm/gdbm.h
+ done
+}
diff --git a/gdbm-1.10-zeroheaders.patch b/gdbm-1.10-zeroheaders.patch
new file mode 100644
index 000000000000..a268f6bdfa0b
--- /dev/null
+++ b/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;
diff --git a/gdbm-win32-support.patch b/gdbm-win32-support.patch
new file mode 100644
index 000000000000..bc0d5106b1cb
--- /dev/null
+++ b/gdbm-win32-support.patch
@@ -0,0 +1,143 @@
+--- configure.ac.orig 2012-11-21 22:34:12.148598606 +0100
++++ configure.ac 2012-11-21 22:35:17.036673433 +0100
+@@ -112,6 +112,13 @@
+ AM_CONDITIONAL([COMPAT_OPT], [test "$want_compat" = yes])
+ AM_CONDITIONAL([ENABLE_EXPORT], [test "$want_export" = yes])
+
++if test x$host_os = xmingw32
++then
++ AM_CONDITIONAL(WIN32, true)
++else
++ AM_CONDITIONAL(WIN32, false)
++fi
++
+ # Initialize the test suite.
+ AC_CONFIG_TESTDIR(tests)
+ AC_CONFIG_FILES([tests/Makefile tests/atlocal po/Makefile.in])
+--- src/Makefile.am.orig 2012-11-21 22:27:53.410325014 +0100
++++ src/Makefile.am 2012-11-21 22:33:13.957634294 +0100
+@@ -60,7 +60,10 @@
+ update.c\
+ version.c
+
+-libgdbm_la_LDFLAGS = -version-info $(VI_CURRENT):$(VI_REVISION):$(VI_AGE)
++libgdbm_la_LDFLAGS = -version-info $(VI_CURRENT):$(VI_REVISION):$(VI_AGE) -no-undefined
++if WIN32
++libgdbm_la_LDFLAGS += -lws2_32
++endif
+
+ # Programs
+ bin_PROGRAMS = testgdbm
+--- src/update.c.orig 2012-11-21 22:25:32.667991693 +0100
++++ src/update.c 2012-11-21 22:27:07.567564969 +0100
+@@ -39,8 +39,10 @@
+ _gdbm_fatal (dbf, gdbm_strerror (rc));
+
+ /* Sync the file if fast_write is FALSE. */
++#ifdef HAVE_FSYNC
+ if (dbf->fast_write == FALSE)
+ __fsync (dbf);
++#endif
+ }
+
+
+@@ -84,8 +86,10 @@
+ if (rc)
+ _gdbm_fatal (dbf, gdbm_strerror (rc));
+ dbf->directory_changed = FALSE;
++#ifdef HAVE_FSYNC
+ if (!dbf->header_changed && dbf->fast_write == FALSE)
+ __fsync (dbf);
++#endif
+ }
+
+ /* Final write of the header. */
+--- src/gdbmsync.c.orig 2012-11-21 22:30:53.253304003 +0100
++++ src/gdbmsync.c 2012-11-21 22:31:02.123450829 +0100
+@@ -31,7 +31,8 @@
+ /* Initialize the gdbm_errno variable. */
+ gdbm_errno = GDBM_NO_ERROR;
+
++#ifdef HAVE_FSYNC
+ /* Do the sync on the file. */
+ __fsync (dbf);
+-
++#endif
+ }
+--- src/gdbmopen.c.orig 2012-11-21 22:29:23.495815449 +0100
++++ src/gdbmopen.c 2012-11-21 22:29:37.659050171 +0100
+@@ -316,8 +316,10 @@
+ return NULL;
+ }
+
++#ifdef HAVE_FSYNC
+ /* Wait for initial configuration to be written to disk. */
+ __fsync (dbf);
++#endif
+
+ free (dbf->bucket);
+ }
+--- src/gdbmclose.c.orig 2012-11-21 22:30:04.928503285 +0100
++++ src/gdbmclose.c 2012-11-21 22:30:14.862667066 +0100
+@@ -31,9 +31,11 @@
+ {
+ int index; /* For freeing the bucket cache. */
+
++#ifdef HAVE_FSYNC
+ /* Make sure the database is all on disk. */
+ if (dbf->read_write != GDBM_READER)
+ __fsync (dbf);
++#endif
+
+ /* Close the file and free all malloced memory. */
+ #if HAVE_MMAP
+--- src/flatfile.c.orig 2012-11-21 22:24:10.761635975 +0100
++++ src/flatfile.c 2012-11-21 22:25:17.785745935 +0100
+@@ -20,7 +20,12 @@
+
+ /* Include system configuration before all else. */
+ # include "autoconf.h"
++
++#ifdef WIN32
++# include <winsock2.h>
++#else
+ # include <arpa/inet.h>
++#endif
+
+ # include "gdbmdefs.h"
+ # include "gdbm.h"
+--- src/gdbmreorg.c.orig 2012-11-21 22:30:26.776863411 +0100
++++ src/gdbmreorg.c 2012-11-21 22:30:37.976049148 +0100
+@@ -207,8 +207,10 @@
+ free (new_dbf);
+ free (new_name);
+
++#ifdef HAVE_FSYNC
+ /* Make sure the new database is all on disk. */
+ __fsync (dbf);
++#endif
+
+ /* Force the right stuff for a correct bucket cache. */
+ dbf->cache_entry = &dbf->bucket_cache[0];
+--- src/testgdbm.c.orig 2012-11-21 22:26:25.044859194 +0100
++++ src/testgdbm.c 2012-11-21 22:27:24.536844574 +0100
+@@ -27,7 +27,9 @@
+ #include <errno.h>
+ #include <ctype.h>
+ #include <signal.h>
++#ifndef WIN32
+ #include <sys/ioctl.h>
++#endif
+ #ifdef HAVE_SYS_TERMIOS_H
+ # include <sys/termios.h>
+ #endif
+@@ -1126,7 +1128,9 @@
+ -1)
+ error (2, _("gdbm_setopt failed: %s"), gdbm_strerror (gdbm_errno));
+
++#ifndef WIN32
+ signal (SIGPIPE, SIG_IGN);
++#endif
+
+ /* Welcome message. */
+ if (interactive)