| 1 | Summary: Library for reading and writing sound files
|
|---|
| 2 | Name: libsndfile
|
|---|
| 3 | Version: 1.1.0
|
|---|
| 4 | Release: 1%{?dist}
|
|---|
| 5 | License: LGPLv2+ and GPLv2+ and BSD
|
|---|
| 6 | URL: http://libsndfile.github.io/libsndfile/
|
|---|
| 7 | %if !0%{?os2_version}
|
|---|
| 8 | Source0: https://github.com/libsndfile/libsndfile/releases/download/%{version}/libsndfile-%{version}.tar.bz2
|
|---|
| 9 | %else
|
|---|
| 10 | %scm_source github https://github.com/TeLLie/libsndfile-os2 %{version}-os2
|
|---|
| 11 | %endif
|
|---|
| 12 | %if !0%{?os2_version}
|
|---|
| 13 | Patch0: libsndfile-1.0.25-system-gsm.patch
|
|---|
| 14 | Patch1: libsndfile-1.0.25-zerodivfix.patch
|
|---|
| 15 | # from upstream, fix #1984320=CVE-2021-3246, for <= 1.0.31
|
|---|
| 16 | Patch2: libsndfile-1.0.31-deb669ee.patch
|
|---|
| 17 | # from upstream, fix #2027692, for <= 1.0.31
|
|---|
| 18 | Patch3: libsndfile-1.0.31-ced91d7b.patch
|
|---|
| 19 | %endif
|
|---|
| 20 | BuildRequires: gcc-c++
|
|---|
| 21 | %if !0%{?os2_version}
|
|---|
| 22 | BuildRequires: alsa-lib-devel
|
|---|
| 23 | %endif
|
|---|
| 24 | BuildRequires: flac-devel
|
|---|
| 25 | BuildRequires: gcc
|
|---|
| 26 | BuildRequires: libogg-devel
|
|---|
| 27 | BuildRequires: libvorbis-devel
|
|---|
| 28 | BuildRequires: pkgconfig
|
|---|
| 29 | BuildRequires: sqlite-devel
|
|---|
| 30 | %if !0%{?os2_version}
|
|---|
| 31 | BuildRequires: gsm-devel
|
|---|
| 32 | %endif
|
|---|
| 33 | BuildRequires: libtool
|
|---|
| 34 | BuildRequires: make
|
|---|
| 35 | BuildRequires: python3
|
|---|
| 36 | BuildRequires: opus-devel
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | %description
|
|---|
| 40 | libsndfile is a C library for reading and writing sound files such as
|
|---|
| 41 | AIFF, AU, WAV, and others through one standard interface. It can
|
|---|
| 42 | currently read/write 8, 16, 24 and 32-bit PCM files as well as 32 and
|
|---|
| 43 | 64-bit floating point WAV files and a number of compressed formats. It
|
|---|
| 44 | compiles and runs on *nix, MacOS, and Win32.
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 | %package devel
|
|---|
| 48 | Summary: Development files for libsndfile
|
|---|
| 49 | Requires: %{name}%{?_isa} = %{version}-%{release} pkgconfig
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 | %description devel
|
|---|
| 53 | libsndfile is a C library for reading and writing sound files such as
|
|---|
| 54 | AIFF, AU, WAV, and others through one standard interface.
|
|---|
| 55 | This package contains files needed to develop with libsndfile.
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 | %package utils
|
|---|
| 59 | Summary: Command Line Utilities for libsndfile
|
|---|
| 60 | Requires: %{name} = %{version}-%{release}
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 | %description utils
|
|---|
| 64 | libsndfile is a C library for reading and writing sound files such as
|
|---|
| 65 | AIFF, AU, WAV, and others through one standard interface.
|
|---|
| 66 | This package contains command line utilities for libsndfile.
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 | %prep
|
|---|
| 70 | %if !0%{?os2_version}
|
|---|
| 71 | %setup -q
|
|---|
| 72 | %patch0 -p1 -b .system-gsm
|
|---|
| 73 | rm -r src/GSM610
|
|---|
| 74 | %else
|
|---|
| 75 | %scm_setup
|
|---|
| 76 | %endif
|
|---|
| 77 | # TODO: check if this patch is still needed
|
|---|
| 78 | %if !0%{?os2_version}
|
|---|
| 79 | %patch1 -p1 -b .zerodivfix
|
|---|
| 80 | %patch2 -p1 -b .deb669ee
|
|---|
| 81 | %patch3 -p1 -b .ced91d7b
|
|---|
| 82 | %endif
|
|---|
| 83 |
|
|---|
| 84 | %build
|
|---|
| 85 | %if !0%{?os2_version}
|
|---|
| 86 | autoreconf -I M4 -fiv # for system-gsm patch
|
|---|
| 87 | %configure \
|
|---|
| 88 | --disable-dependency-tracking \
|
|---|
| 89 | --enable-sqlite \
|
|---|
| 90 | --enable-alsa \
|
|---|
| 91 | --enable-largefile \
|
|---|
| 92 | --disable-static
|
|---|
| 93 | %else
|
|---|
| 94 | mkdir build
|
|---|
| 95 | cd build
|
|---|
| 96 | export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
|---|
| 97 | export LIBS="-lcx"
|
|---|
| 98 | %cmake -DCMAKE_INSTALL_PREFIX:PATH=/@unixroot/usr \
|
|---|
| 99 | -DCMAKE_SKIP_RPATH:BOOL=YES \
|
|---|
| 100 | -DOS2_USE_CXX_EMXEXP=ON \
|
|---|
| 101 | -DCMAKE_BUILD_TYPE=Release \
|
|---|
| 102 | -Wno-dev \
|
|---|
| 103 | ..
|
|---|
| 104 | %endif
|
|---|
| 105 | # Get rid of rpath
|
|---|
| 106 | %if !0%{?os2_version}
|
|---|
| 107 | sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
|---|
| 108 | sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
|---|
| 109 | %endif
|
|---|
| 110 |
|
|---|
| 111 | %if !0%{?os2_version}
|
|---|
| 112 | %make_build
|
|---|
| 113 | %else
|
|---|
| 114 | make %{?_smp_mflags}
|
|---|
| 115 | %endif
|
|---|
| 116 |
|
|---|
| 117 | %install
|
|---|
| 118 | %make_install -C build
|
|---|
| 119 | rm -rf __docs
|
|---|
| 120 | mkdir __docs
|
|---|
| 121 | cp -pR $RPM_BUILD_ROOT%{_docdir}/%{name}/* __docs
|
|---|
| 122 | rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
|
|---|
| 123 | find %{buildroot} -type f -name "*.la" -delete
|
|---|
| 124 |
|
|---|
| 125 | # fix multilib issues
|
|---|
| 126 | mv %{buildroot}%{_includedir}/sndfile.h \
|
|---|
| 127 | %{buildroot}%{_includedir}/sndfile-%{__isa_bits}.h
|
|---|
| 128 |
|
|---|
| 129 | cat > %{buildroot}%{_includedir}/sndfile.h <<EOF
|
|---|
| 130 | #include <bits/wordsize.h>
|
|---|
| 131 |
|
|---|
| 132 | #if __WORDSIZE == 32
|
|---|
| 133 | # include "sndfile-32.h"
|
|---|
| 134 | #elif __WORDSIZE == 64
|
|---|
| 135 | # include "sndfile-64.h"
|
|---|
| 136 | #else
|
|---|
| 137 | # error "unexpected value for __WORDSIZE macro"
|
|---|
| 138 | #endif
|
|---|
| 139 | EOF
|
|---|
| 140 |
|
|---|
| 141 | %if 0%{?rhel} != 0 || !0%{?os2_version}
|
|---|
| 142 | rm -f %{buildroot}%{_bindir}/sndfile-jackplay
|
|---|
| 143 | %endif
|
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 | %check
|
|---|
| 147 | %if 0%{?os2_version}
|
|---|
| 148 | LD_LIBRARY_PATH=$PWD/build
|
|---|
| 149 | %endif
|
|---|
| 150 | cd build
|
|---|
| 151 | make -k test
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 | %if !0%{?os2_version}
|
|---|
| 155 | %ldconfig_scriptlets
|
|---|
| 156 | %endif
|
|---|
| 157 |
|
|---|
| 158 | %files
|
|---|
| 159 | %{!?_licensedir:%global license %%doc}
|
|---|
| 160 | %license COPYING
|
|---|
| 161 | %doc AUTHORS README NEWS
|
|---|
| 162 | %if !0%{?os2_version}
|
|---|
| 163 | %{_libdir}/%{name}.so.*
|
|---|
| 164 | %else
|
|---|
| 165 | %{_libdir}/*.dll
|
|---|
| 166 | %endif
|
|---|
| 167 |
|
|---|
| 168 | %files utils
|
|---|
| 169 | %if !0%{?os2_version}
|
|---|
| 170 | %{_bindir}/sndfile-cmp
|
|---|
| 171 | %{_bindir}/sndfile-concat
|
|---|
| 172 | %{_bindir}/sndfile-convert
|
|---|
| 173 | %{_bindir}/sndfile-deinterleave
|
|---|
| 174 | %{_bindir}/sndfile-info
|
|---|
| 175 | %{_bindir}/sndfile-interleave
|
|---|
| 176 | %{_bindir}/sndfile-metadata-get
|
|---|
| 177 | %{_bindir}/sndfile-metadata-set
|
|---|
| 178 | %{_bindir}/sndfile-play
|
|---|
| 179 | %{_bindir}/sndfile-salvage
|
|---|
| 180 | %else
|
|---|
| 181 | %{_bindir}/sndfile-cmp.exe
|
|---|
| 182 | %{_bindir}/sndfile-concat.exe
|
|---|
| 183 | %{_bindir}/sndfile-convert.exe
|
|---|
| 184 | %{_bindir}/sndfile-deinterleave.exe
|
|---|
| 185 | %{_bindir}/sndfile-info.exe
|
|---|
| 186 | %{_bindir}/sndfile-interleave.exe
|
|---|
| 187 | %{_bindir}/sndfile-metadata-get.exe
|
|---|
| 188 | %{_bindir}/sndfile-metadata-set.exe
|
|---|
| 189 | %{_bindir}/sndfile-play.exe
|
|---|
| 190 | %{_bindir}/sndfile-salvage.exe
|
|---|
| 191 | %endif
|
|---|
| 192 | %{_mandir}/man1/sndfile-cmp.1*
|
|---|
| 193 | %{_mandir}/man1/sndfile-concat.1*
|
|---|
| 194 | %{_mandir}/man1/sndfile-convert.1*
|
|---|
| 195 | %{_mandir}/man1/sndfile-deinterleave.1*
|
|---|
| 196 | %{_mandir}/man1/sndfile-info.1*
|
|---|
| 197 | %{_mandir}/man1/sndfile-interleave.1*
|
|---|
| 198 | %{_mandir}/man1/sndfile-metadata-get.1*
|
|---|
| 199 | %{_mandir}/man1/sndfile-metadata-set.1*
|
|---|
| 200 | %{_mandir}/man1/sndfile-play.1*
|
|---|
| 201 | %{_mandir}/man1/sndfile-salvage.1*
|
|---|
| 202 |
|
|---|
| 203 | %files devel
|
|---|
| 204 | %doc __docs ChangeLog
|
|---|
| 205 | %{_includedir}/sndfile.h
|
|---|
| 206 | %{_includedir}/sndfile.hh
|
|---|
| 207 | %{_includedir}/sndfile-%{__isa_bits}.h
|
|---|
| 208 | %if !0%{?os2_version}
|
|---|
| 209 | %{_libdir}/%{name}.so
|
|---|
| 210 | %else
|
|---|
| 211 | %{_libdir}/*.a
|
|---|
| 212 | %endif
|
|---|
| 213 | %dir %{_libdir}/cmake/SndFile
|
|---|
| 214 | %{_libdir}/cmake/SndFile/SndFileTargets-release.cmake
|
|---|
| 215 | %{_libdir}/cmake/SndFile/SndFileConfig.cmake
|
|---|
| 216 | %{_libdir}/cmake/SndFile/SndFileConfigVersion.cmake
|
|---|
| 217 | %{_libdir}/cmake/SndFile/SndFileTargets.cmake
|
|---|
| 218 | %{_libdir}/pkgconfig/sndfile.pc
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 | %changelog
|
|---|
| 222 | * Sun Apr 10 2022 Elbert Pol <elbert.pol@gmail.com> - 1.0.1-1
|
|---|
| 223 | - Updated to latest version
|
|---|
| 224 |
|
|---|
| 225 | * Sun Jan 31 2021 Elbert Pol <elbert.pol@gmail.com> - 1.0.21-2
|
|---|
| 226 | - Update the spec more to Fedora style
|
|---|
| 227 |
|
|---|
| 228 | * Tue Jan 26 2021 Elbert Pol <elbert.pol@gmail.com> - 1.0.31-1
|
|---|
| 229 | - First rpm version for OS2
|
|---|
| 230 | - Update to latest version
|
|---|