diff --git a/gpsd-linkflags.patch b/gpsd-linkflags.patch new file mode 100644 index 0000000..7bef9a1 --- /dev/null +++ b/gpsd-linkflags.patch @@ -0,0 +1,30 @@ +commit 0583730e98906f9c779f8705138adb2572d305c2 +Author: Miroslav Lichvar +Date: Fri Nov 22 18:19:40 2013 +0100 + + Allow multiple options in LINKFLAGS. + + Signed-off-by: Eric S. Raymond + +diff --git a/SConstruct b/SConstruct +index b7627e7..4332fe4 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -239,7 +239,7 @@ env['PYTHON'] = sys.executable + env['STRIP'] = "strip" + env['PKG_CONFIG'] = "pkg-config" + env['CHRPATH'] = 'chrpath' +-for i in ["AR", "ARFLAGS", "CCFLAGS", "CFLAGS", "CC", "CXX", "CXXFLAGS", "STRIP", "PKG_CONFIG", "CHRPATH", "LD", "TAR"]: ++for i in ["AR", "ARFLAGS", "CCFLAGS", "CFLAGS", "CC", "CXX", "CXXFLAGS", "LINKFLAGS", "STRIP", "PKG_CONFIG", "CHRPATH", "LD", "TAR"]: + if os.environ.has_key(i): + j = i + if i == "LD": +@@ -248,7 +248,7 @@ for i in ["AR", "ARFLAGS", "CCFLAGS", "CFLAGS", "CC", "CXX", "CXXFLAGS", "STRIP" + env.Replace(**{j: Split(os.getenv(i))}) + else: + env.Replace(**{j: os.getenv(i)}) +-for flag in ["LDFLAGS", "LINKFLAGS", "SHLINKFLAGS", "CPPFLAGS"]: ++for flag in ["LDFLAGS", "SHLINKFLAGS", "CPPFLAGS"]: + if os.environ.has_key(flag): + env.MergeFlags({flag : [os.getenv(flag)]}) + diff --git a/gpsd.spec b/gpsd.spec index 9b36937..8e411aa 100644 --- a/gpsd.spec +++ b/gpsd.spec @@ -1,3 +1,5 @@ +%global _hardened_build 1 + Name: gpsd Version: 3.10 Release: 2%{?dist} @@ -11,6 +13,8 @@ Source10: gpsd.service Source11: gpsd.sysconfig # PPS seems to be working without cap_sys_time Patch1: gpsd-nolibcap.patch +# allow multiple options in LINKFLAGS +Patch2: gpsd-linkflags.patch BuildRequires: dbus-devel dbus-glib-devel ncurses-devel xmlto python-devel BuildRequires: scons desktop-file-utils bluez-libs-devel pps-tools-devel @@ -74,9 +78,11 @@ can run on a serial terminal or terminal emulator. %prep %setup -q %patch1 -p1 -b .nolibcap +%patch2 -p1 -b .linkflags %build export CCFLAGS="%{optflags}" +export LINKFLAGS="%{__global_ldflags}" # breaks with %{_smp_mflags} scons \ dbus=yes \ @@ -99,6 +105,7 @@ scons \ %install # avoid rebuilding export CCFLAGS="%{optflags}" +export LINKFLAGS="%{__global_ldflags}" DESTDIR=%{buildroot} scons install # service files