summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-04-19 09:13:53 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-04-19 09:18:46 +0000
commitbd48ba5d5a0acc9688555721762769d797bda02c (patch)
tree11e6813cd45b5760c4ac92b861a0606c8e7c8187 /testing
parent892bdf3b34ea67b7bfc07f582a21be38ff3fa917 (diff)
downloadaports-bd48ba5d5a0acc9688555721762769d797bda02c.tar.bz2
aports-bd48ba5d5a0acc9688555721762769d797bda02c.tar.xz
testing/gsm: new aport
Shared libraries for GSM speech compressor http://www.quut.com/gsm/
Diffstat (limited to 'testing')
-rw-r--r--testing/gsm/APKBUILD69
m---------testing/gsm/gsm0
-rw-r--r--testing/gsm/gsm-64bit.patch15
-rw-r--r--testing/gsm/gsm-makefile.patch115
-rw-r--r--testing/gsm/gsm-warnings.patch43
5 files changed, 242 insertions, 0 deletions
diff --git a/testing/gsm/APKBUILD b/testing/gsm/APKBUILD
new file mode 100644
index 000000000..e2548140f
--- /dev/null
+++ b/testing/gsm/APKBUILD
@@ -0,0 +1,69 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=gsm
+pkgver=1.0.13
+pkgrel=0
+_soname=1.0.12
+pkgdesc="Shared libraries for GSM speech compressor"
+url="http://www.quut.com/gsm/"
+arch="all"
+license="MIT"
+depends=
+depends_dev=
+makedepends="$depends_dev"
+install=""
+subpackages="$pkgname-dev $pkgname-doc $pkgname-tools"
+source="http://www.quut.com/gsm/gsm-$pkgver.tar.gz
+ gsm-64bit.patch
+ gsm-makefile.patch
+ gsm-warnings.patch
+ "
+
+_builddir="$srcdir"/gsm-1.0-pl13
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ export RPM_OPT_FLAGS="$CFLAGS -fPIC"
+ make all || return 1
+}
+
+package() {
+ cd "$_builddir"
+ mkdir -p "$pkgdir"/usr/bin \
+ "$pkgdir"/usr/include/gsm \
+ "$pkgdir"/usr/lib \
+ "$pkgdir"/usr/share/man/man1 \
+ "$pkgdir"/usr/share/man/man3
+
+ make install \
+ INSTALL_ROOT="$pkgdir"/usr \
+ GSM_INSTALL_INC="$pkgdir"/usr/include/gsm \
+ GSM_INSTALL_LIB="$pkgdir"/usr/lib \
+ || return 1
+ cp -p lib/libgsm.so.$_soname "$pkgdir"/usr/lib/ || return 1
+ ln -s libgsm.so.$_soname "$pkgdir"/usr/lib/libgsm.so.1 || return 1
+ ln -s libgsm.so.$_soname "$pkgdir"/usr/lib/libgsm.so || return 1
+
+ ln -s gsm/gsm.h "$pkgdir"/usr/include/
+ rm -f "$pkgdir"/usr/lib/lib*.a
+}
+
+tools() {
+ pkgdesc="GSM speech compressor tools"
+ mkdir -p "$subpkgdir"/usr
+ mv "$pkgdir"/usr/bin "$subpkgdir"/usr
+}
+
+md5sums="c1ba392ce61dc4aff1c29ea4e92f6df4 gsm-1.0.13.tar.gz
+1e4f975729e58fe309bda013b26020d9 gsm-64bit.patch
+5d7da37bbc094b392c406df24a15958b gsm-makefile.patch
+a04797e67d809de42c77f9bd0027eb34 gsm-warnings.patch"
diff --git a/testing/gsm/gsm b/testing/gsm/gsm
new file mode 160000
+Subproject 7dea7be756523f98e30dddb62f0fa8fc8477473
diff --git a/testing/gsm/gsm-64bit.patch b/testing/gsm/gsm-64bit.patch
new file mode 100644
index 000000000..195ed31fa
--- /dev/null
+++ b/testing/gsm/gsm-64bit.patch
@@ -0,0 +1,15 @@
+--- gsm-1.0-pl12/inc/private.h.64bit 2006-04-26 21:17:01.000000000 +0200
++++ gsm-1.0-pl12/inc/private.h 2007-05-11 00:25:23.000000000 +0200
+@@ -10,10 +10,10 @@
+ #define PRIVATE_H
+
+ typedef short word; /* 16 bit signed int */
+-typedef long longword; /* 32 bit signed int */
++typedef int longword; /* 32 bit signed int */
+
+ typedef unsigned short uword; /* unsigned word */
+-typedef unsigned long ulongword; /* unsigned longword */
++typedef unsigned int ulongword; /* unsigned longword */
+
+ struct gsm_state {
+
diff --git a/testing/gsm/gsm-makefile.patch b/testing/gsm/gsm-makefile.patch
new file mode 100644
index 000000000..cf3e99bc9
--- /dev/null
+++ b/testing/gsm/gsm-makefile.patch
@@ -0,0 +1,115 @@
+--- gsm-1.0-pl12/Makefile.mk 2006-04-26 21:14:26.000000000 +0200
++++ gsm-1.0-pl12/Makefile 2007-05-13 13:03:32.000000000 +0200
+@@ -30,6 +30,10 @@
+ ######### define this, and read about the GSM_OPT_WAV49 option in the
+ ######### manual page on gsm_option(3).
+
++PG =
++#PG = -g -pg
++######### Profiling flags. If you don't know what that means, leave it blank
++
+ # Choose a compiler. The code works both with ANSI and K&R-C.
+ # Use -DNeedFunctionPrototypes to compile with, -UNeedFunctionPrototypes to
+ # compile without, function prototypes in the header files.
+@@ -44,7 +48,7 @@
+ # CCFLAGS = -c -O
+
+ CC = gcc -ansi -pedantic
+-CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1
++CCFLAGS = -c $(RPM_OPT_FLAGS) -D_REENTRANT -DNeedFunctionPrototypes=1
+
+ LD = $(CC)
+
+@@ -81,7 +85,7 @@
+ GSM_INSTALL_ROOT = $(INSTALL_ROOT)
+ GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
+ GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
+-GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
++GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
+
+
+ # Where do you want to install the toast binaries and their manpage?
+@@ -91,16 +95,16 @@
+
+ TOAST_INSTALL_ROOT = $(INSTALL_ROOT)
+ TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
+-TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
++TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
+
+ # Other tools
+
+ SHELL = /bin/sh
+-LN = ln
++LN = ln -s
+ BASENAME = basename
+ AR = ar
+ ARFLAGS = cr
+-RMFLAGS =
++RMFLAGS = -f
+ FIND = find
+ COMPRESS = compress
+ COMPRESSFLAGS =
+@@ -129,17 +133,18 @@
+ # DEBUG = -DNDEBUG
+ ######### Remove -DNDEBUG to enable assertions.
+
+-CFLAGS = $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
++CFLAGS = $(PG) $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
+ $(WAV49) $(CCINC) -I$(INC)
+ ######### It's $(CC) $(CFLAGS)
+
+-LFLAGS = $(LDFLAGS) $(LDINC)
++LFLAGS = $(PG) $(LDFLAGS) $(LDINC)
+ ######### It's $(LD) $(LFLAGS)
+
+
+ # Targets
+
+ LIBGSM = $(LIB)/libgsm.a
++LIBGSMSO = $(LIB)/libgsm.so
+
+ TOAST = $(BIN)/toast
+ UNTOAST = $(BIN)/untoast
+@@ -279,7 +284,7 @@
+
+ # Target rules
+
+-all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
++all: $(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
+ @-echo $(ROOT): Done.
+
+ tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
+@@ -299,24 +304,28 @@
+
+ # The basic API: libgsm
+
++$(LIBGSMSO): $(LIB) $(GSM_OBJECTS)
++ $(LD) -o $@.1.0.12 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(GSM_OBJECTS) -lc
++ ln -fs libgsm.so.1.0.12 lib/libgsm.so.1
++ ln -fs libgsm.so.1.0.12 lib/libgsm.so
++
+ $(LIBGSM): $(LIB) $(GSM_OBJECTS)
+ -rm $(RMFLAGS) $(LIBGSM)
+ $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
+ $(RANLIB) $(LIBGSM)
+
+-
+ # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
+
+-$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM)
+- $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
++$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM) $(LIBGSMSO)
++ $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB)
+
+ $(UNTOAST): $(BIN) $(TOAST)
+ -rm $(RMFLAGS) $(UNTOAST)
+- $(LN) $(TOAST) $(UNTOAST)
++ $(LN) toast $(UNTOAST)
+
+ $(TCAT): $(BIN) $(TOAST)
+ -rm $(RMFLAGS) $(TCAT)
+- $(LN) $(TOAST) $(TCAT)
++ $(LN) toast $(TCAT)
+
+
+ # The local bin and lib directories
diff --git a/testing/gsm/gsm-warnings.patch b/testing/gsm/gsm-warnings.patch
new file mode 100644
index 000000000..8bec416ad
--- /dev/null
+++ b/testing/gsm/gsm-warnings.patch
@@ -0,0 +1,43 @@
+--- gsm-1.0-pl12/src/code.c.warn 2006-04-26 21:16:50.000000000 +0200
++++ gsm-1.0-pl12/src/code.c 2007-05-11 00:26:52.000000000 +0200
+@@ -9,8 +9,8 @@
+ #include "config.h"
+
+
+-#ifdef HAS_STDLIB_H
+-#include <stdlib.h>
++#ifdef HAS_STRING_H
++#include <string.h>
+ #else
+ # include "proto.h"
+ extern char * memcpy P((char *, char *, int));
+--- gsm-1.0-pl12/src/toast.c.warn 2006-04-26 21:14:26.000000000 +0200
++++ gsm-1.0-pl12/src/toast.c 2007-05-11 00:26:52.000000000 +0200
+@@ -6,6 +6,8 @@
+
+ /* $Header: /home/fedora/jkeating/pkgs/rpms/gsm/devel/gsm-warnings.patch,v 1.1 2007/05/11 23:18:21 rathann Exp $ */
+
++#include <stdio.h>
++#include <getopt.h>
+ #include "toast.h"
+
+ /* toast -- lossy sound compression using the gsm library.
+--- gsm-1.0-pl12/add-test/add_test.c.warn 2006-04-26 21:14:25.000000000 +0200
++++ gsm-1.0-pl12/add-test/add_test.c 2007-05-11 00:28:03.000000000 +0200
+@@ -9,6 +9,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+
+ #include "gsm.h"
+
+@@ -29,7 +30,7 @@
+ longword M_gsm_L_mult P((word op1, word op2));
+ longword M_gsm_L_add P((longword op1, longword op2));
+
+-help()
++void help(void)
+ {
+ puts( " add a b sub a b mult a b div a b" );
+ puts( "L_add A B L_sub A B L_mult A B mult_r a b" );