6 Star 0 Fork 0

OpenCloudOS Stream/eccodes

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
eccodes.spec 6.07 KB
一键复制 编辑 原始数据 按行查看 历史
ocs-bot 提交于 2024-05-06 15:43 . package init
%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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/opencloudos-stream/eccodes.git
git@gitee.com:opencloudos-stream/eccodes.git
opencloudos-stream
eccodes
eccodes
master

搜索帮助