summaryrefslogtreecommitdiff
path: root/community/dumb
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-08-13 01:33:19 -0700
committerroot <root@rshg054.dnsready.net>2013-08-13 01:33:19 -0700
commit7a65a910b77ad191d69881098c47f9b0c852d92e (patch)
tree9564e611af1442f8952a8cbddb3b0ad25ed71aab /community/dumb
parent60da6abff6c9577a783d72865f11de7a585e912e (diff)
Tue Aug 13 01:31:08 PDT 2013
Diffstat (limited to 'community/dumb')
-rw-r--r--community/dumb/CVE-2006-3668.patch16
-rw-r--r--community/dumb/PKGBUILD63
-rw-r--r--community/dumb/as-needed.patch72
3 files changed, 151 insertions, 0 deletions
diff --git a/community/dumb/CVE-2006-3668.patch b/community/dumb/CVE-2006-3668.patch
new file mode 100644
index 000000000..09d2fb68f
--- /dev/null
+++ b/community/dumb/CVE-2006-3668.patch
@@ -0,0 +1,16 @@
+Index: libdumb-0.9.3/src/it/itread.c
+===================================================================
+--- libdumb-0.9.3.orig/src/it/itread.c 2006-07-21 11:05:48.000000000 +0200
++++ libdumb-0.9.3/src/it/itread.c 2006-07-21 11:07:22.000000000 +0200
+@@ -292,6 +292,11 @@
+
+ envelope->flags = dumbfile_getc(f);
+ envelope->n_nodes = dumbfile_getc(f);
++ if(envelope->n_nodes > 25) {
++ TRACE("IT error: wrong number of envelope nodes (%d)\n", envelope->n_nodes);
++ envelope->n_nodes = 0;
++ return -1;
++ }
+ envelope->loop_start = dumbfile_getc(f);
+ envelope->loop_end = dumbfile_getc(f);
+ envelope->sus_loop_start = dumbfile_getc(f);
diff --git a/community/dumb/PKGBUILD b/community/dumb/PKGBUILD
new file mode 100644
index 000000000..c30d667a1
--- /dev/null
+++ b/community/dumb/PKGBUILD
@@ -0,0 +1,63 @@
+# $Id: PKGBUILD 83614 2013-02-03 23:11:33Z arodseth $
+# Maintainer: Alexander Rødseth <rodseth@gmail.com>
+# Contributor: Chris Brannon <cmbrannon79@gmail.com>
+# Contributor: JJDaNiMoTh <jjdanimoth@gmail.com>
+# Contributor: Bjørn Lindeijer <bjorn lindeijer nl>
+
+pkgname=dumb
+pkgver=0.9.3
+pkgrel=7
+pkgdesc='IT, XM, S3M and MOD player library'
+arch=('x86_64' 'i686')
+license=('custom:dumb' 'GPL')
+url='http://dumb.sourceforge.net/'
+makedepends=('setconf')
+depends=('glibc' 'allegro4')
+source=("http://downloads.sourceforge.net/sourceforge/dumb/$pkgname-$pkgver.tar.gz"
+ 'as-needed.patch'
+ 'CVE-2006-3668.patch')
+sha256sums=('8d44fbc9e57f3bac9f761c3b12ce102d47d717f0dd846657fb988e0bb5d1ea33'
+ 'f7a41576d5dcecad2f9a01cbb0228457b434423046cb67c9a0a720ec87f43fb9'
+ '9f6785435757db725bc73b1c4874b91e80b9277c6fdd2b56e47dae1cfbc968e6')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ # Add -fPIC for anything but i686
+ [ "$CARCH" = 'i686' ] || export CFLAGS="${CFLAGS} -fPIC"
+
+ # Patch from Gentoo for CVE-2006-3668
+ patch -p1 < "$srcdir/CVE-2006-3668.patch"
+
+ # Patch from Gentoo for binutils >= 2.22
+ patch -p1 < "$srcdir/as-needed.patch"
+ sed -i '/LDFLAGS :=/d' Makefile
+ cp Makefile Makefile.rdy
+
+ # Make with Allegro support
+ # Upstream's make process is interactive, and we can't simply pass
+ # a here-document to the make command. The best way is to write our
+ # own config.txt, circumventing the interactive configuration step,
+ # as is done in Gentoo's ebuild.
+ cat << EOF > make/config.txt
+include make/unix.inc
+ALL_TARGETS := core core-examples core-headers
+ALL_TARGETS += allegro allegro-examples allegro-headers
+PREFIX := /usr
+EOF
+
+ # Use OFLAGS to be able to set CFLAGS without replacing the -I directives
+ make -j1 OFLAGS="${CFLAGS}"
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ install -d "$pkgdir"/usr/{lib,bin,include}
+ install -Dm644 licence.txt \
+ "$pkgdir/usr/share/licenses/$pkgname/licence.txt"
+ setconf make/config.txt PREFIX "$pkgdir/usr"
+ make DESTDIR="$pkgdir" install
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/community/dumb/as-needed.patch b/community/dumb/as-needed.patch
new file mode 100644
index 000000000..6d482d196
--- /dev/null
+++ b/community/dumb/as-needed.patch
@@ -0,0 +1,72 @@
+diff -Naur dumb.orig/Makefile dumb/Makefile
+--- dumb.orig/Makefile 2003-04-03 16:34:18.000000000 -0800
++++ dumb/Makefile 2004-07-06 14:43:38.158063165 -0700
+@@ -199,11 +199,11 @@
+ ALLEGRO_EXAMPLES_EXE := $(addprefix examples/, $(notdir $(patsubst %.c, %$(EXE_SUFFIX), $(ALLEGRO_EXAMPLES))))
+
+
+-CORE_LIB_FILE_RELEASE := $(LIBDIR)/libdumb.a
+-ALLEGRO_LIB_FILE_RELEASE := $(LIBDIR)/libaldmb.a
++CORE_LIB_FILE_RELEASE := $(LIBDIR)/libdumb.so
++ALLEGRO_LIB_FILE_RELEASE := $(LIBDIR)/libaldmb.so
+
+-CORE_LIB_FILE_DEBUG := $(LIBDIR)/libdumbd.a
+-ALLEGRO_LIB_FILE_DEBUG := $(LIBDIR)/libaldmd.a
++CORE_LIB_FILE_DEBUG := $(LIBDIR)/libdumbd.so
++ALLEGRO_LIB_FILE_DEBUG := $(LIBDIR)/libaldmd.so
+
+
+ core: $(CORE_LIB_FILE_RELEASE) $(CORE_LIB_FILE_DEBUG)
+@@ -272,22 +272,22 @@
+
+ OBJDIR := $(OBJDIR_BASE)/release
+ CFLAGS := $(CFLAGS_RELEASE)
+-CORE_LIB_FILE := $(LIBDIR)/libdumb.a
+-ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmb.a
++CORE_LIB_FILE := $(LIBDIR)/libdumb.so
++ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmb.so
+ include make/Makefile.inc
+
+ OBJDIR := $(OBJDIR_BASE)/debug
+ CFLAGS := $(CFLAGS_DEBUG)
+-CORE_LIB_FILE := $(LIBDIR)/libdumbd.a
+-ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmd.a
++CORE_LIB_FILE := $(LIBDIR)/libdumbd.so
++ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmd.so
+ include make/Makefile.inc
+
+
+ $(CORE_EXAMPLES_EXE): examples/%$(EXE_SUFFIX): examples/%.o $(CORE_LIB_FILE_RELEASE)
+- $(CC) $^ -o $@ $(LDFLAGS) $(LINK_MATH)
++ $(CC) $^ -o $@ $(LDFLAGS) $(LINK_MATH)
+
+ $(ALLEGRO_EXAMPLES_EXE): examples/%$(EXE_SUFFIX): examples/%.o $(ALLEGRO_LIB_FILE_RELEASE) $(CORE_LIB_FILE_RELEASE)
+- $(CC) $^ -o $@ $(LDFLAGS) $(LINK_ALLEGRO)
++ $(CC) $^ -o $@ $(LDFLAGS) $(LINK_ALLEGRO)
+
+ $(CORE_EXAMPLES_OBJ): examples/%.o: examples/%.c include/dumb.h
+ $(CC) -c $< -o $@ $(CFLAGS_RELEASE)
+diff -Naur dumb.orig/make/Makefile.inc dumb/make/Makefile.inc
+--- dumb.orig/make/Makefile.inc 2003-04-03 16:34:18.000000000 -0800
++++ dumb/make/Makefile.inc 2004-07-06 14:37:13.082037585 -0700
+@@ -10,8 +10,8 @@
+ # accurately, create a local copy of the current CFLAGS variable. This is
+ # necessary because Make doesn't expand variables in commands until they are
+ # executed.
+-$(CORE_LIB_FILE): CFLAGS := $(CFLAGS)
+-$(ALLEGRO_LIB_FILE): CFLAGS := $(CFLAGS)
++$(CORE_LIB_FILE): CFLAGS := $(CFLAGS) -fPIC -DPIC
++$(ALLEGRO_LIB_FILE): CFLAGS := $(CFLAGS) -fPIC -DPIC
+
+
+ $(OBJDIR)/%.o: src/core/%.c include/dumb.h include/internal/dumb.h
+@@ -28,7 +28,7 @@
+ $(CC) -c -o $@ $< $(CFLAGS) $(WFLAGS_ALLEGRO)
+
+ $(CORE_LIB_FILE): $(CORE_OBJECTS)
+- $(AR) rs $@ $^
++ $(CC) -shared -o $@ $(LDFLAGS) -Wl,-shared,-soname,$(shell basename $@) $^ -lm
+
+ $(ALLEGRO_LIB_FILE): $(ALLEGRO_OBJECTS)
+- $(AR) rs $@ $^
++ $(CC) -shared -o $@ -Llib/unix $(LDFLAGS) -Wl,-shared,-soname,$(shell basename $@) $^ -ldumb