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

Summary: Theora video compression codec
Summary(ja): Theora 映像圧縮コーデック
Name: libtheora
Version: 1.1.1
Release: 6%{?_dist_release}
Group: system
Vendor: Project Vine
Distribution: Vine Linux

License: BSD
URL: https://www.theora.org/
Source: http://downloads.xiph.org/releases/theora/libtheora-%{version}.tar.bz2
Patch0: libtheora-1.1.1-dso.patch
Patch1: libtheora-libpng16.patch
Patch2: libtheora-1.1.1-fix-pp_sharp_mod-calc.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: libogg-devel >= 1.1
BuildRequires: libvorbis-devel >= 1.0.1
BuildRequires: SDL2-devel
# Seems like a devel package forgot to include this one (ogg? vorbis? SDL?)
#BuildRequires: alsa-lib-devel

%description
Ogg Theora is a fully open, non-proprietary, patent-and-royalty-free,
general-purpose compressed video format.


%package devel
Summary: Headers for developing programs that will use libtheora
Summary(ja): libtheora の開発用ファイル
Group: programming
Requires: %{name} = %{version}-%{release}
Requires: libogg-devel >= 1.1

%description devel
This package contains the headers that programmers will need to develop
applications which will use %{name}.


# compat32
%package -n compat32-%{name}
Summary: Theora video compression codec
Summary(ja): Theora 映像圧縮コーデック
Group: system,legacy
Requires: %{name} = %{version}-%{release}

%description -n compat32-%{name}
Ogg Theora is a fully open, non-proprietary, patent-and-royalty-free,
general-purpose compressed video format.

%package -n compat32-%{name}-devel
Summary: Headers for developing programs that will use libtheora
Summary(ja): libtheora の開発用ファイル
Group: programming,legacy
Requires: compat32-%{name} = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}
Requires: compat32-libogg-devel >= 1.1

%description -n compat32-%{name}-devel
This package contains the headers that programmers will need to develop
applications which will use %{name}.


%debug_package


%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1


%build
%configure --disable-static
make %{?_smp_mflags}


%install
rm -rf %{buildroot} installed-docs
make install DESTDIR=%{buildroot}
mv %{buildroot}%{_datadir}/doc/libtheora* installed-docs
# Fix the location of the include file
#mkdir -p %{buildroot}%{_includedir}/theora
#mv %{buildroot}%{_includedir}/theora.h %{buildroot}%{_includedir}/theora/

# remove unpackage files
rm -f $RPM_BUILD_ROOT%{_libdir}/libtheora*.la


%files
%defattr(-, root, root, 0755)
%doc README COPYING
%{_libdir}/libtheora*.so.*

%files devel
%defattr(-, root, root, 0755)
%doc installed-docs/*
%{_includedir}/theora
%{_libdir}/libtheora*.so
%{_libdir}/pkgconfig/*.pc

# 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
* Sat Jul 06 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.1.1-6
- rebuilt with current environment.

* Mon May 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.1.1-5
- imported Patch1 from upstream.

* Sat Jul 05 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.1-4
- rebuild with VineSeed environment
- add Patch0 (libtheora-1.1.1-dso.patch)

* Wed Jan 11 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.1-3
- create compat32 sub packages

* Tue Sep 21 2010 IWAI, Masaharu <iwai@alib.jp> 1.1.1-2
- build with rpm-4.8.1-1 for pkg-config file

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

* Thu Nov 06 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-1
- new upstream release

* Sat Apr  5 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0-0.beta2.1vl5
- new upstream relase

* Fri Sep 29 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0-0.alpha7vl1
- new upstream relase

* Sat Sep 24 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0-0.alpha5vl1
- new upstream relase

* Thu Mar 17 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0-0.alpha4vl1
- new upstream relase
- added Japanese summary

* Sun Sep  5 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0-0.alpha3vl1
- Build for Vine 

* Wed May 19 2004 Matthias Saou <http://freshrpms.net/> 1.0-0.alpha3.1
- Initial RPM release, only devel as there is only a static lib for now.

