File libmp3splt.spec of Package libmp3splt

# vim: set ts=4 sw=4 et:
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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 0

Name:           libmp3splt
Version:        0.9.2
Release:        0.pm.1
Summary:        Library to split MP3 and Ogg Files
Source:         http://prdownloads.sourceforge.net/mp3splt/libmp3splt-%{version}.tar.gz
Source99:       libmp3splt-rpmlintrc
URL:            http://mp3splt.sourceforge.net/mp3splt_page/home.php
Group:          System/Libraries
License:        GPL-2.0+
BuildRoot:      %{_tmppath}/build-%{name}-%{version}
BuildRequires:  libogg-devel libvorbis-devel
BuildRequires:  mad-devel libid3tag-devel zlib-devel
BuildRequires:  pcre-devel
BuildRequires:  gcc make glibc-devel pkgconfig
BuildRequires:  autoconf automake libtool
Recommends:     %{name}%{soname}-mp3 = %{version}
Recommends:     %{name}%{soname}-ogg = %{version}

%description
Library to split mp3 and ogg files selecting a begin and an end time position,
without decoding. It's very useful to split large mp3/ogg to make smaller
files or to split entire albums to obtain original tracks.

%package -n %{name}%{soname}
Summary:        Library to split MP3 and Ogg Files
Group:          System/Libraries
Recommends:     %{name}-ogg = %{version}-%{release}
Recommends:     %{name}-mp3 = %{version}-%{release}
Obsoletes:      libmp3splt < %{version}
Provides:       libmp3splt = %{version}
Obsoletes:      libmp3split < %{version}-%{release}
Provides:       libmp3split = %{version}-%{release}

%description -n %{name}%{soname}
Library to split mp3 and ogg files selecting a begin and an end time position,
without decoding. It's very useful to split large mp3/ogg to make smaller
files or to split entire albums to obtain original tracks.

%package -n %{name}%{soname}-mp3
Summary:        MP3 Support Plugin for %{name}
Group:          System/Libraries
Requires:       %{name}%{soname} = %{version}-%{release}
Obsoletes:      libmp3splt-mp3 < %{version}
Provides:       libmp3splt-mp3 = %{version}

%description -n %{name}%{soname}-mp3
%{name} is a ibrary to split mp3 and ogg files selecting a begin and an end
time position, without decoding. It's very useful to split large mp3/ogg to
make smaller files or to split entire albums to obtain original tracks.

This package contains the MP3 support plugin.

%package -n %{name}%{soname}-ogg
Summary:        Ogg Support Plugin for %{name}
Group:          System/Libraries
Requires:       %{name}%{soname} = %{version}-%{release}
Obsoletes:      libmp3splt-ogg < %{version}
Provides:       libmp3splt-ogg = %{version}

%description -n %{name}%{soname}-ogg
%{name} is a ibrary to split mp3 and ogg files selecting a begin and an end
time position, without decoding. It's very useful to split large mp3/ogg to
make smaller files or to split entire albums to obtain original tracks.

This package contains the Ogg/Vorbis support plugin.

%package -n libmp3splt-devel
Summary:        Library to Split MP3 and Ogg Files
Group:          Development/Libraries/C and C++
Requires:       %{name}%{soname} = %{version}-%{release}
Requires:       libogg-devel libvorbis-devel
Requires:       mad-devel libid3tag-devel zlib-devel
Requires:       pcre-devel pkgconfig

%description -n libmp3splt-devel
Library to split mp3 and ogg files selecting a begin and an end time position,
without decoding. It's very useful to split large mp3/ogg to make smaller
files or to split entire albums to obtain original tracks.

%prep
%setup -q -n "libmp3splt-%{version}"
#__sed -ri 's|^(VERSION *= *).*$|\1 %{version}|' po/Makevars

%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"

[ -e ./configure ] || NOCONFIGURE=1 ./autogen.sh

%configure \
    --disable-doxygen_doc \

%__make %{?_smp_flags}

%install
%makeinstall

%__rm -f "%{buildroot}%{_libdir}/libmp3splt".{a,la}

%__rm "%{buildroot}%{_libdir}/libmp3splt%{soname}"/*.a
%__rm "%{buildroot}%{_libdir}/libmp3splt%{soname}"/*.la

pushd "%{buildroot}%{_datadir}/locale"
%__mv fr_FR fr
%__mv de_DE de
popd

%find_lang "libmp3splt%{soname}"

%post   -n libmp3splt%{soname} -p /sbin/ldconfig
%postun -n libmp3splt%{soname} -p /sbin/ldconfig

%clean
%{?buildroot:%__rm -rf "%{buildroot}"}

%files -n %{name}%{soname} -f libmp3splt%{soname}.lang
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%{_libdir}/libmp3splt.so.%{soname}
%{_libdir}/libmp3splt.so.%{soname}.*
%dir %{_libdir}/libmp3splt%{soname}

%files -n %{name}%{soname}-mp3
%defattr(-,root,root)
%{_libdir}/libmp3splt%{soname}/libsplt_mp3.so*

%files -n %{name}%{soname}-ogg
%defattr(-,root,root)
%{_libdir}/libmp3splt%{soname}/libsplt_ogg.so*

%files -n libmp3splt-devel
%defattr(-,root,root)
%{_includedir}/libmp3splt
%{_libdir}/libmp3splt.so
%{_libdir}/pkgconfig/libmp3splt.pc

%changelog