# Note that this is NOT a relocatable package
%define ver      @VERSION@
%define rel      1
%define prefix   /usr

Summary:   SDL MPEG Library
Name:      smpeg
Version:   %ver
Release:   %rel
Copyright: LGPL
Group:     Libraries
Source0:   @PACKAGE@-%{PACKAGE_VERSION}.tar.gz
URL:       http://www.lokigames.com/development/smpeg.php3
BuildRoot: /tmp/@PACKAGE@-%{PACKAGE_VERSION}-root
Packager:  Sam Lantinga <hercules@lokigames.com>
Docdir: %{prefix}/doc

%description
SMPEG is based on UC Berkeley's mpeg_play software MPEG decoder
and SPLAY, an mpeg audio decoder created by Woo-jae Jung. We have
completed the initial work to wed these two projects in order to 
create a general purpose MPEG video/audio player for the Linux OS. 

%prep

%setup

%build
# Needed for snapshot releases.
if [ ! -f configure ]; then
  CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%prefix --disable-opengl-player
else
  CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix --disable-opengl-player
fi

if [ "$SMP" != "" ]; then
  (make "MAKE=make -k -j $SMP"; exit 0)
  make
else
  make
fi

%install
rm -rf $RPM_BUILD_ROOT

make prefix=$RPM_BUILD_ROOT%{prefix} install

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%files
%defattr(-, root, root)
%doc CHANGES COPYING README
%{prefix}/include/*
%{prefix}/lib/*
%{prefix}/bin/*
%{prefix}/man/*

%changelog

