Blame jsonnet.spec

949f392
Name:           jsonnet
a451bbf
Version:        0.20.0
7cf8b52
%global so_version 0
b46f04f
Release:        4%{?dist}
3131367
Summary:        A data templating language based on JSON
949f392
e48c320
# The entire source is Apache-2.0, except:
e48c320
#   - doc/ (the HTML documentation) is doc/_layouts/base.html is CC-BY-2.5,
e48c320
#     which is reflected in the License of the -doc subpackage
e48c320
#   - The dependency “json” is a header-only library, so it must be treated as
e48c320
#     a static library. Its license “MIT AND CC0-1.0” (the latter from a
e48c320
#     bundled hedley) therefore contributes to the licenses of the binary RPMs
e48c320
#     that include compiled programs and libraries.
e48c320
License:        Apache-2.0 AND MIT AND CC0-1.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
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}
e48c320
# This contains nothing derived from json-static, so the (MIT AND CC0-1.0)
e48c320
# portion can be omitted and the license is simply:
e48c320
License:        Apache-2.0
e48c320
949f392
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
949f392
949f392
%description devel %{_description}
949f392
949f392
949f392
%package doc
949f392
Summary:        Documentation for %{name}
e48c320
# This contains nothing derived from json-static, so the (MIT AND CC0-1.0)
e48c320
# portion can be omitted. HTML documentation from doc/ is CC-BY-2.5; examples/
e48c320
# are Apache-2.0.
e48c320
License:        Apache-2.0 AND CC-BY-2.5
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
9a69860
# The documentation and examples include a few executable shell scripts.
9a69860
# Because this is an unusual location to install scripts, we need to fix their
9a69860
# shebangs manually. See:
9a69860
# https://docs.fedoraproject.org/en-US/packaging-guidelines/#_shebang_lines
9a69860
find doc examples -type f -perm /0111 -name '*.sh' -print0 |
9a69860
  xargs -r -0 -t sed -r -i '1{s@^#!/usr/bin/env[[:blank:]]+bash@#!/bin/bash@}'
9a69860
949f392
a193a08
%generate_buildrequires
a193a08
%pyproject_buildrequires
a193a08
a193a08
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
a193a08
%pyproject_wheel
949f392
949f392
949f392
%install
949f392
%{cmake_install}
949f392
949f392
# install python binding
a193a08
%pyproject_install
a193a08
%pyproject_save_files _jsonnet
949f392
33b7a40
install -d '%{buildroot}%{_mandir}/man1'
33b7a40
install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 '%{SOURCE1}' '%{SOURCE2}'
33b7a40
949f392
949f392
%check
949f392
%ctest
4b79e5d
4b79e5d
LD_LIBRARY_PATH='%{buildroot}%{_libdir}' \
4b79e5d
    PYTHONPATH='%{buildroot}%{python3_sitearch}' \
4b79e5d
    %{python3} python/_jsonnet_test.py
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
7cf8b52
%{_libdir}/lib%{name}.so.%{so_version}{,.*}
7cf8b52
%{_libdir}/lib%{name}++.so.%{so_version}{,.*}
949f392
949f392
%files devel
949f392
%{_includedir}/lib%{name}*
7cf8b52
%{_libdir}/lib%{name}.so
7cf8b52
%{_libdir}/lib%{name}++.so
949f392
a193a08
%files -n python3-%{name} -f %{pyproject_files}
949f392
949f392
%files doc
949f392
%license LICENSE
949f392
%doc README.md
949f392
%doc CONTRIBUTING
949f392
%doc doc
949f392
%doc examples
949f392
949f392
949f392
%changelog
b46f04f
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.20.0-4
b46f04f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
b46f04f
da06b69
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.20.0-3
da06b69
- Rebuilt for Python 3.12
da06b69
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
e48c320
- Update License to SPDX
a193a08
- Build Python bindings with pyproject-rpm-macros (“new guidelines”)
4b79e5d
- Run the Python tests
7cf8b52
- Do not glob over the shared library SONAME version
9a69860
- Fix up shebangs in the docs and examples
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.