File gasnet.spec of Package gasnet
#
# spec file for package gasnet
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: gasnet
Version: 1.26.0
Release: 0
Summary: A Portable High-Performance Communication Layer for GAS Languages
License: PostgreSQL
Group: Productivity/Networking/Other
Url: https://bitbucket.org/berkeleylab/gasnet/
Source0: https://bitbucket.org/berkeleylab/gasnet/downloads/GASNet-%{version}.tar.gz
Patch1: gasnet_add_RPM_OPT_FLAGS.patch
BuildRequires: automake
BuildRequires: fdupes
#needed for udp-conduit
BuildRequires: gcc-c++
BuildRequires: libibverbs-devel
BuildRequires: libpsm2-compat
BuildRequires: libpsm2-devel
BuildRequires: libtool
BuildRequires: openmpi
BuildRequires: openmpi-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# As it is dependent on libpsm2
ExclusiveArch: x86_64
%description
GASNet is a language-independent, low-level networking layer that provides
network-independent, high-performance communication primitives tailored for
implementing parallel global address space SPMD languages
such as UPC, Titanium, and Co-Array Fortran.
%package devel
Summary: Development package for GASNet
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
%description devel
Development package for GASNet. Including header files and libraries.
%prep
%setup -q -n GASNet-%{version}
%patch1 -p1
./Bootstrap -y
# Avoid unnecessary rebuilds of the package
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M:%%S')
sed -i -e "s/__DATE__/\"$FAKE_BUILDDATE\"/" -e "s/__TIME__/\"$FAKE_BUILDTIME\"/" gasnet_tools.c
sed -i -e "s/__DATE__/\"$FAKE_BUILDDATE\"/" -e "s/__TIME__/\"$FAKE_BUILDTIME\"/" gasnet_trace.c
sed -i -e "s/__DATE__/\"$FAKE_BUILDDATE\"/" -e "s/__TIME__/\"$FAKE_BUILDTIME\"/" tests/test.h
%build
export RPM_OPT_FLAGS
%configure --enable-udp --enable-mpi --enable-pshm --enable-psm
#make CFLAGS='$RPM_OPT_FLAGS'
make %{?_smp_mflags}
%install
make %{?_smp_mflags} DESTDIR=%{buildroot} install
chmod 755 %{buildroot}/%{_bindir}/gasnet_trace.pl
chmod 755 %{buildroot}/%{_bindir}/gasnetrun_ibv.pl
chmod 755 %{buildroot}/%{_bindir}/gasnetrun_mpi.pl
chmod 755 %{buildroot}/%{_bindir}/gasnetrun_ibv-mpi.pl
chmod 755 %{buildroot}/%{_bindir}/gasnetrun_psm-mpi.pl
chmod 755 %{buildroot}/%{_bindir}/gasnetrun_psm.pl
%fdupes %{buildroot}/%{_prefix}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%dir %{_datadir}/doc/GASNet/
%{_bindir}/*
%{_datadir}/doc/GASNet/*
%files devel
%defattr(-,root,root,0755)
%{_includedir}/*
%{_libdir}/*
%changelog
%changelog