%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
%define liboggver 1.3.2
%define epoch_num 1

Summary:	The Vorbis General Audio Compression Codec.
Summary(ja):	Vorbis - 汎用オーディオ圧縮コーデック
Name:		libvorbis
Version:	1.3.6
Release:	1%{?_dist_release}
Epoch:          %{epoch_num}

Group:		System Environment/Libraries
License:	BSD
URL:		https://www.xiph.org/

Source:		http://downloads.xiph.org/releases/vorbis/%{name}-%{version}.tar.xz
Patch0:		libvorbis-1.3.6-git.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires:	libogg-devel >= %{liboggver}
BuildRequires:  perl

Vendor:		Project Vine
Distribution:	Vine Linux

%description
Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free,
general-purpose compressed audio format for audio and music at fixed
and variable bitrates from 16 to 128 kbps/channel.

The libvorbis package contains runtime libraries for use in programs
that support Ogg Voribs.

%description -l ja
Ogg Vorbis は完全にオープンで、知的財産権による制約、特許やロイヤリティ
と関係ない汎用のオーディオ圧縮フォーマットで、チャンネルあたり 16〜128
kbps の固定/可変ビットレートのオーディオや音楽用です。

このパッケージには、Ogg Vorbis をサポートするプログラムで使われるランタ
イムライブラリが含まれています。

%package devel
Summary:	Development files for Vorbis applications.
Summary(ja):	Vorbis アプリケーションの開発用ファイル
Group:		Development/Libraries
Requires:	%{name} = %{epoch_num}:%{version}-%{release}
Requires:	libogg-devel >= %{liboggver}

%description devel
The libvorbis-devel package contains the header files, static libraries
and documentation needed to develop applications with libvorbis.

%description -l ja devel
このパッケージには、libvorbis を使ったアプリケーションの開発に必要な
ヘッダファイル、静的ライブラリ、及びドキュメントが含まれています。

# compat32
%package -n compat32-%{name}
Summary:	The Vorbis General Audio Compression Codec.
Summary(ja):	Vorbis - 汎用オーディオ圧縮コーデック
Group:		System Environment/Libraries

%description -n compat32-%{name}
Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free,
general-purpose compressed audio format for audio and music at fixed
and variable bitrates from 16 to 128 kbps/channel.

The libvorbis package contains runtime libraries for use in programs
that support Ogg Voribs.

%description -n compat32-%{name} -l ja
Ogg Vorbis は完全にオープンで、知的財産権による制約、特許やロイヤリティ
と関係ない汎用のオーディオ圧縮フォーマットで、チャンネルあたり 16〜128
kbps の固定/可変ビットレートのオーディオや音楽用です。

このパッケージには、Ogg Vorbis をサポートするプログラムで使われるランタ
イムライブラリが含まれています。

%package -n compat32-%{name}-devel
Summary:	Development files for Vorbis applications.
Summary(ja):	Vorbis アプリケーションの開発用ファイル
Group:		Development/Libraries
Requires:	compat32-%{name} = %{epoch_num}:%{version}-%{release}
Requires:	compat32-libogg-devel >= %{liboggver}

%description -n compat32-%{name}-devel
The libvorbis-devel package contains the header files, static libraries
and documentation needed to develop applications with libvorbis.

%description -n compat32-%{name}-devel -l ja
このパッケージには、libvorbis を使ったアプリケーションの開発に必要な
ヘッダファイル、静的ライブラリ、及びドキュメントが含まれています。

%prep
%setup -q
%patch0 -p1

perl -p -i -e "s/-O20/%{optflags}/" configure
perl -p -i -e "s/-ffast-math//" configure

%build
%configure --with-ogg-libraries=%{_libdir} --disable-static
make %{?_smp_mflags}

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
make DESTDIR=%{buildroot} install

#rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post -n compat32-%{name} -p /sbin/ldconfig

%postun -n compat32-%{name} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%license COPYING
%doc AUTHORS README todo.txt
%{_libdir}/*.so.*

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

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root)
%{_libdir}/*.so.*

%files -n compat32-%{name}-devel
%defattr(-,root,root)
%{_libdir}/*.so
%endif

%changelog
* Mon Feb 17 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.3.6-1
- new upstream release.
- imported Patch0 from rawhide.

* Sat May 16 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.3.5-1
- new upstream release

* Sat Jul 05 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.3.4-1
- new upstream release

* Sun Jun 10 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.3.3-1
- new upstream release

* Tue Sep 21 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.3.1-1
- new upstream release
- built with rpm-4.8.1

* Sun Nov 22 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.2.3-1
- new upstream release
- dropped Patch2-7 (merged into upstream)

* Wed Aug 12 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.2.0-9
- add patch7 to fix CVE-2009-2663 (OGG Processing) from fc10

* Sun Jun 28 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.2.0-8
- fix compat32-devel Require tag (adding epoch)

* Sun Jun 28 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.2.0-7
- rollback to 1.2.0 because of pulseaudio lockup issue
- add Epoch 1
- patch2-6 are added again

* Wed Jun 24 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.2.2-1
- new upstream release
- drop old patches

* Fri Jun 19 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.2.0-6
- used --disable-static option

* Sun May 10 2009 NAKAMURA Kenta <kenta@vinelinux.org> 1.2.0-5
- added compat32 package for x86_64 arch support
- removed lib*.a from devel package

* Wed Oct 15 2008 Shu KONNO <owa@bg.wakwak.com> 1.2.0-4vl5
- spec in utf-8

* Sun Jun 15 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.2.0-3vl5
- added Patches for security fix based on VinePlus 1.2.0-3vl4
  * Sat Jun 07 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 1.2.0-3vl4
  - add patch2,6 for additional hardening/sanity checks
  - add patch3 for CVE-2008-1420
  - add patch4 for CVE-2008-1419
  - add patch5 for CVE-2008-1423

* Mon May 19 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.2.0-1
- applied new versioning policy
- removed lib*.la from devel package

* Fri Aug 17 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.2.0-0vl4
- fixed include file location

* Tue Aug  7 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.2.0-0vl3
- rebuild for VineSeed

* Tue Aug  7 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.2.0-0vl2
- rebuild for Vine Linux 4.1

* Tue Aug  7 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.2.0-0vl1
- new upstream release (CVE-2007-3106, CVE-2007-4029)

* Mon May 14 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.2-0vl2
- rebuild with new toolchain

* Tue Nov 29 2005 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.1.2-0vl1
- source upgrade

* Fri Jul 01 2005 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.1.1-0vl1
- source upgrade
- add Japanese summary and description

* Fri Oct 01 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.1.0-0vl1
- source upgrade
- update source-URL

* Fri Mar 26 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.1-0vl3
- rebuild

* Sat Nov 22 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.1-0vl2
- rebuild for VineSeedPlus

* Fri Nov 21 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.1-0vl1
- source upgrade
- build for VinePlus/2.6
- add %%{_libdir}/*.la and %%{_libdir}/pkgconfig/*.pc to devel package
- disable %%configure script

* Sat Oct  4 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0-0vl3
- rebuild with new toolchains
- use License tag

* Sun Dec 15 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0-0vl2
- rebuild with new toolchains

* Wed Jul 24 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0-0vl1
- source upgrade
- update %description devel
- add PreReq: ldconfig
- delete Patch

* Sat Jan 12 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 0.99.3-1vl1
- build for VineSeed
- change version number to 0.99.3 (means 1.0rc3)

* Tue Jan  1 2002 Bill Nottingham <notting@redhat.com>
- update to 1.0rc3

* Thu Aug 16 2001 Bill Nottingham <notting@redhat.com>
- fix bug in floor backend (<michael@stroucken.org>)

* Mon Aug 13 2001 Bill Nottingham <notting@redhat.com>
- update to 1.0rc2

* Fri Jul 20 2001 Bill Nottingham <notting@redhat.com>
- split out from the main vorbis package

* Tue Jul 10 2001 Bill Nottingham <notting@redhat.com>
- own %%{_libdir}/ao
- I love libtool

* Tue Jun 26 2001 Florian La Roche <Florian.LaRoche@redhat.de>
- add links from library major version numbers in rpms

* Tue Jun 19 2001 Bill Nottingham <notting@redhat.com>
- update to rc1

* Fri May  4 2001 Oliver Paukstadt <oliver.paukstadt@millenux.com>
- fixed perl line in spec file to set optims correctly

* Tue Mar 20 2001 Bill Nottingham <notting@redhat.com>
- fix alpha/ia64, again
- use optflags, not -O20 -ffast-math (especially on alpha...)

* Mon Feb 26 2001 Bill Nottingham <notting@redhat.com>
- fix license tag

* Mon Feb 26 2001 Bill Nottingham <notting@redhat.com>
- beta4

* Fri Feb  9 2001 Bill Nottingham <notting@redhat.com>
- fix alpha/ia64

* Thu Feb  8 2001 Bill Nottingham <notting@redhat.com>
- update CVS in prep for beta4

* Wed Feb 07 2001 Philipp Knirsch <pknirsch@redhat.de>
- Fixed bugzilla bug #25391. ogg123 now usses the OSS driver by default if
  none was specified.

* Tue Jan  9 2001 Bill Nottingham <notting@redhat.com>
- update CVS, grab aRts backend for libao

* Wed Dec 27 2000 Bill Nottingham <notting@redhat.com>
- update CVS

* Fri Dec 01 2000 Bill Nottingham <notting@redhat.com>
- rebuild because of broken fileutils

* Mon Nov 13 2000 Bill Nottingham <notting@redhat.com>
- hack up specfile some, merge some packages

* Sat Oct 21 2000 Jack Moffitt <jack@icecast.org>
- initial spec file created