From 52d2c3fa8a31a696ef56debf31b5f6757c2fac93 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Wed, 18 Jul 2001 16:20:11 +0000 Subject: [PATCH] - build SDL version too (can be run on svgalib, FB, etc.) - moved {mus,snd}serv to private lib directory (possible conflict with other dooms/heretics etc.) - WADDIR = /usr/X11R6/share/doomlegacy (/usr/X11R6/share/games doesn't exist) - fixed more paths in sources - don't require /dev/sndstat in musserv (kernel 2.4 doesn't have it) - fixed builddir (objs dir was not cleaned) Changed files: doomlegacy-nosndstat.patch -> 1.1 doomlegacy-paths.patch -> 1.3 doomlegacy.spec -> 1.2 --- doomlegacy-nosndstat.patch | 26 +++++++++ doomlegacy-paths.patch | 67 ++++++++++++++++++++--- doomlegacy.spec | 105 ++++++++++++++++++++++++++++++------- 3 files changed, 172 insertions(+), 26 deletions(-) create mode 100644 doomlegacy-nosndstat.patch diff --git a/doomlegacy-nosndstat.patch b/doomlegacy-nosndstat.patch new file mode 100644 index 0000000..2afb015 --- /dev/null +++ b/doomlegacy-nosndstat.patch @@ -0,0 +1,26 @@ +--- doomlegacy-1.32/doomlegacy/linux_x/musserv/sequencer.c.orig Fri May 11 14:55:27 2001 ++++ doomlegacy-1.32/doomlegacy/linux_x/musserv/sequencer.c Wed Jul 18 17:26:02 2001 +@@ -176,11 +176,7 @@ + seq_dev = num_fm; + + sndstat = fopen("/dev/sndstat", "r"); +- if (sndstat == NULL) +- { +- printf("musserver: could not open /dev/sndstat, exiting.\n"); +- exit(1); +- } ++ if (sndstat != NULL) { + fgets(sndver, 100, sndstat); + for (x = 0; x < strlen(sndver); x++) + if (sndver[x] == '-') +@@ -198,7 +194,9 @@ + } + voxdate = atoi(snddate); + fclose(sndstat); +- ++ } else { ++ voxdate = 0; /* kernel 2.4 doesn't have sndstat */ ++ } + voices = malloc(sinfo[seq_dev].nr_voices * sizeof(struct synth_voice)); + for (x = 0; x < sinfo[seq_dev].nr_voices; x++) + { diff --git a/doomlegacy-paths.patch b/doomlegacy-paths.patch index 63b6a22..79ea756 100644 --- a/doomlegacy-paths.patch +++ b/doomlegacy-paths.patch @@ -1,16 +1,16 @@ ---- 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(); @@ -24,7 +24,62 @@ - 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) { diff --git a/doomlegacy.spec b/doomlegacy.spec index 5f31e53..c09f0b4 100644 --- a/doomlegacy.spec +++ b/doomlegacy.spec @@ -1,4 +1,4 @@ -Summary: DOOM Legacy for Linux X-Windows and Mesa +Summary: DOOM Legacy for Linux Name: doomlegacy Version: 1.32 Release: 1.beta1 @@ -6,42 +6,107 @@ Source0: http://prdownloads.sourceforge.net/doomlegacy/legacy_132beta1_src.tar.g 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 -- 2.43.0