File aacgain.spec of Package aacgain
#
# spec file for package aacgain
#
# Copyright (c) 2018 SUSE LINUX 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/
#
%global mp3gain_folder mp3gain
%global faad_folder faad2-2.7
%global mp4v2_folder mp4v2-trunk-r355
Name: aacgain
Version: 1.9.0
Release: 0
Summary: AAC Volume Normalizer based on Replay Gain
License: GPL-2.0 and GPL-2.0+ and LGPL-2.1+
Group: Productivity/Multimedia/Sound/Editors and Convertors
Url: http://%{name}.altosdesign.com/
Source0: %{mp3gain_folder}-%{name}-%{version}.tar.xz
Source1: %{faad_folder}.tar.xz
Source2: %{mp4v2_folder}.tar.xz
Patch0: %{name}-prepare.patch
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: libtool
%description
AACGain is a modification to Glen Sawyer's excellent MP3Gain program. It supports AAC (mp4/m4a/QuickTime) audio files in addition to MP3 files. AACGain normalizes the volume of digital music files using the Replay Gain algorithm. It works by modifying the global_gain fields in the aac samples. Free-form metadata tags are added to the file to save undo information, making the normalization process reversable. AACGain uses the same command-line user interface as MP3Gain.
%prep
%setup -q -T -b 0 -n %{mp3gain_folder}
%setup -q -b 1 -n %{faad_folder}
%setup -q -b 2 -n %{mp4v2_folder}
cd %{_builddir}
%{__ln_s} ../%{faad_folder} %{mp3gain_folder}/$(echo %{faad_folder} | cut -d- -f1)
%{__ln_s} ../%{mp4v2_folder} %{mp3gain_folder}/$(echo %{mp4v2_folder} | cut -d- -f1)
%patch0
%{__chmod} +x %{mp3gain_folder}/%{name}/linux/prepare.sh
%build
CFLAGS="${CFLAGS:-%{optflags}} -fabi-version=2 -fno-strict-aliasing"
CXXFLAGS="${CXXFLAGS:-%{optflags}} -std=gnu++03"
export CFLAGS CXXFLAGS
%configure
%{__make} %{?_smp_mflags}
cd %{_builddir}/%{faad_folder}
%configure
cd libfaad
%{__make} %{?_smp_mflags}
cd %{_builddir}/%{mp3gain_folder}/%{name}/linux
./prepare.sh
%{__mkdir_p} build
cd build
../../../configure
%{__make} %{?_smp_mflags}
%{__strip} -s %{name}/%{name}
%install
%{__mkdir_p} %{buildroot}%{_bindir}
%{__mkdir_p} %{buildroot}%{_defaultdocdir}/%{name}
%{__install} -m 0755 -p -t %{buildroot}%{_bindir} %{_builddir}/%{mp3gain_folder}/%{name}/linux/build/%{name}/%{name}
%{__install} -m 0644 -p -t %{buildroot}%{_defaultdocdir}/%{name} %{_builddir}/%{mp3gain_folder}/%{name}/COPYING \
%{_builddir}/%{mp3gain_folder}/%{name}/README \
%{_builddir}/%{mp3gain_folder}/%{name}/linux/README.linux
%files
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/%{name}
%{_defaultdocdir}/%{name}/
%changelog