Name:           xvidcore
Version:        1.0.3
Release:        0.%{mysig}
Summary:        Free reimplementation of the OpenDivX video codec

Group:          System Environment/Libraries
License:        XVID (GPL with specific restrictions)
URL:            http://www.xvid.org/
Source0:        http://files.xvid.org/downloads/xvidcore-%{version}.tar.bz2
Patch0:         %{name}-libperms.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%ifarch %ix86
BuildRequires:  nasm
%endif

%description
Free reimplementation of the OpenDivX video codec. You can play OpenDivX
and DivX4 videos with it, as well as encode compatible files.

%package devel
Summary:        Development files for the XviD video codec
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Obsoletes:      xvidcore-static

%description devel
This package contains header files, static library and API
documentation for the XviD video codec.

# -----------------------------------------------------------------------------

%prep
%setup -q
%patch0 -p0
# Yes, we want to see the build output.
%{__perl} -pi -e 's/^\t@(?!echo\b)/\t/' build/generic/Makefile

# -----------------------------------------------------------------------------

%build
cd build/generic
%configure
make %{?_smp_mflags} 
cd -

# -----------------------------------------------------------------------------

%install
rm -rf $RPM_BUILD_ROOT
%makeinstall -C build/generic

# Fix library version links. They never can get this right, can they?
cd $RPM_BUILD_ROOT%{_libdir}
ln -s libxvidcore.so.4.0 libxvidcore.so.4
ln -s libxvidcore.so.4.0 libxvidcore.so
cd -

# -----------------------------------------------------------------------------

%clean
rm -rf $RPM_BUILD_ROOT

# -----------------------------------------------------------------------------

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%defattr(-, root, root, -)
%doc LICENSE README AUTHORS ChangeLog TODO
%{_libdir}/libxvidcore.so.*

%files devel
%defattr(-, root, root, -)
%doc CodingStyle examples
%{_includedir}/xvid.h
%{_libdir}/libxvidcore.a
%{_libdir}/libxvidcore.so

# -----------------------------------------------------------------------------

%changelog
* Wed Sep 21 2005 Milan Kerslager <kerslage@linux.cz> 1.0.3-0.ker.rhel4
- rebuild for RHEL4 (package from http://rpm.livna.org/fedora/4/i386/SRPMS.lvn)

* Sun Feb 20 2005 Ville Skyttä <ville.skytta at iki.fi> - 0:1.0.3-0.lvn.1
- 1.0.3.

* Wed Sep 29 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:1.0.2-0.lvn.1
- Update to 1.0.2.

* Tue Jun  8 2004 Dams <anvil[AT]livna.org> 0:1.0.1-0.lvn.1
- Updated to 1.0.1

* Mon May 17 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:1.0.0-0.lvn.1
- Updated to 1.0.0.
- Patch to show build output.

* Mon May  3 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:1.0.0-0.lvn.0.2.rc4
- Updated to 1.0.0-rc4.

* Mon Mar 29 2004 Dams <anvil[AT]livna.org> 0:1.0.0-0.lvn.0.2.rc3
- Updated to rc3

* Sat Jan 10 2004 Dams <anvil[AT]livna.org> 0:1.0.0-0.lvn.0.1.beta3
- Updated to 1.0.0-beta3
- Small spec file cleanup

* Sun Sep 28 2003 Dams <anvil[AT]livna.org> 0:0.9.2-0.fdr.1.0.94
- Removed comment after scriptlets

* Fri Aug 15 2003 Marius L. Johndal <mariuslj at ifi.uio.no> 0:0.9.2-0.fdr.1
- Updated to 0.9.2.
- Updated according to current SPEC template.
- Changed to properly versioned .so-files.

* Tue Apr  8 2003 Marius Johndal <mariuslj at ifi.uio.no> 0:0.9.1-0.fdr.3
- Cleaned up the documentation.

* Fri Apr  4 2003 Marius Johndal <mariuslj at ifi.uio.no> 0:0.9.1-0.fdr.2
- Added epoch and release number to requires.

* Wed Apr  2 2003 Marius Johndal <mariuslj at ifi.uio.no> 0:0.9.1-0.fdr.1
- Updated to 0.9.1.

* Wed Apr  2 2003 Marius Johndal <mariuslj at ifi.uio.no> 0:0.9.0-0.fdr.1
- Initial fedora RPM release.
- Changed -static back to -devel as that seems more logic.

* Mon Mar 31 2003 Matthias Saou <matthias.saou@est.une.marmotte.net>
- Rebuilt for Red Hat Linux 9.

* Wed Jan 29 2003 Matthias Saou <matthias.saou@est.une.marmotte.net>
- Fixed the location of the .h files... doh!

* Sun Jan 12 2003 Matthias Saou <matthias.saou@est.une.marmotte.net>
- Remove the decore.h and encore2.h inks as divx4linux 5.01 will provide them.
- Rename -devel to -static as it seems more logic.

* Fri Dec 27 2002 Matthias Saou <matthias.saou@est.une.marmotte.net>
- Initial RPM release.