From 984d6a82530abc7c183de9b66bb71da2afeb94c6 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Mon, 27 Feb 2017 19:00:41 +0100 Subject: [PATCH] specfile: build process updated * using %autosetup now (added 'BuildRequires: git') * no longer switching to base/ dir for building purposes * using %configure macro instead of manually invoking ./configure --- gmp.spec | 41 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/gmp.spec b/gmp.spec index 13cb5e1..f3a15a0 100644 --- a/gmp.spec +++ b/gmp.spec @@ -18,6 +18,7 @@ License: LGPLv3+ or GPLv2+ Group: System Environment/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf automake libtool +BuildRequires: git #autoreconf on arm needs: BuildRequires: perl-Carp @@ -67,8 +68,7 @@ The static libraries for using the GNU MP arbitrary precision library in applications. %prep -%setup -q -%patch2 -p1 -b .debuginfo +%autosetup -S git # switch the defaults to new cpus on s390x %ifarch s390x @@ -82,43 +82,21 @@ if as --help | grep -q execstack; then export CCAS="gcc -c -Wa,--noexecstack" fi -# Dummy invocation to initialization CFLAGS etc. -%global _configure : -%configure +%configure --enable-cxx -mkdir base -cd base -ln -s ../configure . %ifarch %{ix86} -export CFLAGS=$(echo $CFLAGS | sed -e "s/-mtune=[^ ]*//g" | sed -e "s/-march=[^ ]*//g")"-g -march=i686" -export CXXFLAGS=$(echo $CXXFLAGS | sed -e "s/-mtune=[^ ]*//g" | sed -e "s/-march=[^ ]*//g")"-g -march=i686" + export CFLAGS=$(echo $CFLAGS | sed -e "s/-mtune=[^ ]*//g" | sed -e "s/-march=[^ ]*//g")"-march=i686" + export CXXFLAGS=$(echo $CXXFLAGS | sed -e "s/-mtune=[^ ]*//g" | sed -e "s/-march=[^ ]*//g")"-march=i686" %endif -./configure --enable-fat --build=%{_build} --host=%{_host} \ - --program-prefix=%{?_program_prefix} \ - --prefix=%{_prefix} \ - --exec-prefix=%{_exec_prefix} \ - --bindir=%{_bindir} \ - --sbindir=%{_sbindir} \ - --sysconfdir=%{_sysconfdir} \ - --datadir=%{_datadir} \ - --includedir=%{_includedir} \ - --libdir=%{_libdir} \ - --libexecdir=%{_libexecdir} \ - --localstatedir=%{_localstatedir} \ - --sharedstatedir=%{_sharedstatedir} \ - --mandir=%{_mandir} \ - --infodir=%{_infodir} \ - --enable-cxx + sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ -e 's|-lstdc++ -lm|-lstdc++|' \ -i libtool export LD_LIBRARY_PATH=`pwd`/.libs make %{?_smp_mflags} -cd .. %install -cd base export LD_LIBRARY_PATH=`pwd`/.libs make install DESTDIR=$RPM_BUILD_ROOT install -m 644 gmp-mparam.h ${RPM_BUILD_ROOT}%{_includedir} @@ -126,7 +104,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/lib{gmp,mp,gmpxx}.la rm -f $RPM_BUILD_ROOT%{_infodir}/dir /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir} ln -sf libgmpxx.so.4 $RPM_BUILD_ROOT%{_libdir}/libgmpxx.so -cd .. # Rename gmp.h to gmp-.h and gmp-mparam.h to gmp-mparam-.h to # avoid file conflicts on multilib systems and install wrapper include files @@ -154,10 +131,8 @@ install -m644 %{SOURCE3} %{buildroot}/%{_includedir}/gmp-mparam.h %check %ifnarch ppc -cd base export LD_LIBRARY_PATH=`pwd`/.libs make %{?_smp_mflags} check -cd .. %endif %post -p /sbin/ldconfig @@ -206,8 +181,8 @@ exit 0 %changelog * Fri Feb 17 2017 David Kaspar [Dee'Kej] - 1:6.1.2-3 -- Explicitly added '-g' option into CFLAGS & CXXFLAGS to correctly build .debug_info for i386 -- Build flags modified so the build system no longer drops LDFLAGS hardening flags +- Build process updated to correctly build .debug_info for i386 + and to correctly use hardening flags * Fri Feb 10 2017 Fedora Release Engineering - 1:6.1.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild