%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

Summary:	The Ogg bitstream file format library.
Name:		libogg
Version:	1.3.0
Release:	1%{?_dist_release}

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

Source:		http://downloads.xiph.org/releases/ogg/%{name}-%{version}.tar.xz

BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires:  perl

Vendor: Project Vine
Distribution: Vine Linux

Packager: kenta, inagaki

%description
Libogg is a library for manipulating Ogg bitstream file formats.
Libogg supports both making Ogg bitstreams and getting packets from
Ogg bitstreams.

%package devel
Summary:	Files needed for development using libogg.
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}

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

# compat32
%package -n compat32-%{name}
Summary:	The Ogg bitstream file format library.
Group:		System Environment/Libraries

%description -n compat32-%{name}
Libogg is a library for manipulating Ogg bitstream file formats.
Libogg supports both making Ogg bitstreams and getting packets from
Ogg bitstreams.

%package -n compat32-%{name}-devel
Summary:	Files needed for development using libogg.
Group:		Development/Libraries
Requires:	compat32-%{name} = %{version}-%{release}
Requires:	%{name}-devel = %{version}-%{release}

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

%prep
%setup -q -n libogg-%{version}

%build
perl -p -i -e "s/-O20/$RPM_OPT_FLAGS/" configure
perl -p -i -e "s/-ffast-math//" configure

%configure --disable-static
make

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

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

%clean 
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%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)
%doc AUTHORS CHANGES COPYING README
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root)
%doc doc/index.html doc/framing.html doc/oggstream.html
%doc doc/white-ogg.png doc/white-xifish.png
%doc doc/stream.png
%doc doc/libogg
%dir %{_includedir}/ogg
%{_includedir}/ogg/*.h
#{_libdir}/*.a
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_datadir}/aclocal/ogg.m4

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%{_libdir}/*.so.*

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

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

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

* Sun Nov 22 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.1.4-1
- new upstream release

* Fri Jun 19 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.1.3-3
- used --disable-static option
- added Vendor, Distribution, Packager tag

* Sat May 16 2009 NAKAMURA Kenta <kenta@vinelinux.org> 1.1.3-2
- added compat32 package for x86_64 arch support
- removed lib*.a files from devel package

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

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

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

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

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

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

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

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

* 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

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

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

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

* Fri Jul  6 2001 Bill Nottingham <notting@redhat.com>
- own %%{_includedir}/ogg

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

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

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

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

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

* Tue Dec 11 2000 Bill Nottingham <notting@redhat.com>
- fix bogus group

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

* Mon Nov 13 2000 Bill Nottingham <notting@redhat.com>
- clean up specfile slightly

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