File flac.spec of Package flac

#
# spec file for package flac
#
# Copyright (c) 2012 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/
#


Name:           flac
BuildRequires:  gcc-c++
BuildRequires:  libogg-devel
BuildRequires:  libtool
BuildRequires:  pkg-config
%ifarch %{ix86}
BuildRequires:  nasm
%endif
# bug437293
%ifarch ppc64
Obsoletes:      flac-64bit
%endif
Version:        1.2.1
Release:        0
#
Summary:        Free Lossless Audio Codec
License:        BSD-3-Clause
Group:          Productivity/Multimedia/Sound/Utilities
Url:            http://flac.sourceforge.net/
Source:         %{name}-%{version}.tar.bz2
Source2:        baselibs.conf
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch0:         flac-no-xmms.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1:         flac-printf-format-fix.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch2:         flac-gcc43-fixes.diff
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch3:         flac-1.2.1-asm.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch4:         flac-1.2.1-bitreader.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch5:         flac-ocloexec.patch
Patch6:         flac-visibility.patch
Patch7:         flac-leaks.patch
Patch8:         flac-disable-hidden-visibility-for-ppc.patch
# PATCH-FIX-UPSTREAM flac-gcc47.patch dimstar@opensuse.org -- Fix build with gcc 4.7
Patch9:         flac-gcc47.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
FLAC is an open source lossless audio codec developed by Josh Coalson.

%package -n libFLAC8
Summary:        Free Lossless Audio Codec Library
Group:          System/Libraries
Obsoletes:      libflac <= %{version}
Provides:       libflac = %{version}

%description -n libFLAC8
This package contains the library for FLAC (Free Lossless Audio Codec)
developed by Josh Coalson.

%package -n libFLAC++6
Summary:        Free Lossless Audio Codec Library
Group:          System/Libraries

%description -n libFLAC++6
This package contains the C++ library for FLAC (Free Lossless Audio
Codec) developed by Josh Coalson.

%package devel
Summary:        FLAC Library Development Package
Group:          Development/Libraries/C and C++
Requires:       glibc-devel
Requires:       libFLAC++6 = %{version}
Requires:       libFLAC8 = %{version}
Requires:       libstdc++-devel

%description devel
This package contains the files needed to compile programs that use the
FLAC library.

%prep
%setup -q
%patch0
%patch1
%patch2
%patch3 -p1
%patch4
%patch5
%patch6
%patch7
%ifarch ppc ppc64
%patch8 -p1
%endif
%patch9 -p1

%build
autoreconf --force --install
%define warn_flags -O3 -W -Wall -Wstrict-prototypes -Wformat-security
export CFLAGS="%{optflags} %{warn_flags}"
export CXXFLAGS="$CFLAGS"
%configure  --disable-thorough-tests --disable-exhaustive-tests\
    --disable-xmms-plugin \
	--disable-static \
	--disable-rpath \
	--with-pic \
    --enable-sse

make %{?_smp_mflags}

%install
%make_install
# documents
mkdir -p %{buildroot}%{_docdir}
mv %{buildroot}%{_datadir}/doc/%{name}-%{version} %{buildroot}%{_docdir}/%{name}
cp -a AUTHORS README COPYING.* %{buildroot}%{_docdir}/%{name}

%post -n libFLAC8 -p /sbin/ldconfig

%postun -n libFLAC8 -p /sbin/ldconfig

%post -n libFLAC++6 -p /sbin/ldconfig

%postun -n libFLAC++6 -p /sbin/ldconfig

%files
%defattr(-, root, root)
%doc %{_docdir}/%{name}
%{_bindir}/*
%{_mandir}/man*/*

%files -n libFLAC8
%defattr(-, root, root)
%{_libdir}/libFLAC.so.8*

%files -n libFLAC++6
%defattr(-, root, root)
%{_libdir}/libFLAC++.so.6*

%files devel
%defattr(-, root, root)
%{_libdir}/lib*.so
%{_includedir}/*
%{_libdir}/pkgconfig/*.pc
%{_datadir}/aclocal/*.m4
%exclude %{_libdir}/lib*.la

%changelog
openSUSE Build Service is sponsored by