add packaging
authorAnas Nashif <anas.nashif@intel.com>
Wed, 7 Nov 2012 23:49:46 +0000 (15:49 -0800)
committerAnas Nashif <anas.nashif@intel.com>
Wed, 7 Nov 2012 23:49:46 +0000 (15:49 -0800)
packaging/baselibs.conf [new file with mode: 0644]
packaging/libsndfile-example-fix.diff [new file with mode: 0644]
packaging/libsndfile-paf-zero-division-fix.diff [new file with mode: 0644]
packaging/sndfile-ocloexec.patch [new file with mode: 0644]

diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf
new file mode 100644 (file)
index 0000000..687c0d5
--- /dev/null
@@ -0,0 +1,2 @@
+libsndfile
+  provides "libsndfile-<targettype> = <version>"
diff --git a/packaging/libsndfile-example-fix.diff b/packaging/libsndfile-example-fix.diff
new file mode 100644 (file)
index 0000000..3a9ce10
--- /dev/null
@@ -0,0 +1,38 @@
+--- examples/sndfile-to-text.c-dist    2009-02-09 12:36:49.000000000 +0100
++++ examples/sndfile-to-text.c 2009-02-09 12:37:05.000000000 +0100
+@@ -101,6 +101,7 @@ main (int argc, char * argv [])
+               return 1 ;
+               } ;
++      memset(&sfinfo, 0, sizeof(sfinfo));
+       if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL)
+       {       printf ("Not able to open input file %s.\n", infilename) ;
+               puts (sf_strerror (NULL)) ;
+--- examples/sfprocess.c-dist  2009-02-07 05:07:34.000000000 +0100
++++ examples/sfprocess.c       2009-02-09 12:36:23.000000000 +0100
+@@ -31,6 +31,7 @@
+ */
+ #include      <stdio.h>
++#include      <string.h>
+ /* Include this header file to use functions from libsndfile. */
+ #include      <sndfile.h>
+@@ -83,6 +84,7 @@ main (void)
+       **              sfinfo.format   = SF_FORMAT_RAW | SF_FORMAT_PCM_16 ;
+       **              sfinfo.channels = 2 ;
+     */
++    memset(&sfinfo, 0, sizeof(sfinfo));
+     if (! (infile = sf_open (infilename, SFM_READ, &sfinfo)))
+     {   /* Open failed so print an error message. */
+         printf ("Not able to open input file %s.\n", infilename) ;
+--- examples/generate.c-dist   2009-02-07 05:07:44.000000000 +0100
++++ examples/generate.c        2009-02-09 12:36:23.000000000 +0100
+@@ -98,6 +98,7 @@ encode_file (const char *infilename, con
+       k = 16 - strlen (outfilename) ;
+       PUT_DOTS (k) ;
++      memset(&sfinfo, 0, sizeof(sfinfo));
+       if (! (infile = sf_open (infilename, SFM_READ, &sfinfo)))
+       {       printf ("Error : could not open file : %s\n", infilename) ;
+               puts (sf_strerror (NULL)) ;
diff --git a/packaging/libsndfile-paf-zero-division-fix.diff b/packaging/libsndfile-paf-zero-division-fix.diff
new file mode 100644 (file)
index 0000000..17f0167
--- /dev/null
@@ -0,0 +1,16 @@
+=== modified file 'src/paf.c'
+---
+ src/paf.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/paf.c
++++ b/src/paf.c
+@@ -202,7 +202,7 @@
+               psf->endian = SF_ENDIAN_BIG ;
+               } ;
+-      if (paf_fmt.channels > SF_MAX_CHANNELS)
++      if (paf_fmt.channels > SF_MAX_CHANNELS || paf_fmt.channels <= 0)
+               return SFE_PAF_BAD_CHANNELS ;
+       psf->datalength = psf->filelength - psf->dataoffset ;
diff --git a/packaging/sndfile-ocloexec.patch b/packaging/sndfile-ocloexec.patch
new file mode 100644 (file)
index 0000000..cb67bd3
--- /dev/null
@@ -0,0 +1,34 @@
+--- configure.ac.orig
++++ configure.ac
+@@ -23,7 +23,9 @@ AC_SUBST(ACLOCAL_AMFLAGS, "-I M4")
+ AC_LANG([C])
+-AC_PROG_CC
++AC_PROG_CC_STDC
++AC_USE_SYSTEM_EXTENSIONS
++AC_SYS_LARGEFILE
+ AM_PROG_CC_C_O
+ AC_PROG_CXX
+ AC_PROG_SED
+--- src/file_io.c.orig
++++ src/file_io.c
+@@ -564,6 +564,9 @@ psf_open_fd (PSF_FILE * pfile)
+                               return - SFE_BAD_OPEN_MODE ;
+                               break ;
+               } ;
++#ifdef O_CLOEXEC
++        oflag |= O_CLOEXEC;
++#endif
+       if (mode == 0)
+               fd = open (pfile->path.c, oflag) ;
+--- Makefile.am.orig
++++ Makefile.am
+@@ -1,5 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
++ACLOCAL_AMFLAGS = -I M4
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror
+ if BUILD_OCTAVE_MOD