Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 08f7f62ad8debca71f444a3272b26be1 > files > 5

gcc3.3-3.3.6-16.mga7.src.rpm

%define _default_patch_fuzz 2
%global debug_package %nil

%define branch			3.3
%define branch_tag		%(perl -e 'printf "%%02d%%02d", split(/\\./,shift)' %{branch})
%define release			%mkrel 16
%define biarches		x86_64

%define hammer_branch		1
%define hammer_date		20050117

%define _unpackaged_files_terminate_build 0

# Define libraries major versions
%define libstdcxx_major		5
%define libstdcxx_minor		7

%define target_cpu		%{_target_cpu}
%define package_suffix		%{branch}
%define program_prefix		%{nil}
%define program_suffix		-%{version}
%define _package_suffix		-%{package_suffix}

%define source_package		gcc-%{version}
%define source_dir		gcc-%{version}

%define arch			%(echo %{_target_cpu}|sed -e "s/i.86/i386/" -e "s/athlon/i386/" -e "s/amd64/x86_64/")
%define gcc_target_platform	%{_target_platform}
%define target_prefix		%{_prefix}
%define target_libdir		%{_libdir}

# We now have versioned libstdcxx_includedir, that is c++/<VERSION>/
%define libstdcxx_includedir	%{target_prefix}/include/c++/%{version}

# Define library packages names
%define libstdcxx_name_orig	libstdc++
%define libstdcxx_name		%{libstdcxx_name_orig}%{libstdcxx_major}

Summary:	GNU Compiler Collection
Name:		gcc%{package_suffix}
Version:	3.3.6
Release:	%{release}
License:	GPL
Group:		Development/C

# Main source:	(CVS)
URL:		http://gcc.gnu.org/
Source0:	%{source_package}.tar.bz2
# FIXME: unless we get proper help2man package
Source6:	gcc33-help2man.pl.bz2

# CVS patches
Patch1: gcc33-hammer-%{hammer_date}.patch
Patch2: gcc33-mdkoptions.patch
Patch3: gcc33-pr11536-testcase.patch
Patch4: gcc33-pr9929-testcase.patch
Patch5: gcc33-gcse-volatile.patch

# MDK patches
Patch101: gcc33-pass-slibdir.patch
Patch102: gcc31-c++-diagnostic-no-line-wrapping.patch
Patch103: gcc32-pr7434-testcase.patch
Patch104: gcc33-pr8213-testcase.patch
Patch106: gcc33-x86_64-biarch-testsuite.patch
Patch107: gcc33-i386-mtune.patch
Patch111: gcc33-multi-do-libdir.patch
Patch114: gcc32-mklibgcc-serialize-crtfiles.patch
Patch115: gcc33-c++-classfn-member-template.patch
Patch119: gcc33-pr11631.patch
Patch120: gcc33-pr13179.patch
Patch121: gcc33-no-store-motion.patch
Patch122: gcc33-linux32.patch

# Red Hat patches
Patch200: gcc33-2.96-RH-compat.patch
Patch201: gcc33-fde-merge-compat.patch
Patch202: gcc33-debug-pr7241.patch
Patch205: gcc33-dwarf2-dtprel.patch
Patch206: gcc33-trunc_int_for_mode.patch
Patch209: gcc33-inline-label.patch
Patch210: gcc33-ia64-symbol_ref_flags.patch
Patch211: gcc33-cse-tweak.patch
Patch212: gcc33-tls-direct-segment-addressing.patch
Patch213: gcc33-pie.patch
Patch216: gcc33-pr6794.patch
Patch219: gcc33-rhl-testsuite.patch
Patch220: gcc33-libgcc34.patch

# openSUSE patches
# from https://build.opensuse.org/package/show?package=gcc33&project=openSUSE%3AFactory
Patch300: bison-errors.patch
# (blino) edited to drop rs600 part
Patch301: gcc-unwind-glibc216.patch

Patch400: bison3.patch
Patch401: ucontext.patch

BuildRequires:	binutils >= 2.14.90.0.5-1mdk
BuildRequires:	zlib-devel
BuildRequires:	gettext
BuildRequires:	flex
BuildRequires:	bison
BuildRequires:	texinfo >= 4.1
BuildRequires:	glibc-devel >= 2.2.5-14mdk
# The point of this package today is to provide libstdc++5 for old binaries
# This is only needed on x86
ExclusiveArch:  %{ix86} x86_64

%description
A compiler aimed at integrating all the optimizations and features
necessary for a high-performance and stable development environment.
This package is required for all other GCC compilers, namely C++,
Fortran 77, Objective C and Java.

If you have multiple versions of GCC installed on your system, it is
preferred to type "gcc-$(gcc%{branch}-version)" (without double quotes) in
order to use the GNU C compiler version %{version}.

####################################################################
# C++ Libraries

%package -n %{libstdcxx_name}
Summary:	GNU C++ library
Group:		System/Libraries
Obsoletes:	%{libstdcxx_name_orig}%{branch}
Provides:	%{libstdcxx_name_orig}%{branch} = %{version}-%{release}
Provides:	%{libstdcxx_name_orig} = %{version}-%{release}
# By default, the libstdc++ from gcc3.3 is ABI compatible with the one
# from gcc3.2. Just tell other packages about it if they relied on that.
Provides:	%{libstdcxx_name_orig}3.2 = %{version}-%{release}

%description -n %{libstdcxx_name}
This package contains the GCC Standard C++ Library v3, an ongoing
project to implement the ISO/IEC 14882:1998 Standard C++ library.

This is an old version of libstdc++ provided only for compatibility
with old proprietary binaries that cannot be recompiled against
a modern version.

%prep
%setup -q -n %{source_dir}
%if %{hammer_branch}
%patch1 -p1 -E
%patch2 -p1 -b .mdkoptions
%endif
%patch3 -p1 -b .pr11536-testcase
%patch4 -p1 -b .pr9929-testcase
%patch5 -p1 -b .gcse-volatile

# MDK patches
%patch101 -p1 -b .pass-slibdir
%patch102 -p1 -b .c++-diagnostic-no-line-wrapping
%patch103 -p1 -b .pr7434-testcase
%patch104 -p1 -b .pr8213-testcase
%patch106 -p1 -b .x86_64-biarch-testsuite
%patch107 -p1 -b .i386-mtune
%patch111 -p1 -b .multi-do-libdir
%patch114 -p1 -b .mklibgcc-serialize-crtfiles
%patch115 -p1 -b .c++-classfn-member-template
%patch119 -p1 -b .pr11631-testcase
%patch120 -p1 -b .pr13179
%patch121 -p1 -b .no-store-motion
%patch122 -p1 -b .linux32

# Red Hat patches
%patch200 -p0 -b .2.96-RH-compat
%patch201 -p0 -b .fde-merge-compat
%patch202 -p0 -b .debug-pr7241
%patch205 -p1 -b .dwarf2-dtprel
%patch206 -p1 -b .trunc_int_for_mode
%patch209 -p0 -b .inline-label
%patch210 -p1 -b .ia64-symbol_ref_flags
%patch211 -p1 -b .cse-tweak
#%patch212 -p1 -b .tls-direct-segment-addressing
%patch213 -p1 -b .pie
%patch216 -p1 -b .pr6794
%patch219 -p1 -b .rhl-testsuite
%patch220 -p0 -b .libgcc34

# openSUSE patches
%patch300 -p0 -b .bison
%patch301 -p1 -b .unwind

%patch400 -p1 -b .bison3
%patch401 -p1 -b .ucontext

# Mageiafication for bug reports
perl -pi -e "/bug_report_url/ and s/\"[^\"]+\"/\"<URL:https:\/\/bugs.mageia.org\/>\"/;" \
         -e '/version_string/ and s/([0-9]*(\.[0-9]*){1,3}).*(\";)$/\1 \(Mageia %{version}-%{release}\)\3/;' \
         gcc/version.c

sed -i s/enable_abi_check=yes/enable_abi_check=no/ libstdc++-v3/configure


%build
# Force a seperate object dir
rm -fr obj-%{gcc_target_platform}
mkdir obj-%{gcc_target_platform}
cd obj-%{gcc_target_platform}

# FIXME: extra tools needed
mkdir -p bin
bzcat %{SOURCE6} >bin/help2man
export PATH=$PATH:$PWD/bin

# Make bootstrap-lean
CC=gcc

# Prepare OPT_FLAGS
OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-mcpu=pentiumpro//g' -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' -e 's/-fstack-protector//g' -e 's/--param=ssp-buffer-size=4//g' -e 's/-mtune=generic//g' -e 's/-Werror=format-security//g'`

OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-fomit-frame-pointer//g'`
LANGUAGES="c++"
PROGRAM_SUFFIX="--program-suffix=%{program_suffix}"
LIBSTDCXX_V3_FLAGS="--enable-long-long --enable-__cxa_atexit --enable-clocale=gnu"
CC="$CC" CFLAGS="$OPT_FLAGS" CXXFLAGS="$OPT_FLAGS" XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \
	../configure --prefix=%{_prefix} --libdir=%{_libdir} --with-slibdir=/%{_lib} \
	--mandir=%{_mandir} --infodir=%{_infodir} \
	--enable-shared --enable-threads=posix --disable-checking $LIBSTDCXX_V3_FLAGS \
	--enable-languages="$LANGUAGES" $PROGRAM_SUFFIX \
	--host=%{_target_platform} $CROSS_FLAGS \
	--with-system-zlib
touch ../gcc/c-gperf.h
%make bootstrap-lean

# Make protoize
make -C gcc CC="./xgcc -B ./ -O2" proto
cd ..

%install
# Fix HTML docs for libstdc++-v3
perl -pi -e \
  's~href="l(ibstdc|atest)~href="http://gcc.gnu.org/onlinedocs/libstdc++/l\1~' \
  libstdc++-v3/docs/html/documentation.html
ln -sf documentation.html libstdc++-v3/docs/html/index.html
find libstdc++-v3/docs/html -name CVS | xargs rm -rf

# Create some directories, just to make sure (e.g. ColorGCC)
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_mandir}
mkdir -p $RPM_BUILD_ROOT%{_infodir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}

pushd obj-%{gcc_target_platform};
  %makeinstall slibdir=$RPM_BUILD_ROOT/%{_lib}
popd

FULLVER=`$RPM_BUILD_ROOT%{_bindir}/%{gcc_target_platform}-gcc%{program_suffix} --version | head -n 1 | cut -d' ' -f3`
FULLPATH=$(dirname $RPM_BUILD_ROOT%{_libdir}/gcc-lib/%{gcc_target_platform}/%{version}/cc1)

rm -f $RPM_BUILD_ROOT%{_infodir}/dir

# First, move 32-bit libraries to the right directories
%ifarch %{biarches}
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
mv $RPM_BUILD_ROOT%{_libdir}/32/* $RPM_BUILD_ROOT%{_prefix}/lib
rm -rf $RPM_BUILD_ROOT%{_libdir}/32
ln -sf ../lib $RPM_BUILD_ROOT%{_libdir}/32

mkdir -p $RPM_BUILD_ROOT/lib
rm -rf $RPM_BUILD_ROOT/%{_lib}/32
ln -sf ../lib $RPM_BUILD_ROOT/%{_lib}/32
%endif

# Dispatch libraries to the right directories
DispatchLibs() {
	libname=$1 libversion=$2
	rm -f $libname.so $libname.a
	ln -s ../../../$crosslibdir/$libname.so.$libversion $libname.so
	rm -f ../../../$crosslibdir/$libname.so
	rm -f ../../../$crosslibdir/$libname.a
	%ifarch %{biarches}
	[ -d 32 ] || mkdir 32
	pushd 32
	mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
	ln -s ../../../../32/$libname.so.$libversion $libname.so
	rm -f ../../../../32/$libname.so
	popd
	%endif
}
pushd $FULLPATH
	DispatchLibs libstdc++	%{libstdcxx_major}.0.%{libstdcxx_minor}
popd

# Move <cxxabi.h> to compiler-specific directories
mv $RPM_BUILD_ROOT%{libstdcxx_includedir}/cxxabi.h $FULLPATH/include/

#chmod -x $RPM_BUILD_ROOT%{target_libdir}/libstdc++.so*
%ifarch %{biarches}
#chmod -x $RPM_BUILD_ROOT%{_prefix}/lib/libstdc++.so*
%endif

%files -n %{libstdcxx_name}
%{target_libdir}/libstdc++.so.%{libstdcxx_major}
%{target_libdir}/libstdc++.so.%{libstdcxx_major}.0.%{libstdcxx_minor}
%ifarch %{biarches}
%{_prefix}/lib/libstdc++.so.%{libstdcxx_major}
%{_prefix}/lib/libstdc++.so.%{libstdcxx_major}.0.%{libstdcxx_minor}
%endif


%changelog
* Thu Oct 11 2018 pterjan <pterjan> 3.3.6-16.mga7
+ Revision: 1319710
- Disable debug package
- Drop everything except for libstdc++
+ umeabot <umeabot>
- Mageia 7 Mass Rebuild

* Tue Jul 03 2018 pterjan <pterjan> 3.3.6-15.mga7
+ Revision: 1241487
- Hack to not build abi_check as it fails to build but we don't run the tests anyway
- Fix build with recent glibc
- Butcher down the spec to remove everything we don't build anymore or conditionals for 15 years old distros, which is the vast majority

* Thu Oct 20 2016 pterjan <pterjan> 3.3.6-15.mga6
+ Revision: 1062566
- Disable the slow tests, we ignore the result anyway

* Fri Mar 04 2016 pterjan <pterjan> 3.3.6-14.mga6
+ Revision: 985479
- Restrict to x86

* Fri Mar 04 2016 pterjan <pterjan> 3.3.6-13.mga6
+ Revision: 985391
- Do not run __cputoolize, libtool rejects version mix
+ umeabot <umeabot>
- Mageia 6 Mass Rebuild

* Mon Aug 24 2015 blino <blino> 3.3.6-12.mga6
+ Revision: 869023
- rebuild to get back mistakenly removed libstdc++5 packages

* Wed Oct 15 2014 umeabot <umeabot> 3.3.6-11.mga5
+ Revision: 744841
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 3.3.6-10.mga5
+ Revision: 679435
- Mageia 5 Mass Rebuild

* Wed Dec 25 2013 pterjan <pterjan> 3.3.6-9.mga4
+ Revision: 560662
- Fix build with recent bison
+ umeabot <umeabot>
- Mageia 4 Mass Rebuild

* Sat May 04 2013 anssi <anssi> 3.3.6-8.mga3
+ Revision: 412286
- fix conflicts between gcc3.3-cpp and gcc-cpp due to usrmove

* Mon Apr 08 2013 blino <blino> 3.3.6-7.mga3
+ Revision: 409073
- disable tools build (keep cc and cxx)
- remove -Werror=format-security from flags to fix stdc++ configure
- add patches from openSUSE to fix build
- remove build_cc flag (it should be fine with pending patches)

* Mon Apr 08 2013 blino <blino> 3.3.6-6.mga3
+ Revision: 409045
- disable tools build
- add build_cc flag
- use mkrel
- increase default patch fuzz
- imported package gcc3.3