Disable octave for EPEL 7 - not yet available

This commit is contained in:
Mattias Ellert 2014-06-03 13:44:29 +02:00
commit b1487e5ca8

View file

@ -1,8 +1,15 @@
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
# Disable octave for EPEL 7 - not yet available
%if %{?rhel}%{!?rhel:0} >= 7
%global octave 0
%else
%global octave 1
%endif
Name: lhapdf
Version: 5.9.1
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Les Houches Accord PDF Interface
Group: System Environment/Libraries
@ -27,7 +34,9 @@ Patch2: %{name}-fix-typo.patch
Patch3: %{name}-path-max.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if %{octave}
BuildRequires: octave-devel
%endif
BuildRequires: ncurses-devel
BuildRequires: python-devel
BuildRequires: gcc-gfortran
@ -53,6 +62,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
This package provides development files of LHAPDF, including C++ bindings.
%if %{octave}
%global octpkg %{name}
%{!?octave_api: %global octave_api %(octave-config -p API_VERSION || echo 0)}
%{!?octpkgdir: %global octpkgdir %{_datadir}/octave/packages/%{octpkg}-%{version}}
@ -69,6 +79,7 @@ Requires(postun): octave
%description -n octave-%{name}
This package provides Octave bindings for LHAPDF.
%endif
%package -n python-%{name}
Summary: Les Houches Accord PDF Interface - Python module
@ -125,7 +136,11 @@ rm pyext/lhapdf.py
%endif
%build
%configure --disable-static
%if %{octave}
%configure --disable-static --enable-octave
%else
%configure --disable-static --disable-octave
%endif
# Reduce overlinking
sed 's!CC -shared !CC \${wl}--as-needed -shared !g' -i libtool
@ -144,6 +159,7 @@ install -m 644 -p %SOURCE9 %{buildroot}%{_mandir}/man1
rm %{buildroot}%{_libdir}/libLHAPDF.la
rm %{buildroot}%{_datadir}/%{name}/doc/html
%if %{octave}
APIDIR=$(octave-config -p CANONICAL_HOST_TYPE)-$(octave-config -p API_VERSION)
mkdir -p %{buildroot}%{octpkglibdir}/${APIDIR}
mv %{buildroot}%{_datadir}/%{name}/%{name}.oct \
@ -167,11 +183,12 @@ Description: LHAPDF provides a unified and easy to use interface to
more easy updating and no limit to the expansion possibilities.
EOF
mkdir -p %{buildroot}%{_datadir}/%{name}/PDFsets
install -m 644 -p PDFsets/* %{buildroot}%{_datadir}/%{name}/PDFsets
sed '2a pkg load lhapdf' octave/lhapdf-octave-example1.m \
> lhapdf-octave-example1.m
%endif
mkdir -p %{buildroot}%{_datadir}/%{name}/PDFsets
install -m 644 -p PDFsets/* %{buildroot}%{_datadir}/%{name}/PDFsets
%check
%ifnarch s390
@ -185,11 +202,13 @@ rm -rf %{buildroot}
%postun -p /sbin/ldconfig
%if %{octave}
%post -n octave-%{name}
%octave_cmd pkg rebuild
%postun -n octave-%{name}
%octave_cmd pkg rebuild
%endif
%files
%{_libdir}/libLHAPDF.so.*
@ -202,10 +221,12 @@ rm -rf %{buildroot}
%{_libdir}/libLHAPDF.so
%doc examples/CC*.cc examples/Example*.f
%if %{octave}
%files -n octave-%{name}
%{octpkglibdir}
%{octpkgdir}
%doc lhapdf-octave-example1.m
%endif
%files -n python-%{name}
%{_bindir}/lhapdf-getdata
@ -224,6 +245,9 @@ rm -rf %{buildroot}
%doc ccwrap/doxy/html COPYING
%changelog
* Tue Jun 03 2014 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.9.1-5
- Disable octave for EPEL 7 - not yet available
* Tue Jan 07 2014 Mattias Ellert <mattias.ellert@fysast.uu.se> - 5.9.1-4
- Add "pkg load lhapdf" to octave example
- Fixes for EPEL 5