Blame SPECS/re2.spec

a9aea1
Name:           re2
a9aea1
%global tag 2024-07-02
a9aea1
%global so_version 11
a9aea1
Version:        %(echo '%{tag}' | tr -d -)
a9aea1
Epoch:          1
a9aea1
Release:        3%{?dist}
a9aea1
Summary:        C++ fast alternative to backtracking RE engines
a9aea1
a9aea1
# The entire source is BSD-3-Clause, except:
a9aea1
#   - lib/git/commit-msg.hook is Apache-2.0, but is not used in the build and
a9aea1
#     is removed in %%prep
a9aea1
License:        BSD-3-Clause
a9aea1
URL:            https://github.com/google/re2
a9aea1
Source:         %{url}/archive/%{tag}/re2-%{tag}.tar.gz
a9aea1
a9aea1
BuildRequires:  cmake
a9aea1
BuildRequires:  ninja-build
a9aea1
BuildRequires:  gcc-c++
a9aea1
a9aea1
BuildRequires:  cmake(absl)
a9aea1
BuildRequires:  pkgconfig(icu-uc)
a9aea1
BuildRequires:  cmake(GTest)
a9aea1
BuildRequires:  cmake(benchmark)
a9aea1
a9aea1
# Python extension
a9aea1
BuildRequires:  python3-devel
a9aea1
BuildRequires:  %{py3_dist pybind11}
a9aea1
# https://docs.fedoraproject.org/en-US/packaging-guidelines/#_packaging_header_only_libraries
a9aea1
BuildRequires:  pybind11-static
a9aea1
a9aea1
# Python extension tests
a9aea1
BuildRequires:  %{py3_dist pytest}
a9aea1
BuildRequires:  %{py3_dist absl-py}
a9aea1
a9aea1
%global common_description %{expand:
a9aea1
RE2 is a fast, safe, thread-friendly alternative to backtracking regular
a9aea1
expression engines like those used in PCRE, Perl, and Python. It is a C++
a9aea1
library.}
a9aea1
a9aea1
%description %{common_description}
a9aea1
a9aea1
a9aea1
%package        devel
a9aea1
Summary:        C++ header files and library symbolic links for re2
a9aea1
a9aea1
Requires:       re2%{?_isa} = %{epoch}:%{version}-%{release}
a9aea1
a9aea1
%description    devel %{common_description}
a9aea1
a9aea1
This package contains the C++ header files and symbolic links to the shared
a9aea1
libraries for re2. If you would like to develop programs using re2, you will
a9aea1
need to install re2-devel.
a9aea1
a9aea1
a9aea1
%package -n     python3-google-re2
a9aea1
Summary:        RE2 Python bindings
a9aea1
a9aea1
# https://docs.fedoraproject.org/en-US/packaging-guidelines/#_requiring_base_package
a9aea1
Requires:       re2%{?_isa} = %{epoch}:%{version}-%{release}
a9aea1
a9aea1
Conflicts:      python3-fb-re2
a9aea1
Obsoletes:      python3-fb-re2 < 1.0.7-19
a9aea1
a9aea1
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_provides_for_importable_modules
a9aea1
%py_provides python3-re2
a9aea1
a9aea1
%description -n python3-google-re2
a9aea1
A drop-in replacement for the re module.
a9aea1
a9aea1
It uses RE2 under the hood, of course, so various PCRE features (e.g.
a9aea1
backreferences, look-around assertions) are not supported. See
a9aea1
https://github.com/google/re2/wiki/Syntax for the canonical reference, but
a9aea1
known syntactic ”gotchas” relative to Python are:
a9aea1
a9aea1
  • PCRE supports \Z and \z; RE2 supports \z; Python supports \z,
a9aea1
    but calls it \Z. You must rewrite \Z to \z in pattern strings.
a9aea1
a9aea1
Known differences between this module’s API and the re module’s API:
a9aea1
a9aea1
  • The error class does not provide any error information as attributes.
a9aea1
  • The Options class replaces the re module’s flags with RE2’s options as
a9aea1
    gettable/settable properties. Please see re2.h for their documentation.
a9aea1
  • The pattern string and the input string do not have to be the same type.
a9aea1
    Any str will be encoded to UTF-8.
a9aea1
  • The pattern string cannot be str if the options specify Latin-1 encoding.
a9aea1
a9aea1
a9aea1
%prep
a9aea1
%autosetup -n re2-%{tag}
a9aea1
# Show that a file licensed Apache-2.0 is not used in the build and does not
a9aea1
# contribute to the licenses of the binary RPMs:
a9aea1
rm lib/git/commit-msg.hook
a9aea1
a9aea1
a9aea1
%generate_buildrequires
a9aea1
cd python
a9aea1
%pyproject_buildrequires
a9aea1
a9aea1
a9aea1
%build
a9aea1
%cmake \
a9aea1
    -DRE2_BUILD_TESTING:BOOL=ON \
a9aea1
    -DRE2_USE_ICU:BOOL=ON \
a9aea1
    -GNinja
a9aea1
%cmake_build
a9aea1
a9aea1
cat >> python/setup.cfg <
a9aea1
[build_ext]
a9aea1
include_dirs=${PWD}
a9aea1
library_dirs=${PWD}/%{_vpath_builddir}
a9aea1
EOF
a9aea1
cd python
a9aea1
%pyproject_wheel
a9aea1
a9aea1
a9aea1
%install
a9aea1
%cmake_install
a9aea1
a9aea1
cd python
a9aea1
%pyproject_install
a9aea1
%pyproject_save_files -l re2
a9aea1
a9aea1
a9aea1
%check
a9aea1
%ctest
a9aea1
a9aea1
# Run the tests from the top-level directory to make sure we don’t accidentally
a9aea1
# import the “un-built” package instead of the one in the buildroot.
a9aea1
ln -s python/re2_test.py
a9aea1
LD_LIBRARY_PATH='%{buildroot}%{_libdir}' %pytest re2_test.py
a9aea1
a9aea1
a9aea1
%files
a9aea1
%license LICENSE
a9aea1
%doc README
a9aea1
%{_libdir}/libre2.so.%{so_version}{,.*}
a9aea1
a9aea1
a9aea1
%files          devel
a9aea1
%doc doc/syntax.{html,txt}
a9aea1
%{_includedir}/re2/
a9aea1
%{_libdir}/libre2.so
a9aea1
%{_libdir}/pkgconfig/re2.pc
a9aea1
%{_libdir}/cmake/re2/
a9aea1
a9aea1
a9aea1
%files -n       python3-google-re2 -f %{pyproject_files}
a9aea1
a9aea1
a9aea1
%changelog
a9aea1
* Sun Oct 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1:20240702-3
a9aea1
- Build the Python extension
a9aea1
a9aea1
* Sun Oct 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1:20240702-2
a9aea1
- Enable full Unicode properties support by linking ICU
a9aea1
a9aea1
* Sun Oct 13 2024 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 1:20240702-1
a9aea1
- Upgrade to 2024-07-02
a9aea1
- Incorporate a few minor packaging enhancements from Rawhide
a9aea1
a9aea1
* Sat Oct 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1:20220601-16
a9aea1
- Include HTML and text syntax references as devel package documentation
a9aea1
a9aea1
* Sat Oct 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1:20220601-14
a9aea1
- Improve the source URL
a9aea1
a9aea1
* Sat Oct 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1:20220601-13
a9aea1
- Switch the URL from HTTP to HTTPS
a9aea1
a9aea1
* Sat Oct 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1:20220601-12
a9aea1
- Convert License to SPDX
a9aea1
a9aea1
* Sat Oct 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1:20220601-11
a9aea1
- Use a simplified description from upstream.
a9aea1
a9aea1
* Sat Oct 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1:20220601-10
a9aea1
- Build with ninja instead of make
a9aea1
- This is modestly faster and has no disadvantages
a9aea1
a9aea1
* Sat Oct 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1:20220601-9
a9aea1
- Fix unowned directory %%{_libdir}/cmake/re2/
a9aea1
a9aea1
* Sat Oct 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1:20220601-6
a9aea1
- Use CMake to build and run tests; this results in more thorough testing
a9aea1
a9aea1
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:20220601-6
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
a9aea1
a9aea1
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:20220601-5
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
a9aea1
a9aea1
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:20220601-4
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
a9aea1
a9aea1
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:20220601-3
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
a9aea1
a9aea1
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:20220601-2
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
a9aea1
a9aea1
* Wed Nov 30 2022 Denis Arnaud <denis.arnaud_fedora@m4x.org>  - 1:20220601-1
a9aea1
- Upgrade to 2022-06-01
a9aea1
a9aea1
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:20211101-4
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
a9aea1
a9aea1
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:20211101-3
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
a9aea1
a9aea1
* Mon Jan 10 2022 Adam Williamson <awilliam@redhat.com> - 1:20211101-2
a9aea1
- Backport patch to fix thread dependency discovery
a9aea1
- Substitute the pkgconfig file before installing it (#2038572)
a9aea1
- Drop soname patches as upstream seems to be doing it properly now
a9aea1
a9aea1
* Fri Jan 07 2022 Denis Arnaud <denis.arnaud_fedora@m4x.org>  - 1:20211101-1
a9aea1
- Upgrade to 2021-11-01
a9aea1
a9aea1
* Tue Mar 30 2021 Jonathan Wakely <jwakely@redhat.com> - 1:20190801-8
a9aea1
- Rebuilt for removed libstdc++ symbol (#1937698)
a9aea1
a9aea1
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:20190801-7
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
a9aea1
a9aea1
* Wed Aug 26 2020 Jeff Law <law@redhat.com> - 1:20190801-6
a9aea1
- No longer force C++11
a9aea1
a9aea1
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:20190801-5
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
a9aea1
a9aea1
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:20190801-4
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
a9aea1
a9aea1
* Wed Aug 14 2019 Rex Dieter <rdieter@fedoraproject.org> - 1:20190801-3
a9aea1
- -devel: use epoch in versioned dep
a9aea1
a9aea1
* Wed Aug 14 2019 Rex Dieter <rdieter@fedoraproject.org> - 1:20190801-2
a9aea1
- bump soname
a9aea1
- tighten %%files, track soname explicitly
a9aea1
- use %%make_build %%make_install macros
a9aea1
- Epoch:1 for upgrade path (from f29)
a9aea1
a9aea1
* Sat Aug 03 2019 Lukas Vrabec <lvrabec@redhat.com> - 20190801-1
a9aea1
- update to 20190801
a9aea1
a9aea1
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20160401-9
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
a9aea1
a9aea1
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20160401-8
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
a9aea1
a9aea1
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20160401-7
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a9aea1
a9aea1
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20160401-6
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a9aea1
a9aea1
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20160401-5
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
a9aea1
a9aea1
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20160401-4
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
a9aea1
a9aea1
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20160401-3
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
a9aea1
a9aea1
* Fri Apr 29 2016 Tom Callaway <spot@fedoraproject.org> - 20160401-2
a9aea1
- hardcode -std=c++11 for older compilers
a9aea1
a9aea1
* Fri Apr 29 2016 Tom Callaway <spot@fedoraproject.org> - 20160401-1
a9aea1
- update to 20160401
a9aea1
a9aea1
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 20131024-6
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
a9aea1
a9aea1
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20131024-5
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
a9aea1
a9aea1
* Wed Apr 15 2015 Petr Pisar <ppisar@redhat.com> - 20131024-4
a9aea1
- Rebuild owing to C++ ABI change in GCC-5 (bug #1195351)
a9aea1
a9aea1
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20131024-3
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
a9aea1
a9aea1
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20131024-2
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
a9aea1
a9aea1
* Mon Nov 11 2013 Tom Callaway <spot@fedoraproject.org> - 20131024-1
a9aea1
- update to 20131024
a9aea1
- fix symbols export to stop test from failing
a9aea1
a9aea1
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20130115-3
a9aea1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
a9aea1
a9aea1
* Sun Feb 17 2013 Denis Arnaud <denis.arnaud_fedora@m4x.org> 20130115-2
a9aea1
- Took into account the feedback from review request (#868578).
a9aea1
a9aea1
* Sun Feb 10 2013 Denis Arnaud <denis.arnaud_fedora@m4x.org> 20130115-1
a9aea1
- The download source comes now directly from the project.
a9aea1
a9aea1
* Thu Oct 25 2012 Denis Arnaud <denis.arnaud_fedora@m4x.org> 0.0.0-2
a9aea1
- Took into account review request (#868578) feedback.
a9aea1
a9aea1
* Sat Oct 20 2012 Denis Arnaud <denis.arnaud_fedora@m4x.org> 0.0.0-1
a9aea1
- RPM release for Fedora 18