SPECS: tremulous.spec - cleaner build method

sparky sparky at pld-linux.org
Tue Sep 2 21:31:19 CEST 2008


Author: sparky                       Date: Tue Sep  2 19:31:19 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- cleaner build method

---- Files affected:
SPECS:
   tremulous.spec (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: SPECS/tremulous.spec
diff -u SPECS/tremulous.spec:1.9 SPECS/tremulous.spec:1.10
--- SPECS/tremulous.spec:1.9	Tue Mar 13 06:55:55 2007
+++ SPECS/tremulous.spec	Tue Sep  2 21:31:13 2008
@@ -188,36 +188,45 @@
 
 %{__sed} -i -e 's/-Werror//' src/tools/asm/Makefile
 %{__sed} -i -e '/OP_BLOCK_COPY not dword aligned/s#^#//#' src/qcommon/vm_interpreted.c
+%{__sed} -i -e 's/^all:.*/all: makedirs tools targets/' Makefile
+%{__sed} -i -e 's/$(CC)  -o $@/$(CC) -o $@ $(REAL_LDFLAGS)/' Makefile
 
-cat << EOF > Makefile.local
-BUILD_CLIENT	= 1
+%build
+cat << 'EOF' > Makefile.local
+BUILD_CLIENT    = 1
 BUILD_CLIENT_SMP= 1
-BUILD_SERVER	= 1
-BUILD_GAME_SO	= 1
-BUILD_GAME_QVM	= 0
+BUILD_SERVER    = 1
+BUILD_GAME_SO   = 1
+BUILD_GAME_QVM  = 0
 %if !%{with openal}
-USE_OPENAL	= 0
+USE_OPENAL      = 0
 %endif
-EOF
 
-%build
-CFLAGS="%{rpmcflags}"
-CFLAGS="$CFLAGS -DDEFAULT_BASEDIR=\\\"%{_datadir}/games/%{name}\\\""
-CFLAGS="$CFLAGS -DLIBDIR=\\\"%{_libdir}/%{name}\\\""
-CFLAGS="$CFLAGS -Wall -Wimplicit -Wstrict-prototypes"
-CFLAGS="$CFLAGS -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1 $(sdl-config --cflags)"
+override BR = rel
+override B = rel
+
+override CFLAGS := %{rpmcflags} \
+        -DDEFAULT_BASEDIR=\"%{_datadir}/games/%{name}\" \
+        -DLIBDIR=\"%{_libdir}/%{name}\" \
+        -Wall -Wimplicit -Wstrict-prototypes \
+        -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1 %(sdl-config --cflags) \
 %if %{with openal}
-CFLAGS="$CFLAGS -DUSE_OPENAL=1"
+        -DUSE_OPENAL=1 \
 %endif
-CFLAGS="$CFLAGS -DNDEBUG -MMD"
 %ifnarch %{ix86} %{x8664}
-CFLAGS="$CFLAGS -DNO_VM_COMPILED"
-%endif
+        -DNO_VM_COMPILED \
+%endif  
+        -DNDEBUG -MMD
 
-%{__make} makedirs tools targets \
-	B="release-%{_target}"	\
-	CC="%{__cc}"		\
-	CFLAGS="$CFLAGS"
+override LCC_CFLAGS := $(CFLAGS) -MMD
+override Q3ASM_CFLAGS := $(CFLAGS)
+
+REAL_LDFLAGS := %{rpmldflags}
+
+override CC := %{__cc}
+EOF
+
+%{__make} all
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -226,10 +235,10 @@
 	$RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_libdir}/%{name}/base} \
 	$RPM_BUILD_ROOT/var/games/tremulous
 
-install release-%{_target}/%{name}.* $RPM_BUILD_ROOT%{_bindir}/%{name}
-install release-%{_target}/%{name}-smp.* $RPM_BUILD_ROOT%{_bindir}/%{name}-smp
-install release-%{_target}/tremded.* $RPM_BUILD_ROOT%{_bindir}/tremded
-install release-%{_target}/base/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}/base
+install rel/%{name}.* $RPM_BUILD_ROOT%{_bindir}/%{name}
+install rel/%{name}-smp.* $RPM_BUILD_ROOT%{_bindir}/%{name}-smp
+install rel/tremded.* $RPM_BUILD_ROOT%{_bindir}/tremded
+install rel/base/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}/base
 
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/tremded
 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/tremded
@@ -293,6 +302,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.10  2008/09/02 19:31:13  sparky
+- cleaner build method
+
 Revision 1.9  2007/03/13 05:55:55  sparky
 - kill evil in-game warning, slows down the game
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/tremulous.spec?r1=1.9&r2=1.10&f=u



More information about the pld-cvs-commit mailing list