LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File sox.spec of Package sox (Project multimedia:apps)

#
# spec file for package sox
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define soname 2

%bcond_with ffmpeg
%bcond_with mad
%bcond_with lame
%bcond_with amrwb
%bcond_with amrnb
%bcond_with twolame

Name:           sox
BuildRequires:  file-devel
BuildRequires:  ladspa-devel
BuildRequires:  libgsm-devel
BuildRequires:  libid3tag-devel
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(ao)
BuildRequires:  pkgconfig(flac)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libpulse-simple)
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(vorbisenc)
BuildRequires:  pkgconfig(vorbisfile)
BuildRequires:  pkgconfig(wavpack)
BuildRequires:  pkgconfig(zlib)
%if %{with ffmpeg}
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
%endif
%if %{with mad}
BuildRequires:  pkgconfig(mad)
%endif
%if %{with lame}
BuildRequires:  libmp3lame-devel
%endif
%if %{with amrnb}
BuildRequires:  pkgconfig(opencore-amrnb)
%endif
%if %{with amrwb}
BuildRequires:  pkgconfig(opencore-amrwb)
%endif
%if %{with twolame}
BuildRequires:  pkgconfig(twolame)
%endif
BuildRequires:  libtool
Version:        14.4.0
Release:        0
Summary:        Sound Conversion Tools
License:        LGPL-2.1+ and GPL-2.0+
Group:          Productivity/Multimedia/Sound/Editors and Convertors
Url:            http://sox.sourceforge.net
Source0:        http://downloads.sourceforge.net/project/sox/sox/%{version}/%{name}-%{version}.tar.bz2
#PATCH-FIX-OPENSUSE crrodriguez@opensuse.org linux/glibc specific patch to open all fds with O_CLOEXEC (not suitable for other OS)
Patch0:         sox-14.4.0-ocloexec.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
SOX is intended to be the Swiss Army knife of sound processing tools.
It does many things, it just does not do them all well. Sooner or later
it will come in very handy. SOX is really only usable day-to-day if you
hide the wacky options with one-line shell scripts.

%package -n libsox%{soname}
Summary:        Sound Conversion Library
Group:          System/Libraries

%description -n libsox%{soname}
SOX is intended to be the Swiss Army knife of sound processing tools.
It does many things, it just does not do them all well. Sooner or later
it will come in very handy. SOX is really only usable day-to-day if you
hide the wacky options with one-line shell scripts.

%package devel
Summary:        Sound Conversion Tools and Library
Group:          Development/Libraries/C and C++
Requires:       libsox%{soname} = %{version}

%description devel
SOX is intended to be the Swiss Army knife of sound processing tools.
It does many things, it just does not do them all well. Sooner or later
it will come in very handy. SOX is really only usable day-to-day if you
hide the wacky options with one-line shell scripts.

%prep
%setup -q
%patch0
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" src/sox.h src/libsox.c
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M:%%S')
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/" src/sox.h src/libsox.c

%build
autoreconf -fiv
%configure --without-oss --disable-static --with-distro=openSUSE
make %{?_smp_mflags}

%install
%make_install
rm -f %{buildroot}%{_libdir}/*.la %{buildroot}%{_libdir}/sox/*.la

%post -n libsox%{soname} -p /sbin/ldconfig

%postun -n libsox%{soname} -p /sbin/ldconfig

%files
%defattr(0644,root,root,0755)
%doc AUTHORS COPYING ChangeLog NEWS README src/monkey.wav
%attr(0755,root,root) %{_bindir}/*
%{_mandir}/man1/*
%{_mandir}/man7/*

%files -n libsox%{soname}
%defattr(0644,root,root,0755)
%{_libdir}/libsox.so.%{soname}*

%files devel
%defattr(0644,root,root,0755)
%{_includedir}/*
%{_libdir}/libsox.so
%{_libdir}/pkgconfig/sox.pc
%{_mandir}/man3/libsox.3*

%changelog