---- doomlegacy/linux_x/i_video_xshm.c.orig Fri May 11 14:54:59 2001
-+++ doomlegacy/linux_x/i_video_xshm.c Sat Jun 30 10:55:58 2001
+--- doomlegacy-1.32/doomlegacy/linux_x/i_video_xshm.c.orig Fri May 11 14:54:59 2001
++++ doomlegacy-1.32/doomlegacy/linux_x/i_video_xshm.c Sat Jun 30 10:55:58 2001
@@ -1896,7 +1896,7 @@
rendermode = render_opengl;
//dlptr = dlopen("./r_opengl.so",RTLD_LAZY);
- dlptr = dlopen("./r_opengl.so",RTLD_NOW | RTLD_GLOBAL);
-+ dlptr = dlopen("/usr/X11R6/lib/doom/r_opengl.so",RTLD_NOW | RTLD_GLOBAL);
++ dlptr = dlopen("/usr/X11R6/lib/doomlegacy/r_opengl.so",RTLD_NOW | RTLD_GLOBAL);
if(!dlptr) {
fprintf(stderr,"Error opening r_opengl.so!\n%s\n",dlerror());
rendermode = render_soft;
---- doomlegacy/d_main.c.orig Fri May 11 14:33:54 2001
-+++ doomlegacy/d_main.c Sat Jun 30 10:54:48 2001
+--- doomlegacy-1.32/doomlegacy/d_main.c.orig Fri May 11 14:33:54 2001
++++ doomlegacy-1.32/doomlegacy/d_main.c Sat Jun 30 10:54:48 2001
@@ -979,15 +979,7 @@
// change to the directory where 'doom3.wad' is found
I_LocateWad();
- else
- doomwaddir = ".";
- }
-+ doomwaddir = getenv("DOOMWADDIR") ? getenv("DOOMWADDIR") : "/usr/X11R6/share/games/doom";
++ doomwaddir = getenv("DOOMWADDIR") ? getenv("DOOMWADDIR") : "/usr/X11R6/share/doomlegacy";
#ifdef __MACOS__
// cwd is always "/" when app is dbl-clicked
+--- doomlegacy-1.32/doomlegacy/linux_x/i_system.c.orig Fri May 11 14:54:58 2001
++++ doomlegacy-1.32/doomlegacy/linux_x/i_system.c Wed Jul 18 15:33:51 2001
+@@ -119,10 +119,10 @@
+ extern int eventtail;
+
+ // Locations for searching the doom3.wad
+-#define DEFAULTWADLOCATION1 "/usr/local/games/legacy"
+-#define DEFAULTWADLOCATION2 "/usr/games/legacy"
+-#define DEFAULTSEARCHPATH1 "/usr/local"
+-#define DEFAULTSEARCHPATH2 "/usr/games"
++#define DEFAULTWADLOCATION1 "/usr/X11R6/share/doomlegacy"
++#define DEFAULTWADLOCATION2 "/usr/share/games/doomlegacy"
++#define DEFAULTSEARCHPATH1 "/usr/share/games"
++#define DEFAULTSEARCHPATH2 "/usr/X11R6/share"
+ #define WADKEYWORD "doom3.wad"
+
+ // holds wad path
+--- doomlegacy-1.32/doomlegacy/linux_x/musserv/musserver.c.orig Fri May 11 14:55:26 2001
++++ doomlegacy-1.32/doomlegacy/linux_x/musserv/musserver.c Wed Jul 18 15:35:53 2001
+@@ -122,9 +122,7 @@
+ ppid = getpid();
+ if (verbose > 1)
+ printf("pid %d %s\n", ppid, pproc);
+- waddir = getenv("DOOMWADDIR");
+- if (waddir == NULL)
+- waddir = ".";
++ waddir = getenv("DOOMWADDIR") ? getenv("DOOMWADDIR") : "/usr/X11R6/share/doomlegacy";
+
+ while ((x = getopt(argc, argv, "acd:fhi:lmt:u:Vv")) != -1)
+ switch (x)
+--- doomlegacy-1.32/doomlegacy/linux_x/musserv/readwad.c.orig Fri May 11 14:55:27 2001
++++ doomlegacy-1.32/doomlegacy/linux_x/musserv/readwad.c Wed Jul 18 15:37:09 2001
+@@ -213,7 +213,7 @@
+ FILE *fp;
+
+ if (!(waddir = getenv("DOOMWADDIR")))
+- waddir = ".";
++ waddir = "/usr/X11R6/share/doomlegacy";
+
+ wadfilename = malloc(2 + strlen(s) + strlen(waddir));
+ if (*s != '/')
+--- doomlegacy-1.32/doomlegacy/linux_x/searchp.c.orig Fri May 11 14:54:59 2001
++++ doomlegacy-1.32/doomlegacy/linux_x/searchp.c Wed Jul 18 15:46:11 2001
+@@ -23,6 +23,11 @@
+ struct stat s;
+ char pb[2048];
+
++ strcpy(b,"/usr/X11R6/lib/doomlegacy/");
++ strcat(b,file);
++ if (stat(b, &s) == 0) {
++ return(b);
++ }
+ /* get PATH, if not set just return filename, might be in cwd */
+ /* added "./" for current path 19990416 by Kin */
+ if ((path = getenv("PATH")) == NULL) {
-Summary: DOOM Legacy for Linux X-Windows and Mesa
+Summary: DOOM Legacy for Linux
Name: doomlegacy
Version: 1.32
Release: 1.beta1
Source1: http://prdownloads.sourceforge.net/doomlegacy/doom3_wad_132.zip
Patch0: %{name}-paths.patch
Patch1: %{name}-Makefile.patch
+Patch2: %{name}-nosndstat.patch
License: GPL, perhaps except for doom3.wad
-Group: Amusements/Games
+Group: Applications/Games
+Group(de): Applikationen/Spiele
+Group(pl): Aplikacje/Gry
+BuildRequires: XFree86-devel
+BuildRequires: OpenGL-devel
+BuildRequires: SDL_mixer-devel
+BuildRequires: nasm
+BuildRequires: unzip
Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _prefix /usr/X11R6
+%define _prefix /usr/X11R6
+%define debugcflags -O1 -g
+%define _noautoreqdep libGL.so.1 libGLU.so.1
%description
-This is Doom Legacy for Linux X11 and Mesa.
+
+%package common
+Summary: DOOM Legacy for Linux - common files
+Summary(pl): DOOM Legacy dla Linuksa - pliki wspólne
+Group: X11/Applications/Games
+Group(de): X11/Applikationen/Spiele
+Group(pl): X11/Aplikacje/Gry
+
+%description common
+Common files for both versions of DOOM Legacy.
+
+%description common -l pl
+Pliki wspólne dla obu wersji DOOM Legacy.
+
+%package x11
+Summary: DOOM Legacy for Linux - X Window and OpenGL version
+Summary(pl): DOOM Legacy dla Linuksa - wersja korzystaj±ca z X Window i OpenGL
+Group: X11/Applications/Games
+Group(de): X11/Applikationen/Spiele
+Group(pl): X11/Aplikacje/Gry
+Requires: OpenGL
+
+%description x11
+This is DOOM Legacy for Linux - X11 and OpenGL version.
+
+%description x11 -l pl
+To jest DOOM Legacy dla Linuksa - wersja korzystaj±ca z X Window i
+OpenGL.
+
+%package sdl
+Summary: DOOM Legacy for Linux - SDL version
+Summary(pl): DOOM Legacy dla Linuksa - wersja korzystaj±ca z SDL
+Group: X11/Applications/Games
+Group(de): X11/Applikationen/Spiele
+Group(pl): X11/Aplikacje/Gry
+Requires: OpenGL
+
+%description sdl
+This is DOOM Legacy for Linux - SDL version.
+
+%description sdl -l pl
+To jest DOOM Legacy dla Linuksa - wersja SDL.
%prep
-%setup -q -n doomlegacy -a 1
+%setup -q -c -a 1
%patch0 -p1
-%patch1 -p1
+%patch1 -p0
+%patch2 -p1
%build
-install -d {,linux_x/{musserv,sndesrv}/}{objs,bin}
-%{__make} PGCC=1 LINUX=1 OPTFLAGS="%{!?debug:%{rpmcflags}} %{?debug:-O1 -g}"
+install -d doomlegacy/linux_x/{musserv,sndserv}/{objs,bin}
+%{__make} -C doomlegacy PGCC=1 LINUX=1 OPTFLAGS="%{rpmcflags}"
+%{__make} -C doomlegacy clean LINUX=1
+%{__make} -C doomlegacy PGCC=1 LINUX=1 SDL=1 OPTFLAGS="%{rpmcflags}"
%install
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/doom,%{_datadir}/games/doom}
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/doomlegacy,%{_datadir}/doomlegacy}
-install ../bin/llxdoom $RPM_BUILD_ROOT%{_bindir}
-install linux_x/sndserv/linux/llsndserv $RPM_BUILD_ROOT%{_bindir}
-install linux_x/musserv/linux/musserver $RPM_BUILD_ROOT%{_bindir}
-install ../bin/r_opengl.so $RPM_BUILD_ROOT%{_libdir}/doom
+install bin/llxdoom $RPM_BUILD_ROOT%{_bindir}
+install bin/lsdldoom $RPM_BUILD_ROOT%{_bindir}
+install doomlegacy/linux_x/sndserv/linux/llsndserv $RPM_BUILD_ROOT%{_libdir}/doomlegacy
+install doomlegacy/linux_x/musserv/linux/musserver $RPM_BUILD_ROOT%{_libdir}/doomlegacy
+install bin/r_opengl.so $RPM_BUILD_ROOT%{_libdir}/doomlegacy
-install doom3.wad $RPM_BUILD_ROOT%{_datadir}/games/doom
+install doom3.wad $RPM_BUILD_ROOT%{_datadir}/doomlegacy
-gzip -9nf _doc/*.txt
+gzip -9nf doomlegacy/_doc/*.txt
%clean
rm -rf ${RPM_BUILD_ROOT}
-%files
+%files common
+%defattr(644,root,root,755)
+%doc doomlegacy/_doc/*.txt.gz
+%dir %{_libdir}/doomlegacy
+%attr(755,root,root) %{_libdir}/doomlegacy/*serv*
+%{_datadir}/doomlegacy
+
+%files x11
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/llxdoom
+%attr(755,root,root) %{_libdir}/doomlegacy/r_opengl.so
+
+%files sdl
%defattr(644,root,root,755)
-%doc _doc/*.txt.gz
-%attr(755,root,root) %{_bindir}/*
-%attr(755,root,root) %{_libdir}/*
-%{_datadir}/games/doom/doom3.wad
+%attr(755,root,root) %{_bindir}/lsdldoom