musepack/musepack.spec

108 lines
3.8 KiB
RPMSpec

#
# spec file for package musepack
#
# Copyright (c) 2013 Asterios Dramis <asterios.dramis@gmail.com>.
#
# 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.
%define so_ver 6
Name: musepack
Version: r475
Release: 0
License: BSD-3-Clause and LGPL-2.1+ and GPL-2.0+ and Zlib
Summary: Audio Compression Format
Url: http://www.musepack.net/
Group: Productivity/Multimedia/Other
Source0: http://files.musepack.net/source/%{name}_src_%{version}.tar.gz
# PATCH-FIX-UPSTREAM libmpcdec.patch asterios.dramis@gmail.com -- Fix CMakeLists.txt to install a libmpcdec shared library, fix missing libmpcdec link to libm
Patch0: libmpcdec.patch
BuildRequires: cmake
BuildRequires: libcuefile-devel
BuildRequires: libreplaygain-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Musepack is an audio compression format with a strong emphasis on high quality.
It's not lossless, but it is designed for transparency, so that you won't be
able to hear differences between the original wave file and the much smaller MPC
file.
It is based on the MPEG-1 Layer-2 / MP2 algorithms, but has rapidly developed and
vastly improved and is now at an advanced stage in which it contains heavily
optimized and patentless code.
%package devel
Summary: Development Files for Musepack
Group: Development/Libraries/C and C++
Requires: libmpcdec%{so_ver} = %{version}
Conflicts: libmpcdec-devel
%description devel
This package includes development files for musepack.
%package -n libmpcdec%{so_ver}
Summary: Audio Compression Format
Group: System/Libraries
%description -n libmpcdec%{so_ver}
Musepack is an audio compression format with a strong emphasis on high quality.
It's not lossless, but it is designed for transparency, so that you won't be
able to hear differences between the original wave file and the much smaller MPC
file.
It is based on the MPEG-1 Layer-2 / MP2 algorithms, but has rapidly developed and
vastly improved and is now at an advanced stage in which it contains heavily
optimized and patentless code.
%prep
%setup -q -n %{name}_src_%{version}
%patch0
%build
# Remove build time references so build-compare can do its work
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/" mpc2sv8/mpc2sv8.c mpcchap/mpcchap.c mpccut/mpccut.c mpcdec/mpcdec.c mpcenc/mpcenc.c mpcgain/mpcgain.c
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" mpc2sv8/mpc2sv8.c mpcchap/mpcchap.c mpccut/mpccut.c mpcdec/mpcdec.c mpcenc/mpcenc.c mpcgain/mpcgain.c
# Fix rpmlint warning "version-control-internal-file"
rm -rf include/mpc/.svn/
# Fix rpmlint errors "spurious-executable-perm" and "executable-docs"
chmod 644 libmpcdec/AUTHORS libmpcdec/COPYING libmpcdec/ChangeLog
# Make the package use rpm optflags
sed -i "s/set(CMAKE_C_FLAGS.*$//" CMakeLists.txt
%cmake
make %{?_smp_mflags} VERBOSE=1
%install
%cmake_install
%post -n libmpcdec%{so_ver} -p /sbin/ldconfig
%postun -n libmpcdec%{so_ver} -p /sbin/ldconfig
%files
%{_bindir}/*
%files devel
%doc libmpcdec/AUTHORS libmpcdec/COPYING libmpcdec/ChangeLog
%{_includedir}/mpc/
%{_libdir}/libmpcdec.so
%files -n libmpcdec%{so_ver}
%{_libdir}/libmpcdec.so.%{so_ver}*
%changelog