source: spec/trunk/SPECS/libsndfile.spec@ 1808

Last change on this file since 1808 was 1807, checked in by tellie, 4 years ago

spec: libsndfile: Release version 1.1.0-1.

File size: 5.7 KB
Line 
1Summary: Library for reading and writing sound files
2Name: libsndfile
3Version: 1.1.0
4Release: 1%{?dist}
5License: LGPLv2+ and GPLv2+ and BSD
6URL: http://libsndfile.github.io/libsndfile/
7%if !0%{?os2_version}
8Source0: 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}
13Patch0: libsndfile-1.0.25-system-gsm.patch
14Patch1: libsndfile-1.0.25-zerodivfix.patch
15# from upstream, fix #1984320=CVE-2021-3246, for <= 1.0.31
16Patch2: libsndfile-1.0.31-deb669ee.patch
17# from upstream, fix #2027692, for <= 1.0.31
18Patch3: libsndfile-1.0.31-ced91d7b.patch
19%endif
20BuildRequires: gcc-c++
21%if !0%{?os2_version}
22BuildRequires: alsa-lib-devel
23%endif
24BuildRequires: flac-devel
25BuildRequires: gcc
26BuildRequires: libogg-devel
27BuildRequires: libvorbis-devel
28BuildRequires: pkgconfig
29BuildRequires: sqlite-devel
30%if !0%{?os2_version}
31BuildRequires: gsm-devel
32%endif
33BuildRequires: libtool
34BuildRequires: make
35BuildRequires: python3
36BuildRequires: opus-devel
37
38
39%description
40libsndfile is a C library for reading and writing sound files such as
41AIFF, AU, WAV, and others through one standard interface. It can
42currently read/write 8, 16, 24 and 32-bit PCM files as well as 32 and
4364-bit floating point WAV files and a number of compressed formats. It
44compiles and runs on *nix, MacOS, and Win32.
45
46
47%package devel
48Summary: Development files for libsndfile
49Requires: %{name}%{?_isa} = %{version}-%{release} pkgconfig
50
51
52%description devel
53libsndfile is a C library for reading and writing sound files such as
54AIFF, AU, WAV, and others through one standard interface.
55This package contains files needed to develop with libsndfile.
56
57
58%package utils
59Summary: Command Line Utilities for libsndfile
60Requires: %{name} = %{version}-%{release}
61
62
63%description utils
64libsndfile is a C library for reading and writing sound files such as
65AIFF, AU, WAV, and others through one standard interface.
66This 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
73rm -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}
86autoreconf -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
94mkdir build
95cd build
96export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
97export 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}
107sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
108sed -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
114make %{?_smp_mflags}
115%endif
116
117%install
118%make_install -C build
119rm -rf __docs
120mkdir __docs
121cp -pR $RPM_BUILD_ROOT%{_docdir}/%{name}/* __docs
122rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
123find %{buildroot} -type f -name "*.la" -delete
124
125# fix multilib issues
126mv %{buildroot}%{_includedir}/sndfile.h \
127 %{buildroot}%{_includedir}/sndfile-%{__isa_bits}.h
128
129cat > %{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
139EOF
140
141%if 0%{?rhel} != 0 || !0%{?os2_version}
142rm -f %{buildroot}%{_bindir}/sndfile-jackplay
143%endif
144
145
146%check
147%if 0%{?os2_version}
148LD_LIBRARY_PATH=$PWD/build
149%endif
150cd build
151make -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
Note: See TracBrowser for help on using the repository browser.