Name: nceplibs-g2 Version: 4.0.0 Release: 1%{?dist} Summary: Utilities for coding/decoding GRIB2 messages. License: LGPL-3.0-only URL: https://github.com/NOAA-EMC/NCEPLIBS-g2 Source0: https://github.com/NOAA-EMC/NCEPLIBS-g2/archive/refs/tags/v%{version}.tar.gz Source1: g2.pc.in Patch1: 001-remove-unused-dependencies.patch Patch2: 002-fortran-module-location-option.patch BuildRequires: cmake BuildRequires: gcc-gfortran BuildRequires: pkgconfig(bacio) BuildRequires: pkgconfig(nceplibs-g2c) BuildRequires: pkgconfig(nceplibs-ip) BuildRequires: pkgconfig(w3emc-4) BuildRequires: pkgconfig(w3emc-d) Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description The NCEPLIBS-g2 library contains Fortran code to read and write GRIB edition 2 files, and utilities to manipulate GRIB2 files. GRIdded Binary or General Regularly-distributed Information in Binary form (GRIB) is a data format for meteorological and forecast data, standardized by the World Meteorological Organization (WMO). GRIB edition 2 (GRIB2) was approved by the WMO is 2003. %package libs Summary: This is a meta-package, pulling in the individual g2 runtime libraries. Requires: %{name}-4%{?_isa} = %{version}-%{release} Requires: %{name}-d%{?_isa} = %{version}-%{release} %description libs The NCEPLIBS-g2 library contains Fortran code to read and write GRIB edition 2 files, and utilities to manipulate GRIB2 files. GRIdded Binary or General Regularly-distributed Information in Binary form (GRIB) is a data format for meteorological and forecast data, standardized by the World Meteorological Organization (WMO). GRIB edition 2 (GRIB2) was approved by the WMO is 2003. %package 4 Summary: Utilities for coding/decoding GRIB2 messages using real32 (4-byte) precision. Requires: nceplibs-bacio Requires: nceplibs-g2c Requires: nceplibs-w3emc-4 %description 4 The NCEPLIBS-g2 library contains Fortran code to read and write GRIB edition 2 files, and utilities to manipulate GRIB2 files. GRIdded Binary or General Regularly-distributed Information in Binary form (GRIB) is a data format for meteorological and forecast data, standardized by the World Meteorological Organization (WMO). GRIB edition 2 (GRIB2) was approved by the WMO is 2003. %package d Summary: Utilities for coding/decoding GRIB2 messages using real64 (8-byte) precision. Requires: nceplibs-bacio Requires: nceplibs-g2c Requires: nceplibs-w3emc-d %description d The NCEPLIBS-g2 library contains Fortran code to read and write GRIB edition 2 files, and utilities to manipulate GRIB2 files. GRIdded Binary or General Regularly-distributed Information in Binary form (GRIB) is a data format for meteorological and forecast data, standardized by the World Meteorological Organization (WMO). GRIB edition 2 (GRIB2) was approved by the WMO is 2003. %package devel Summary: Development files for NCEPLIBS-g2. Requires: gcc-gfortran%{?_isa} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: pkgconfig Requires: pkgconfig(bacio) Requires: pkgconfig(nceplibs-g2c) Requires: pkgconfig(nceplibs-ip) Requires: pkgconfig(w3emc-4) Requires: pkgconfig(w3emc-d) %description devel Headers and CMake configuration files needed to develop software against NCEPLIBS-g2. %prep %autosetup -n NCEPLIBS-g2-%{version} -p0 %build %cmake \ -DBUILD_4=ON \ -DBUILD_D=ON \ -DBUILD_WITH_W3EMC=ON \ -DBUILD_UTILS=ON \ -DUSE_AEC=ON \ -DG2C_COMPARE=ON \ -DUSE_G2C_API=ON \ -DFMODDIR=%{_fmoddir} \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_TESTING=OFF %cmake_build for p in %{precisions}; do sed \ -e "s|FMODDIR|%{_fmoddir}|g" \ -e "s|VERSION|%{version}|g" \ -e "s|PRECISION|$p|g" \ %{SOURCE1} > g2-$p.pc done %install %cmake_install for p in %{precisions}; do install -Dpm 0644 g2-$p.pc %{buildroot}%{_libdir}/pkgconfig/g2-$p.pc done %files %{_bindir}/* %files libs %files 4 %license LICENSE.md %doc README.md %{_libdir}/libg2_4.so.* %files d %license LICENSE.md %doc README.md %{_libdir}/libg2_d.so.* %files devel %dir %{_fmoddir}/g2*/ %{_fmoddir}/g2*/*.mod %dir %{_libdir}/cmake/g2/ %{_libdir}/cmake/g2/*.cmake %{_libdir}/pkgconfig/g2*.pc %{_libdir}/libg2*.so %changelog * Thu Jan 08 2026 Benjamin Cook - 4.0.0-1 - Initial package