6e17d9
%define releasedate 20130314
6e17d9
%define major 4
6e17d9
%define minor 1
6e17d9
%define update 3
6e17d9
%define dotver %{major}.%{minor}
6e17d9
%define sourcebasename tbb%{major}%{minor}_%{releasedate}oss
6e17d9
6e17d9
%define sourcefilename %{sourcebasename}_src.tgz
6e17d9
6e17d9
Summary: The Threading Building Blocks library abstracts low-level threading details
6e17d9
Name: tbb
6e17d9
Version: %{dotver}
9617f0
Release: 5.%{releasedate}%{?dist}
6e17d9
License: GPLv2 with exceptions
6e17d9
Group: Development/Tools
6e17d9
URL: http://threadingbuildingblocks.org/
6e17d9
Source0: http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130314oss_src.tgz
6e17d9
6e17d9
# These two are downstream sources.
6e17d9
Source6: tbb.pc
6e17d9
Source7: tbbmalloc.pc
6e17d9
Source8: tbbmalloc_proxy.pc
6e17d9
6e17d9
# Propagate CXXFLAGS variable into flags used when compiling C++.
6e17d9
# This so that RPM_OPT_FLAGS are respected.
6e17d9
Patch1: tbb-3.0-cxxflags.patch
6e17d9
6e17d9
# Replace mfence with xchg (for 32-bit builds only) so that TBB
6e17d9
# compiles and works supported hardware.  mfence was added with SSE2,
6e17d9
# which we still don't assume.
6e17d9
Patch2: tbb-4.0-mfence.patch
6e17d9
6e17d9
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
6e17d9
BuildRequires: libstdc++-devel
6e17d9
ExclusiveArch: %{ix86} x86_64 ia64 ppc ppc64 %{arm}
6e17d9
6e17d9
%description
6e17d9
Threading Building Blocks (TBB) is a C++ runtime library that
6e17d9
abstracts the low-level threading details necessary for optimal
6e17d9
multi-core performance.  It uses common C++ templates and coding style
6e17d9
to eliminate tedious threading implementation work.
6e17d9
6e17d9
TBB requires fewer lines of code to achieve parallelism than other
6e17d9
threading models.  The applications you write are portable across
6e17d9
platforms.  Since the library is also inherently scalable, no code
6e17d9
maintenance is required as more processor cores become available.
6e17d9
6e17d9
6e17d9
%package devel
6e17d9
Summary: The Threading Building Blocks C++ headers and shared development libraries
6e17d9
Group: Development/Libraries
6e17d9
Requires: %{name}%{?_isa} = %{version}-%{release}
6e17d9
6e17d9
%description devel
6e17d9
Header files and shared object symlinks for the Threading Building
6e17d9
Blocks (TBB) C++ libraries.
6e17d9
6e17d9
6e17d9
%package doc
6e17d9
Summary: The Threading Building Blocks documentation
6e17d9
Group: Documentation
6e17d9
6e17d9
%description doc
6e17d9
PDF documentation for the user of the Threading Building Block (TBB)
6e17d9
C++ library.
6e17d9
6e17d9
6e17d9
%prep
6e17d9
%setup -q -n %{sourcebasename}
6e17d9
%patch1 -p1
6e17d9
%patch2 -p1
6e17d9
6e17d9
%build
6e17d9
make %{?_smp_mflags} CXXFLAGS="$RPM_OPT_FLAGS" tbb_build_prefix=obj
6e17d9
for file in %{SOURCE6} %{SOURCE7} %{SOURCE8}; do
6e17d9
    sed 's/_FEDORA_VERSION/%{major}.%{minor}.%{update}/' ${file} \
6e17d9
        > $(basename ${file})
6e17d9
done
6e17d9
6e17d9
%install
6e17d9
rm -rf $RPM_BUILD_ROOT
6e17d9
mkdir -p $RPM_BUILD_ROOT/%{_libdir}
6e17d9
mkdir -p $RPM_BUILD_ROOT/%{_includedir}
6e17d9
6e17d9
pushd build/obj_release
6e17d9
    for file in libtbb{,malloc{,_proxy}}; do
6e17d9
        install -p -D -m 755 ${file}.so.2 $RPM_BUILD_ROOT/%{_libdir}
6e17d9
        ln -s $file.so.2 $RPM_BUILD_ROOT/%{_libdir}/$file.so
6e17d9
    done
6e17d9
popd
6e17d9
6e17d9
pushd include
6e17d9
    find tbb -type f ! -name \*.htm\* -exec \
6e17d9
        install -p -D -m 644 {} $RPM_BUILD_ROOT/%{_includedir}/{} \
6e17d9
    \;
6e17d9
popd
6e17d9
6e17d9
for file in %{SOURCE6} %{SOURCE7} %{SOURCE8}; do
6e17d9
    install -p -D -m 644 $(basename ${file}) \
6e17d9
	$RPM_BUILD_ROOT/%{_libdir}/pkgconfig/$(basename ${file})
6e17d9
done
6e17d9
6e17d9
%post -p /sbin/ldconfig
6e17d9
6e17d9
%postun -p /sbin/ldconfig
6e17d9
6e17d9
%clean
6e17d9
rm -rf ${RPM_BUILD_ROOT}
6e17d9
6e17d9
%files
6e17d9
%defattr(-,root,root,-)
6e17d9
%doc COPYING doc/Release_Notes.txt
6e17d9
%{_libdir}/*.so.2
6e17d9
6e17d9
%files devel
6e17d9
%defattr(-,root,root,-)
6e17d9
%doc CHANGES
6e17d9
%{_includedir}/tbb
6e17d9
%{_libdir}/*.so
6e17d9
%{_libdir}/pkgconfig/*.pc
6e17d9
6e17d9
%files doc
6e17d9
%defattr(-,root,root,-)
6e17d9
%doc doc/Release_Notes.txt
6e17d9
%doc doc/html
6e17d9
6e17d9
%changelog
9617f0
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 4.1-5.20130314
9617f0
- Mass rebuild 2013-12-27
9617f0
6e17d9
* Thu Oct  3 2013 Petr Machata <pmachata@redhat.com> - 4.1-4.20130314
6e17d9
- Fix %%install to also install include files that are not named *.h
6e17d9
6e17d9
* Tue May 28 2013 Petr Machata <pmachata@redhat.com> - 4.1-3.20130314
6e17d9
- Enable ARM arches
6e17d9
6e17d9
* Wed May 22 2013 Petr Machata <pmachata@redhat.com> - 4.1-2.20130314
6e17d9
- Fix mfence patch.  Since the __TBB_full_memory_fence macro was
6e17d9
  function-call-like, it stole () intended for function invocation.
6e17d9
6e17d9
* Wed May 22 2013 Petr Machata <pmachata@redhat.com> - 4.1-1.20130314
6e17d9
- Rebase to 4.1 update 3
6e17d9
6e17d9
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-7.20120408
6e17d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
6e17d9
6e17d9
* Tue Aug 28 2012 Petr Machata <pmachata@redhat.com> - 4.0-6.20120408
6e17d9
- Fix build on PowerPC
6e17d9
6e17d9
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-5.20120408
6e17d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
6e17d9
6e17d9
* Thu Jun  7 2012 Petr Machata <pmachata@redhat.com> - 4.0-4.20120408
6e17d9
- Rebase to 4.0 update 4
6e17d9
- Refresh Getting_Started.pdf, Reference.pdf, Tutorial.pdf
6e17d9
- Provide pkg-config files
6e17d9
- Resolves: #825402
6e17d9
6e17d9
* Thu Apr 05 2012 Karsten Hopp <karsten@redhat.com> 4.0-3.20110809
6e17d9
- tbb builds now on PPC(64)
6e17d9
6e17d9
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-2.20110809
6e17d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
6e17d9
6e17d9
* Tue Oct 18 2011 Petr Machata <pmachata@redhat.com> - 4.0-1.20110809
6e17d9
- Rebase to 4.0
6e17d9
  - Port the mfence patch
6e17d9
  - Refresh the documentation bundle
6e17d9
6e17d9
* Tue Jul 26 2011 Petr Machata <pmachata@redhat.com> - 3.0-1.20110419
6e17d9
- Rebase to 3.0-r6
6e17d9
  - Port both patches
6e17d9
  - Package Design_Patterns.pdf
6e17d9
  - Thanks to Richard Shaw for initial rebase patch
6e17d9
- Resolves: #723043
6e17d9
6e17d9
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2-3.20090809
6e17d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
6e17d9
6e17d9
* Thu Jun 10 2010 Petr Machata <pmachata@redhat.com> - 2.2-2.20090809
6e17d9
- Replace mfence instruction with xchg to make it run on ia32-class
6e17d9
  machines without SSE2.
6e17d9
- Resolves: #600654
6e17d9
6e17d9
* Tue Nov  3 2009 Petr Machata <pmachata@redhat.com> - 2.2-1.20090809
6e17d9
- New upstream 2.2
6e17d9
- Resolves: #521571
6e17d9
6e17d9
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-3.20080605
6e17d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
6e17d9
6e17d9
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-2.20080605
6e17d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
6e17d9
6e17d9
* Fri Jun 13 2008 Petr Machata <pmachata@redhat.com> - 2.1-1.20080605
6e17d9
- New upstream 2.1
6e17d9
  - Drop soname patch, parallel make patch, and GCC 4.3 patch
6e17d9
6e17d9
* Wed Feb 13 2008 Petr Machata <pmachata@redhat.com> - 2.0-4.20070927
6e17d9
- Review fixes
6e17d9
  - Use updated URL
6e17d9
  - More timestamp preservation
6e17d9
- Initial import into Fedora CVS
6e17d9
6e17d9
* Mon Feb 11 2008 Petr Machata <pmachata@redhat.com> - 2.0-3.20070927
6e17d9
- Review fixes
6e17d9
  - Preserve timestamp of installed files
6e17d9
  - Fix soname not to contain "debug"
6e17d9
6e17d9
* Tue Feb  5 2008 Petr Machata <pmachata@redhat.com> - 2.0-2.20070927
6e17d9
- Review fixes
6e17d9
  - GCC 4.3 patchset
6e17d9
  - Add BR util-linux net-tools
6e17d9
  - Add full URL to Source0
6e17d9
  - Build in debug mode to work around problems with GCC 4.3
6e17d9
6e17d9
* Mon Dec 17 2007 Petr Machata <pmachata@redhat.com> - 2.0-1.20070927
6e17d9
- Initial package.
6e17d9
- Using SONAME patch from Debian.