-%define version 0.8.8
-%define release 1TL
-Name: SDL
-Version: %{version}
-Release: %{release}
-Group: X11/Libraries
-Copyright: LGPL
-Source: SDL-0.8.8.tar.gz
-Source1: SDL-demos.tar.gz
-URL: http://www.devolution.com/~slouken/projects/SDL
-BuildRoot: /mnt/c/TEMP/SDL-root
-Summary: SDL (Simple DirectMedia Layer) - Game/Multimedia Library
+#
+# Conditional build:
+# bcond_off_alsa - without ALSA support
+# bcond_off_esound - without esound support
+# bcond_off_arts - without arts support
+# bcond_on_svgalib - with svgalib support
+# bcond_on_aalib - with aalib support
+#
+Summary: SDL (Simple DirectMedia Layer) - Game/Multimedia Library
+Summary(pl): SDL (Simple DirectMedia Layer) - Biblioteka do gier/multimediów
+Name: SDL
+Version: 1.2.0
+Release: 1
+License: LGPL
+Group: X11/Libraries
+Group(de): X11/Libraries
+Group(pl): X11/Biblioteki
+Source0: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
+Patch0: SDL-svga.patch
+URL: http://www.libsdl.org/
+%{!?bcond_off_esound:BuildRequires: esound-devel}
+%{!?bcond_off_arts:BuildRequires: arts-devel}
+BuildRequires: gtk+-devel >= 1.2.1
+BuildRequires: XFree86-devel
+BuildRequires: OpenGL-devel
+%ifnarch sparc sparc64
+%{!?bcond_off_alsa:BuildRequires: alsa-lib-devel}
+%endif
+%{?bcond_on_svgalib:BuildRequires: svgalib-devel}
+%{?bcond_on_aalib:BuildRequires: aalib-devel}
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%package devel
-Group: X11/Libraries
-Summary: SDL - Header files & static libraries
-
-%package extras
-Group: X11/Utilities
-Summary: SDL - Test programs and demos
+%define _prefix /usr/X11R6
+%define _mandir %{_prefix}/man
%description
SDL (Simple DirectMedia Layer) is a library that allows you portable,
low level access to a video framebuffer, audio output, mouse, and
-keyboard. It can support both windowed and DGA modes of XFree86, and
+keyboard. It can support both windowed and DGA modes of XFree86, and
it is designed to be portable - applications linked with SDL can also
be built on Win32 and BeOS.
+%description -l pl
+SDL (Simple DirectMedia Layer) jest bibliotek± udostêpniaj±c±
+przeno¶ny, niskopoziomowy dostep do bufora ramki video, wyj¶cia audio,
+myszy oraz klawiatury, Moze obs³ugiwaæ zarówno okienkowy tryb XFree86
+jak i DGA. Konstruuj±c j± miano na uwadze przeno¶no¶æ: aplikacje
+konsolidowane z SDL mo¿na równie¿ budowac w systemach Win32 i BeOS.
+
+%package devel
+Summary: SDL - Header files
+Summary(pl): SDL - Pliki nag³ówkowe
+Group: X11/Libraries
+Group(de): X11/Libraries
+Group(pl): X11/Biblioteki
+Requires: %{name} = %{version}
+
%description devel
-SDL - Header files & static libraries
+SDL - Header files.
-%description extras
-SDL - Test programs and demos
+%description -l pl devel
+SDL - Pliki nag³ówkowe.
+
+%package static
+Summary: SDL - static libraries
+Summary(pl): SDL - biblioteki statyczne
+Group: X11/Libraries
+Group(de): X11/Libraries
+Group(pl): X11/Biblioteki
+Requires: %{name} = %{version}
+
+%description static
+SDL - static libraries.
+
+%description -l pl static
+SDL - biblioteki statyczne.
%prep
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
%setup -q
-tar -xvzf %{SOURCE1}
-chown -R 0.0 *
-make config <<EOF
+%patch -p1
-EOF
%build
-make DEBUG="$RPM_OPT_FLAGS"
-cd test
-make
-cd ..
-cd SDL-demos
-for i in PTC aliens draw fire flxplay maclib mixer plasma scrap screenlib stars ttflib warp xflame; do (cd $i;make SDL=../../);done;
-cd ..
-%install
-mkdir -p $RPM_BUILD_ROOT/usr/bin/SDL
-mkdir -p $RPM_BUILD_ROOT/usr/lib
-mkdir -p $RPM_BUILD_ROOT/usr/include/SDL
-cp -a lib/* $RPM_BUILD_ROOT/usr/lib
-cp -a include/* $RPM_BUILD_ROOT/usr/include/SDL
-for i in checkkeys graywin loopwave pixelformat testalpha testbitmap testhread testkeys testlock testtimer testtypes testver testwin testwm; do cp -a test/$i $RPM_BUILD_ROOT/usr/bin/SDL; done;
-for i in PTC aliens draw fire flxplay maclib mixer netlib plasma scrap screenlib stars ttflib warp xflame; do cp -a SDL-demos/$i $RPM_BUILD_ROOT/usr/bin/sdl; done;
-find $RPM_BUILD_ROOT/usr/bin/SDL -name "*.[hco]" | xargs rm -f
+%configure \
+%ifnarch sparc sparc64
+ %{!?bcond_off_alsa:--enable-alsa} \
+%endif
+ --enable-nasm \
+ --enable-pthreads \
+ --with-x \
+ --enable-video-x11-dga \
+ --enable-video-x11-mtrr \
+ --enable-video-x11-dgamouse \
+ %{!?bcond_off_esound:--enable-esd} \
+ %{!?bcond_off_arts:--enable-arts} \
+ %{?bcond_on_svga:--enable-video-svga} \
+ %{?bcond_on_aalib:--enable-video-aalib}
-%clean
+%install
rm -rf $RPM_BUILD_ROOT
-%post
-/sbin/ldconfig
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT \
+ m4datadir=%{_aclocaldir}
+
+rm -rf docs/man3
-%postun
-/sbin/ldconfig
+gzip -9nf BUGS README WhatsNew
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%clean
+rm -rf $RPM_BUILD_ROOT
%files
-%doc BUGS COPYING INSTALL README TODO WhatsNew docs docs.html
-/usr/lib/libSDLx11.so.0.8
-/usr/lib/libSDLx11.so.0.8.8
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/lib*.so.*.*
%files devel
-/usr/lib/libSDL.a
-/usr/include/SDL
+%defattr(644,root,root,755)
+%doc *gz docs.html docs
+%attr(755,root,root) %{_bindir}/sdl-config
+%attr(755,root,root) %{_libdir}/lib*.so
+%attr(755,root,root) %{_libdir}/lib*.la
+%{_libdir}/libSDLmain.a
+%{_includedir}/SDL
+%{_aclocaldir}/*
+%{_mandir}/man3/*
-%files extras
-/usr/bin/SDL
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/lib*.a