代码拉取完成,页面将自动刷新
%if 0%{?el8}
%undefine __cmake_in_source_build
%endif
Name: eccodes
Version: 2.33.0
Release: 1%{?dist}
Summary: WMO data format decoding and encoding
%global so_version 0.1
%global so_version_f90 0.1
%global datapack_date 20231216
%global final_grib_api_version 1.28.1-1%{?dist}
%ifarch i686 ppc64 armv7hl
%global obsolete_grib_api 0
%else
%global obsolete_grib_api 1
%endif
License: Apache-2.0
URL: https://confluence.ecmwf.int/display/ECC/ecCodes+Home
Source0: https://confluence.ecmwf.int/download/attachments/45757960/eccodes-%{version}-Source.tar.gz
Source1: https://get.ecmwf.int/repository/test-data/eccodes/eccodes_test_data.tar.gz#/eccodes_test_data_%{datapack_date}.tar.gz
Source2: eccodes_create_man_pages.sh
Patch1: eccodes-soversion.patch
BuildRequires: cmake3
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
BuildRequires: /usr/bin/git
BuildRequires: jasper-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: netcdf-devel
BuildRequires: openjpeg2-devel
BuildRequires: libaec-devel
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(Test::More)
BuildRequires: perl(File::Compare)
BuildRequires: help2man
Requires: %{name}-data = %{version}-%{release}
%if 0%{obsolete_grib_api}
%endif
ExcludeArch: i686
%description
ecCodes is a package developed by ECMWF which provides an application
programming interface and a set of tools for decoding and encoding messages
in the following formats:
* WMO FM-92 GRIB edition 1 and edition 2
* WMO FM-94 BUFR edition 3 and edition 4
* WMO GTS abbreviated header (only decoding).
A useful set of command line tools provide quick access to the messages. C,
and Fortran 90 interfaces provide access to the main ecCodes functionality.
ecCodes is an evolution of GRIB-API. It is designed to provide the user with
a simple set of functions to access data from several formats with a key/value
approach.
For GRIB encoding and decoding, the GRIB-API functionality is provided fully
in ecCodes with only minor interface and behaviour changes. Interfaces for C,
and Fortran 90 are all maintained as in GRIB-API. However, the
GRIB-API Fortran 77 interface is no longer available.
In addition, a new set of functions with the prefix "codes_" is provided to
operate on all the supported message formats. These functions have the same
interface and behaviour as the "grib_" functions.
A selection of GRIB-API tools has been included in ecCodes (ecCodes GRIB
tools), while new tools are available for the BUFR (ecCodes BUFR tools) and
GTS formats. The new tools have been developed to be as similar as possible
to the existing GRIB-API tools maintaining, where possible, the same options
and behaviour. A significant difference compared with GRIB-API tools is that
bufr_dump produces output in JSON format suitable for many web based
applications.
%package devel
Summary: Contains ecCodes development files
Requires: %{name} = %{version}-%{release}
Requires: gcc-gfortran
Requires: jasper-devel
%if 0%{obsolete_grib_api}
%endif
%description devel
Header files and libraries for ecCodes.
%package data
Summary: Data needed by the eccodes library and tools
BuildArch: noarch
%description data
This package provides all tables and definitions needed
to encode and decode grib and bufr files, and includes
both the official WMO tables and a number of often used
local definitions by ECMWF and other meteorological centers.
%package doc
Summary: Documentation and example code
BuildArch: noarch
%description doc
This package contains the html documentation for ecCodes
and a fair number of example programs and scripts to use it
in C, and Fortran 90.
%prep
%autosetup -n %{name}-%{version}-Source -p1
mkdir -p %{_vpath_builddir}
pushd %{_vpath_builddir}
tar xf %SOURCE1
popd
%build
%cmake3 -DINSTALL_LIB_DIR=%{_lib} \
-DENABLE_ECCODES_OMP_THREADS=ON \
-DENABLE_EXTRA_TESTS=ON \
-DENABLE_JPG=ON \
-DENABLE_PNG=ON \
-DENABLE_FORTRAN=ON \
-DENABLE_NETCDF=ON \
-DCMAKE_SKIP_INSTALL_RPATH=TRUE \
-DECCODES_SOVERSION=%{so_version} \
-DECCODES_SOVERSION_F90=%{so_version_f90} \
-DCMAKE_Fortran_FLAGS="-fPIC"
%cmake_build
cp fortran/eccodes_constants.h %{_vpath_builddir}/fortran/
cp fortran/grib_api_constants.h %{_vpath_builddir}/fortran/
%install
%cmake_install
mkdir -p %{buildroot}%{_fmoddir}
mv %{buildroot}%{_includedir}/*.mod %{buildroot}%{_fmoddir}/
rm %{buildroot}%{_datadir}/%{name}/definitions/installDefinitions.sh
mkdir -p %{buildroot}%{_datadir}/doc/%{name}/
cp -r html %{buildroot}%{_datadir}/doc/%{name}/
mkdir -p %{buildroot}%{_datadir}/doc/%{name}/examples/C
cp examples/C/*.c %{buildroot}%{_datadir}/doc/%{name}/examples/C
mkdir -p %{buildroot}%{_datadir}/doc/%{name}/examples/F90
cp examples/F90/*.f90 %{buildroot}%{_datadir}/doc/%{name}/examples/F90
LD_LIBRARY_PATH=%{buildroot}/%{_libdir} \
%{SOURCE2} %{_vpath_builddir}/bin \
%{_vpath_builddir}/man
mkdir -p %{buildroot}%{_datadir}/man/man1
cp %{_vpath_builddir}/man/*.1 %{buildroot}%{_datadir}/man/man1
chmod 644 AUTHORS LICENSE
sed -i 's|^libs=.*$|libs=-L${libdir} -leccodes|g' %{buildroot}/%{_libdir}/pkgconfig/eccodes.pc
sed -i 's|^libs=.*$|libs=-L${libdir} -leccodes_f90 -leccodes|g' %{buildroot}/%{_libdir}/pkgconfig/eccodes_f90.pc
%check
cd %{_vpath_builddir}
LD_LIBRARY_PATH=%{buildroot}/%{_libdir} \
LIBRARY_PATH=%{buildroot}/%{_libdir} \
ctest3 -V %{?_smp_mflags}
%files
%license LICENSE
%doc README.md ChangeLog AUTHORS NEWS NOTICE
%{_bindir}/*
%{_libdir}/*.so.*
%{_mandir}/man1/*.1*
%files devel
%{_includedir}/*
%{_fmoddir}/%{name}.mod
%{_fmoddir}/grib_api.mod
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/pkgconfig/%{name}_f90.pc
%{_libdir}/*.so
%dir %{_libdir}/cmake/%{name}
%{_libdir}/cmake/%{name}/*
%files data
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/definitions/
%{_datadir}/%{name}/samples/
%{_datadir}/%{name}/ifs_samples/
%files doc
%doc %{_datadir}/doc/%{name}/
%changelog
* Fri Apr 12 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 2.33.0-1
- initial build
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。