Blame jsonnet.spec

949f392
Name:           jsonnet
a451bbf
Version:        0.20.0
842e1ee
Release:        2%{?dist}
3131367
Summary:        A data templating language based on JSON
949f392
842e1ee
License:        ASL 2.0
949f392
949f392
URL:            https://github.com/google/jsonnet
949f392
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
949f392
33b7a40
# Downstream man pages in groff_man(7) format
33b7a40
Source1:        jsonnet.1
33b7a40
Source2:        jsonnetfmt.1
33b7a40
949f392
# Upstream wants to build single source wheels
949f392
# these benefit from static linking,
949f392
# but we want to link to libjsonnet here so we are sharing the lib
4637499
Patch:          0001-Dynamic-link-to-libjsonnet-rather-than-static.patch
89a7a3e
# Upstream hard codes compiler flags
4637499
Patch:          0002-jsonnet-0.17.0-do-not-override-compiler-flags.patch
89a7a3e
# Upstream ships rapidyaml inside this source repo
4637499
Patch:          0003-jsonnet-0.19.1-Use-system-provided-rapidyaml.patch
949f392
842e1ee
# Bundled MD5 C++ class in third_party/md5/ with very permissive license (RSA)
842e1ee
# Per current guidance, we don’t need to record this as an additional license:
842e1ee
# https://docs.fedoraproject.org/en-US/legal/misc/#_licensing_of_rsa_implementations_of_md5
949f392
# rpmlint must be notified of the unversioned provides
949f392
Provides:       bundled(md5-thilo)
949f392
949f392
BuildRequires:  python3-devel
949f392
BuildRequires:  python3-setuptools
949f392
949f392
BuildRequires:  bash cmake gcc gcc-c++ gtest-devel make
949f392
949f392
# json is header only, so note the static lib for tracking
949f392
BuildRequires:  json-devel json-static
89a7a3e
BuildRequires:  rapidyaml-devel
949f392
949f392
# Set our toplevel runtime requirements
949f392
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
949f392
949f392
%global _description %{expand:
949f392
A data templating language for app and tool developers based on JSON}
949f392
949f392
%description %{_description}
949f392
949f392
949f392
%package -n python3-%{name}
949f392
Summary:        %{name} Bindings for Python
949f392
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
949f392
949f392
%description -n python3-%{name} %{_description}
949f392
949f392
949f392
%package libs
949f392
Summary:        Shared Libraries for %{name}
949f392
949f392
%description libs %{_description}
949f392
949f392
949f392
%package devel
949f392
Summary:        Development Headers for %{name}
949f392
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
949f392
949f392
%description devel %{_description}
949f392
949f392
949f392
%package doc
949f392
Summary:        Documentation for %{name}
949f392
License:        CC-BY
949f392
BuildArch:      noarch
949f392
949f392
%description doc %{_description}
949f392
949f392
949f392
%prep
949f392
%autosetup
949f392
949f392
# use system json lib instead
949f392
rm -rfv third_party/json/*
949f392
949f392
# don't bundel rapidyaml
949f392
rm -rfv third_party/rapidyaml/*
949f392
949f392
# don't bundle thirdparty doc resources
949f392
# this leaves the doc "unbuilt" but still sorta useful
949f392
rm -rf doc/third_party
949f392
rm -rf doc/.gitignore
949f392
949f392
949f392
%build
949f392
# FIXME:
949f392
# For reasons I'm not following, json-devel isn't added to include by cmake
949f392
#
949f392
# explicitly set -fPIC so python can pick it up later on
949f392
export CXXFLAGS="%{optflags} -fPIC -I%{_includedir}/nlohmann"
949f392
949f392
# setup our build environment
949f392
%cmake -DBUILD_SHARED_BINARIES:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF -DUSE_SYSTEM_JSON:BOOL=ON -DUSE_SYSTEM_GTEST:BOOL=ON
949f392
949f392
# make tools and headers
949f392
%cmake_build
949f392
949f392
# make python binding
949f392
%{py3_build}
949f392
949f392
949f392
%install
949f392
%{cmake_install}
949f392
949f392
# install python binding
949f392
%{py3_install}
949f392
33b7a40
install -d '%{buildroot}%{_mandir}/man1'
33b7a40
install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 '%{SOURCE1}' '%{SOURCE2}'
33b7a40
949f392
949f392
%check
949f392
%ctest
949f392
949f392
949f392
%files
949f392
%{_bindir}/jsonnet
949f392
%{_bindir}/jsonnetfmt
33b7a40
%{_mandir}/man1/jsonnet.1*
33b7a40
%{_mandir}/man1/jsonnetfmt.1*
949f392
949f392
%files libs
949f392
%license LICENSE
949f392
%doc README.md
89a7a3e
%{_libdir}/lib%{name}*.so.*
949f392
949f392
%files devel
949f392
%{_includedir}/lib%{name}*
949f392
%{_libdir}/lib%{name}*.so
949f392
949f392
%files -n python3-%{name}
949f392
# rpmlint must be notified this is not versioned on purpose
949f392
%{python3_sitearch}/_%{name}*.so
949f392
%{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info
949f392
949f392
%files doc
949f392
%license LICENSE
949f392
%doc README.md
949f392
%doc CONTRIBUTING
949f392
%doc doc
949f392
%doc examples
949f392
949f392
949f392
%changelog
842e1ee
* Thu May 25 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.20.0-2
842e1ee
- Drop “RSA” license per current guidance on RSA MD5 implementations
fc756ea
- Drop EPEL8 conditionals from spec file
842e1ee
a451bbf
* Mon Apr 17 2023 Pat Riehecky <riehecky@fnal.gov> - 0.20.0
a451bbf
- Update to 0.20.0
a451bbf
2011927
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.19.1-2
2011927
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
2011927
89a7a3e
* Wed Nov 2 2022 Pat Riehecky <riehecky@fnal.gov> - 0.19.1
89a7a3e
- Update to 0.19.1
89a7a3e
- v0.19.0 is not binary compatible with previous versions of libjsonnet.
89a7a3e
- this version introduces versioned soname objects from upstream
89a7a3e
497a750
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.0-6
497a750
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
497a750
b8e3e11
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.17.0-5
b8e3e11
- Rebuilt for Python 3.11
b8e3e11
05300a6
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.0-4
05300a6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
05300a6
711ff4e
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.0-3
711ff4e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
711ff4e
33b7a40
* Fri Jun 25 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.17.0-2
33b7a40
- Add downstream man pages
3131367
- Fix Summary
33b7a40
949f392
* Thu Jun 17 2021 Pat Riehecky <riehecky@fnal.gov> - 0.17.0-1
949f392
- Initial package.