Accepting request 664170 from home:eeich:factory_staging

- Convert package to _multibuild
- Add HPC build macros and evironment modules
  * (FATE#324138)
- Add master packages for libraries and devel package
- Remove BLAS build dependency

OBS-URL: https://build.opensuse.org/request/show/664170
OBS-URL: https://build.opensuse.org/package/show/science/gsl?expand=0&rev=19
This commit is contained in:
Adam Majer 2019-01-10 12:09:29 +00:00 committed by Git OBS Bridge
parent cfd05f0c88
commit 5fc6a8fe07
3 changed files with 234 additions and 44 deletions

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<package>serial</package>
<package>gnu-hpc</package>
</multibuild>

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Oct 23 16:30:44 UTC 2018 - jjolly@suse.com
- Convert package to _multibuild
- Add HPC build macros and evironment modules
* (FATE#324138)
- Add master packages for libraries and devel package
- Remove BLAS build dependency
-------------------------------------------------------------------
Sat Jul 28 13:49:30 UTC 2018 - jengelh@inai.de

265
gsl.spec
View File

@ -16,18 +16,82 @@
#
%define lname libgsl23
%define lcblasname libgslcblas0
Name: gsl
Version: 2.5
%global flavor @BUILD_FLAVOR@%{nil}
%define pname gsl
%define vers 2.5
%define _vers 2_5
%define lgsl_so_v 23
%define lgslcblas_so_v 0
%if "%{flavor}" == ""
ExclusiveArch: do_not_build
%define package_name %pname
%bcond_with hpc
%endif
%if "%{flavor}" == "serial"
%bcond_with hpc
%define manext .gz
%endif
%if "%{flavor}" == "gnu-hpc"
%define compiler_family gnu
%undefine c_f_ver
%define manext %{nil}
%bcond_without hpc
%endif
%if "%{flavor}" == "gnu6-hpc"
%define compiler_family gnu
%define c_f_ver 6
%define manext %{nil}
%bcond_without hpc
%endif
%if %{without hpc}
%if 0%{!?package_name:1}
%define package_name %{pname}
%endif
%define p_prefix %_prefix
%define p_includedir %_includedir/%pname
%define p_libdir %_libdir
%define p_bindir %_bindir
%define p_mandir %_mandir
%define p_datadir %_datadir
%define p_infodir %_infodir
%define num_threads 64
%define libname() lib%{pname}%{lgsl_so_v}
%define libcblas() lib%{pname}cblas%{lgslcblas_so_v}
%else
%{hpc_init -c %{compiler_family} %{?c_f_ver:-v %{c_f_ver}} %{?ext:-e %{ext}}}
%define package_name %{hpc_package_name %_vers}
%define p_prefix %hpc_prefix
%define p_includedir %hpc_includedir
%define p_libdir %hpc_libdir
%define p_bindir %hpc_bindir
%define p_mandir %hpc_mandir
%define p_datadir %hpc_datadir
%define p_infodir %hpc_infodir
%define num_threads 256
%define libname() lib%{pname}%{expand:%%{hpc_package_name_tail %{**}}}
%define libcblas() lib%{pname}cblas%{expand:%%{hpc_package_name_tail %{**}}}
%endif
Name: %{package_name}
Version: %{vers}
Release: 0
Summary: GNU Scientific Library
License: GPL-3.0-or-later
Group: Productivity/Scientific/Math
URL: https://www.gnu.org/software/gsl/
Source0: https://ftp.gnu.org/pub/gnu/gsl/gsl-%{version}.tar.gz
Source1: https://ftp.gnu.org/pub/gnu/gsl/gsl-%{version}.tar.gz.sig
Source2: https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=gsl&download=1#/%{name}.keyring
URL: https://www.gnu.org/software/%{pname}/
Source0: https://ftp.gnu.org/pub/gnu/%{pname}/%{pname}-%{version}.tar.gz
Source1: https://ftp.gnu.org/pub/gnu/%{pname}/%{pname}-%{version}.tar.gz.sig
Source2: https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=gsl&download=1#/%{pname}.keyring
Patch0: gsl-1.6-initvars.diff
Patch5: gsl-wrap.diff
Patch6: gsl-qawc-test-x86-precision.diff
@ -35,10 +99,22 @@ Patch7: gsl-disable-fma.patch
Patch8: gsl-fsf_address.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: blas-devel
BuildRequires: libtool
BuildRequires: pkgconfig
%if %{without hpc}
BuildRequires: update-alternatives
Requires(post): update-alternatives
Requires(preun): update-alternatives
%else
%hpc_requires
BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel
BuildRequires: lua-lmod
BuildRequires: suse-hpc
%global dep_summary %{summary}
%endif
%description
The GNU Scientific Library (GSL) is a collection of routines for
numerical computing. The routines are written from scratch by the GSL
@ -46,11 +122,14 @@ team in ANSI C and present an Applications Programming Interface
(API) for C programmers, while allowing wrappers to be written for very
high level languages.
%package -n %{lname}
%package -n %{libname %_vers}
Summary: GNU Scientific Library
Group: System/Libraries
%{?with_hpc:Requires: %{name}-module >= %version}
%description -n %{lname}
%{?with_hpc:%{hpc_master_package}}
%description -n %{libname %_vers}
The GNU Scientific Library (GSL) is a collection of routines for
numerical computing. The routines are written from scratch by the GSL
team in ANSI C and present an Applications Programming Interface
@ -69,22 +148,28 @@ Numerical Differentiation - Chebyshev Approximation - Series Acceleration -
Discrete Hankel Transforms - Root-Finding - Minimization -
Least-Squares Fitting - Physical Constants - IEEE Floating-Point
%package -n %{lcblasname}
%{?with_hpc:%{hpc_master_package -l -L}}
%package -n %{libcblas %_vers}
Summary: A standard C language APIs for BLAS from GNU Scientific Library
# file conflict, see boo#991155
Group: System/Libraries
Obsoletes: libgsl0
%{?with_hpc:Requires: %{name}-module >= %version}
%description -n %{lcblasname}
%description -n %{libcblas %_vers}
This library provides a native C interface to BLAS routines. This is part of
the GNU Scientific Library.
%{?with_hpc:%{hpc_master_package -l -n lib%{pname}cblas%{hpc_package_name_tail} -N %{pname}cblas}}
%package devel
Summary: Development files for the GNU Scientific Library
Group: Development/Libraries/C and C++
Requires: %{lcblasname} = %{version}
Requires: %{lname} = %{version}
Requires: %{libname %_vers} = %{version}
Requires: %{libcblas %_vers} = %{version}
Requires(pre): %{install_info_prereq}
%{?with_hpc:%hpc_requires_devel}
%description devel
This package contains the headers, static libraries and some
@ -96,13 +181,15 @@ team in ANSI C, and present an Applications Programming Interface
(API) for C programmers, while allowing wrappers to be written for very
high level languages.
%package doc
%{?with_hpc:%{hpc_master_package devel}}
%package doc
Summary: Documentation for the GNU Scientific Library
Group: Documentation/Other
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
%description doc
%description doc
This package contains documentation for GSL
The GNU Scientific Library (GSL) is a collection of routines for
@ -111,8 +198,22 @@ team in ANSI C, and present an Applications Programming Interface
(API) for C programmers, while allowing wrappers to be written for very
high level languages.
%{?with_hpc:%{hpc_master_package doc}}
%if %{with hpc}
%package module
Summary: Module files for %{name}
Group: Development/Libraries/Parallel
BuildArch: noarch
%description module
This package contains the environment module needed for the GSL
library packages.
%endif
# module package only installed thru dependency. No master package
%prep
%setup -q
%setup -q -n %{pname}-%{version}
%patch0 -p1
%patch5 -p1
%patch6
@ -120,15 +221,26 @@ high level languages.
%patch8
%build
%if %{with hpc}
%hpc_debug
%hpc_setup_compiler
%endif
autoreconf -fiv
export CFLAGS="%{optflags}"
%if %{without hpc}
%configure \
%else
%hpc_configure \
%endif
--disable-static \
--enable-shared \
--with-gnu-ld
make %{?_smp_mflags}
%check
# On i586 this still fails
%ifarch %{ix86}
make %{?_smp_mflags} check || ( find -name \*.log -print -exec cat {} \; ; exit 0 )
%else
@ -136,47 +248,112 @@ make %{?_smp_mflags} check || ( find -name \*.log -print -exec cat {} \; ; exit
%endif
%install
%{?with_hpc:%hpc_setup}
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
rm -f %{buildroot}%{_infodir}/dir
rm -f %{buildroot}%{p_infodir}/dir
%post -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%post -n %{lcblasname} -p /sbin/ldconfig
%postun -n %{lcblasname} -p /sbin/ldconfig
%if %{with hpc}
%{hpc_write_pkgconfig -n %{pname} -l lib%{pname}}
%hpc_write_modules_files
#%%Module1.0#####################################################################
proc ModulesHelp { } {
puts stderr " "
puts stderr "This module loads the %{pname} library built with the %{compiler_family} compiler toolchain."
puts stderr "\nVersion %{version}\n"
}
module-whatis "Name: %{pname} built with %{compiler_family} toolchain"
module-whatis "Version: %{version}"
module-whatis "Category: runtime library"
module-whatis "Description: %{summary}"
module-whatis "%{url}"
set version %{version}
prepend-path PATH %{hpc_bindir}
prepend-path LD_LIBRARY_PATH %{hpc_libdir}
setenv %{hpc_upcase %pname}_DIR %{hpc_prefix}
setenv %{hpc_upcase %pname}_BIN %{hpc_bindir}
setenv %{hpc_upcase %pname}_LIB %{hpc_libdir}
if {[file isdirectory %{hpc_includedir}]} {
prepend-path LIBRARY_PATH %{hpc_libdir}
prepend-path CPATH %{hpc_includedir}
prepend-path C_INCLUDE_PATH %{hpc_includedir}
prepend-path CPLUS_INCLUDE_PATH %{hpc_includedir}
prepend-path INCLUDE %{hpc_includedir}
setenv %{hpc_upcase %pname}_INC %{hpc_includedir}
}
family "%pname"
EOF
%endif
%post -n %{libname %_vers} -p /sbin/ldconfig
%postun -n %{libname %_vers} -p /sbin/ldconfig
%post -n %{libcblas %_vers} -p /sbin/ldconfig
%postun -n %{libcblas %_vers} -p /sbin/ldconfig
%if %{with hpc}
%files module
%hpc_modules_files
%endif
%files
%license COPYING
%{_bindir}/gsl-histogram
%{_bindir}/gsl-randist
%{_mandir}/man1/gsl-histogram.1%{?ext_man}
%{_mandir}/man1/gsl-randist.1%{?ext_man}
%{?with_hpc:%hpc_dirs}
%{?with_hpc:%dir %p_bindir}
%{p_bindir}/gsl-histogram
%{p_bindir}/gsl-randist
%{?with_hpc:%dir %{p_mandir}}
%{?with_hpc:%dir %{p_mandir}/man1}
%{p_mandir}/man1/gsl-histogram.1%{?manext}
%{p_mandir}/man1/gsl-randist.1%{?manext}
%files -n %{lname}
%{_libdir}/libgsl.so.*
%files -n %{libname %_vers}
%{?with_hpc:%hpc_dirs}
%{?with_hpc:%dir %p_libdir}
%{p_libdir}/libgsl.so.*
%files -n %{lcblasname}
%{_libdir}/libgslcblas.so.*
%files -n %{libcblas %_vers}
%{?with_hpc:%hpc_dirs}
%{p_libdir}/libgslcblas.so.*
%files devel
%license COPYING
%{_includedir}/gsl
%{_libdir}/libgsl*.so
%{_libdir}/pkgconfig/gsl.pc
%{_bindir}/gsl-config
%{_datadir}/aclocal/gsl.m4
%{_mandir}/man1/gsl-config.1%{?ext_man}
%{_mandir}/man3/gsl.3%{?ext_man}
%{?with_hpc:%hpc_dirs}
%{p_includedir}
%{?with_hpc:%dir %{p_includedir}/gsl}
%{p_libdir}/libgsl*.so
%{p_libdir}/pkgconfig
%{p_libdir}/pkgconfig/gsl.pc
%{p_bindir}/gsl-config
%{?with_hpc:%dir %p_datadir}
%dir %{p_datadir}/aclocal
%{p_datadir}/aclocal/gsl.m4
%{p_mandir}/man1/gsl-config.1%{?manext}
%{?with_hpc:%dir %{p_mandir}/man3}
%{p_mandir}/man3/gsl.3%{?manext}
%files doc
%doc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
%license COPYING
%doc AUTHORS ChangeLog NEWS README THANKS TODO
%{_infodir}/gsl-ref*
%{?with_hpc:%hpc_dirs}
%{?with_hpc:%dir %p_infodir}
%{p_infodir}/gsl-ref*
%post doc
%install_info --info-dir=%{_infodir} %{_infodir}/gsl-ref.info%{ext_info}
%install_info --info-dir=%{p_infodir} %{p_infodir}/gsl-ref.info%{ext_info}
%preun doc
%install_info_delete --info-dir=%{_infodir} %{_infodir}/gsl-ref.info%{ext_info}
%install_info_delete --info-dir=%{p_infodir} %{p_infodir}/gsl-ref.info%{ext_info}
%changelog