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

Last change on this file since 1803 was 1768, checked in by tellie, 5 years ago

sqlitebrowser: Add spec file

File size: 4.9 KB
Line 
1Summary: Library for reading and writing sound files
2Name: libsndfile
3Version: 1.0.31
4Release: 2%{?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 http://github.com/TeLLie/%{name}-os2 %{version}-os2
11%endif
12
13%if !0%{?os2_version}
14Patch0: libsndfile-1.0.25-system-gsm.patch
15Patch1: libsndfile-1.0.25-zerodivfix.patch
16%endif
17
18%if !0%{?os2_version}
19BuildRequires: gcc-c++
20BuildRequires: alsa-lib-devel
21%endif
22BuildRequires: flac-devel
23BuildRequires: gcc
24BuildRequires: libogg-devel
25BuildRequires: libvorbis-devel
26BuildRequires: pkgconfig
27BuildRequires: sqlite-devel
28%if !0%{?os2_version}
29BuildRequires: gsm-devel
30%endif
31BuildRequires: libtool
32BuildRequires: make
33%if !0%{?os2_version}
34BuildRequires: python3
35%endif
36
37%description
38libsndfile is a C library for reading and writing sound files such as
39AIFF, AU, WAV, and others through one standard interface. It can
40currently read/write 8, 16, 24 and 32-bit PCM files as well as 32 and
4164-bit floating point WAV files and a number of compressed formats. It
42compiles and runs on *nix, MacOS, and Win32.
43
44
45%package devel
46Summary: Development files for libsndfile
47Requires: %{name}%{?_isa} = %{version}-%{release} pkgconfig
48
49
50%description devel
51libsndfile is a C library for reading and writing sound files such as
52AIFF, AU, WAV, and others through one standard interface.
53This package contains files needed to develop with libsndfile.
54
55
56%package utils
57Summary: Command Line Utilities for libsndfile
58Requires: %{name} = %{version}-%{release}
59
60
61%description utils
62libsndfile is a C library for reading and writing sound files such as
63AIFF, AU, WAV, and others through one standard interface.
64This package contains command line utilities for libsndfile.
65
66%debug
67
68%prep
69%if !0%{?os2_version}
70%setup -q
71%else
72%scm_setup
73%endif
74%if !0%{?os2_version}
75%patch0 -p1 -b .system-gsm
76rm -r src/GSM610
77# TODO: check if this patch is still needed
78%patch1 -p1 -b .zerodivfix
79%endif
80
81%build
82%if !0%{?os2_version}
83autoreconf -I M4 -fiv # for system-gsm patch
84%endif
85
86%if !0%{?os2_version}
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 -DBUILD_TESTING=ON \
104 ..
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
111make %{?_smp_mflags}
112%endif
113
114%install
115make install DESTDIR=$RPM_BUILD_ROOT
116rm -rf __docs
117mkdir __docs
118cp -pR $RPM_BUILD_ROOT%{_docdir}/%{name}/* __docs
119rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
120find %{buildroot} -type f -name "*.la" -delete
121
122
123# fix multilib issues
124%if !0%{?os2_version}
125mv %{buildroot}%{_includedir}/sndfile.h \
126 %{buildroot}%{_includedir}/sndfile-%{__isa_bits}.h
127
128cat > %{buildroot}%{_includedir}/sndfile.h <<EOF
129#include <bits/wordsize.h>
130
131#if __WORDSIZE == 32
132# include "sndfile-32.h"
133#elif __WORDSIZE == 64
134# include "sndfile-64.h"
135#else
136# error "unexpected value for __WORDSIZE macro"
137EOF
138%endif
139
140%if !0%{?os2_version}
141%if 0%{?rhel} != 0
142rm -f %{buildroot}%{_bindir}/sndfile-jackplay
143%endif
144%endif
145
146%check
147LD_LIBRARY_PATH=$PWD/src/.libs make check
148
149%if !0%{?os2_version}
150%ldconfig_scriptlets
151%endif
152
153%files
154%{!?_licensedir:%global license %%doc}
155%license COPYING
156%doc AUTHORS README NEWS
157%if !0%{?os2_version}
158%{_libdir}/%{name}.so.*
159%else
160%{_libdir}/*.dll
161%endif
162
163%files utils
164%if !0%{?os2_version}
165%{_bindir}/sndfile-cmp
166%{_bindir}/sndfile-concat
167%{_bindir}/sndfile-convert
168%{_bindir}/sndfile-deinterleave
169%{_bindir}/sndfile-info
170%{_bindir}/sndfile-interleave
171%{_bindir}/sndfile-metadata-get
172%{_bindir}/sndfile-metadata-set
173%{_bindir}/sndfile-play
174%{_bindir}/sndfile-salvage
175%else
176%{_bindir}/*.exe
177%endif
178%{_mandir}/man1/sndfile-cmp.1*
179%{_mandir}/man1/sndfile-concat.1*
180%{_mandir}/man1/sndfile-convert.1*
181%{_mandir}/man1/sndfile-deinterleave.1*
182%{_mandir}/man1/sndfile-info.1*
183%{_mandir}/man1/sndfile-interleave.1*
184%{_mandir}/man1/sndfile-metadata-get.1*
185%{_mandir}/man1/sndfile-metadata-set.1*
186%{_mandir}/man1/sndfile-play.1*
187%{_mandir}/man1/sndfile-salvage.1*
188
189%files devel
190%doc __docs ChangeLog
191%{_includedir}/sndfile.h
192%{_includedir}/sndfile.hh
193%{_includedir}/sndfile-%{__isa_bits}.h
194%if !0%{?os2_version}
195%{_libdir}/%{name}.so
196%else
197%{_libdir}/*.a
198%endif
199%{_libdir}/pkgconfig/sndfile.pc
200
201
202%changelog
203* Sun Jan 31 2021 Elbert Pol <elbert.pol@gmail.com> - 1.0.21-2
204- Update the spec more to Fedora style
205
206* Tue Jan 26 2021 Elbert Pol <elbert.pol@gmail.com> - 1.0.31-1
207- First rpm version for OS2
208- Update to latest version
Note: See TracBrowser for help on using the repository browser.