+++ /dev/null
---- 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)) ;
+++ /dev/null
-=== 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 ;
--- /dev/null
+Name: libsndfile
+Version: 1.0.25
+Release: 0
+License: LGPL-2.1+
+Summary: Development/Libraries/C and C++
+Group: System/Libraries
+BuildRequires: pkgconfig(alsa)
+BuildRequires: gcc-c++
+BuildRequires: libtool
+BuildRequires: libvorbis-devel
+BuildRequires: pkg-config
+BuildRequires: speex-devel
+BuildRequires: sqlite-devel
+Url: http://www.mega-nerd.com/libsndfile/
+Source: libsndfile-%{version}.tar.gz
+Source2: baselibs.conf
+
+%description
+Libsndfile is a C library for reading and writing sound files, such as
+AIFF, AU, and WAV files, through one standard interface. It can
+currently read and write 8, 16, 24, and 32-bit PCM files as well as
+32-bit floating point WAV files and a number of compressed formats.
+
+
+%package devel
+Summary: Development package for the libsndfile library
+Group: Development/Libraries/C and C++
+Requires: %{name} = %{version}
+Requires: glibc-devel
+Requires: libstdc++-devel
+
+%description devel
+This package contains the files needed to compile programs that use the
+libsndfile library.
+
+%prep
+%setup -q
+
+%build
+%define warn_flags -W -Wall -Wstrict-prototypes -Wpointer-arith -Wno-unused-parameter
+autoreconf --force --install
+CFLAGS="%{optflags} %{warn_flags}"
+export CFLAGS
+%configure --disable-silent-rules \
+ --disable-static \
+ --enable-sqlite \
+ --with-pic \
+ --enable-experimental
+make %{?_smp_mflags}
+
+%check
+pushd src
+make check
+popd
+
+%install
+%make_install
+# remove programs; built in another spec file
+rm -rf %{buildroot}%{_bindir}
+rm -rf %{buildroot}%{_mandir}/man1
+# remove binaries from examples directory
+make -C examples distclean
+rm -rf %{buildroot}%{_datadir}/doc/libsndfile1-dev
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+%files
+%defattr(-, root, root)
+%{_libdir}/libsndfile.so.1*
+
+%files devel
+%defattr(-, root, root)
+%doc COPYING
+%{_libdir}/libsndfile.so
+%{_includedir}/sndfile.h
+%{_includedir}/sndfile.hh
+%{_libdir}/pkgconfig/*.pc
+
+%changelog
+++ /dev/null
---- 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