From b570e3ae7a2af496da4e2e211cc0b1d01cf39fc6 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Jun 18 2015 11:20:37 +0000 Subject: Fix FTBFS with hardening by patching configure to not override the CFLAGS --- diff --git a/CriticalMass-1.5-cflags.patch b/CriticalMass-1.5-cflags.patch new file mode 100644 index 0000000..c2ded8a --- /dev/null +++ b/CriticalMass-1.5-cflags.patch @@ -0,0 +1,34 @@ +diff -up CriticalMass-1.5/configure.in~ CriticalMass-1.5/configure.in +--- CriticalMass-1.5/configure.in~ 2015-06-18 13:08:03.000000000 +0200 ++++ CriticalMass-1.5/configure.in 2015-06-18 13:13:41.589713098 +0200 +@@ -35,29 +35,7 @@ dnl Checks for library functions. + AM_CONDITIONAL(APPLE,test "x$TARGET" = xAPPLE) + AM_CONDITIONAL(WIN32,test "x$TARGET" = xWIN32) + +-CFLAGS="" +-CXXFLAGS="-std=c++0x -DGAME_HAS_HERO_PARTICLE -DUSE_ONLINE_UPDATE" +- +-if test "x$GCC" = xyes; then +- CFLAGS="$CFLAGS -W -Wall" +- CXXFLAGS="$CXXFLAGS -W -Wall" +-fi +- +-AC_ARG_ENABLE(debug, +-[ --enable-debug Enable debugging [default=off]], +- enable_debug=$enableval, enable_debug=off) +-if test "x$enable_debug" = xyes; then +- CFLAGS="$CFLAGS -g" +- CXXFLAGS="$CXXFLAGS -g" +-fi +- +-AC_ARG_ENABLE(optimize, +-[ --enable-optimize=level Enable optimization [default=2]], +- enable_optmize=$enableval, enable_optimize=2) +-if test "x$enable_optimize" != "xno" ; then +- CFLAGS="$CFLAGS -O$enable_optimize" +- CXXFLAGS="$CXXFLAGS -O$enable_optimize" +-fi ++CXXFLAGS="$CXXFLAGS -std=c++0x -DGAME_HAS_HERO_PARTICLE" + + AC_ARG_ENABLE(dyngl, + [ --enable-dyngl Load GL library dynamically [default=off]], diff --git a/CriticalMass.spec b/CriticalMass.spec index fae4931..c5e1c86 100644 --- a/CriticalMass.spec +++ b/CriticalMass.spec @@ -1,6 +1,6 @@ Name: CriticalMass Version: 1.5 -Release: 14%{?dist} +Release: 15%{?dist} Summary: SDL/OpenGL space shoot'em up game also known as critter Group: Amusements/Games License: GPLv2+ @@ -10,8 +10,9 @@ Source1: %{name}.desktop Patch0: CriticalMass-1.0.2-res-change-rh566533.patch Patch1: CriticalMass-1.5-libpng15.patch Patch2: CriticalMass-1.5-gcc47.patch +Patch3: CriticalMass-1.5-cflags.patch BuildRequires: SDL_image-devel SDL_mixer-devel libpng-devel curl-devel -BuildRequires: tinyxml-devel desktop-file-utils +BuildRequires: tinyxml-devel desktop-file-utils libtool Requires: hicolor-icon-theme opengl-games-utils # Also known as critter, so make "yum install critter" work Provides: critter = %{version}-%{release} @@ -29,16 +30,15 @@ a tiny spacecraft and sent after them. %patch0 -p1 %patch1 -p1 %patch2 -p1 -sed -i 's/curl-gnutls/curl/g' configure +%patch3 -p1 +sed -i 's/curl-gnutls/curl/g' configure.in +touch NEWS README AUTHORS ChangeLog +autoreconf -ivf %build %configure -# ./configure doesn't properly pick up our CFLAGS, and we need to override -# the CFLAGS anyways, so as to not define USE_ONLINE_UPDATE, to stop critter -# from phoning home -CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE=1 -D_REENTRANT -DGAME_HAS_HERO_PARTICLE -I/usr/include/SDL" -make CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS -std=c++0x" +make %{?_smp_mflags} %install @@ -50,12 +50,7 @@ rm $RPM_BUILD_ROOT%{_bindir}/Packer # below is the desktop file and icon stuff. mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -desktop-file-install \ -%if 0%{?fedora} && 0%{?fedora} < 19 - --vendor fedora \ -%endif - --dir $RPM_BUILD_ROOT%{_datadir}/applications \ - %{SOURCE1} +desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE1} mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/256x256/apps install -p -m 644 critter.png \ $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/256x256/apps @@ -123,6 +118,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/icons/hicolor/256x256/apps/critter.png %changelog +* Thu Jun 18 2015 Hans de Goede - 1.5-15 +- Fix FTBFS with hardening by patching configure to not override the CFLAGS + * Tue Jun 16 2015 Fedora Release Engineering - 1.5-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild