Blame SPECS/llhttp.spec

rdobuilder 30d276
## START: Set by rpmautospec
rdobuilder 30d276
## (rpmautospec version 0.6.3)
rdobuilder 30d276
## RPMAUTOSPEC: autorelease, autochangelog
rdobuilder 30d276
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
rdobuilder 30d276
    release_number = 1;
rdobuilder 30d276
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
rdobuilder 30d276
    print(release_number + base_release_number - 1);
rdobuilder 30d276
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
rdobuilder 30d276
## END: Set by rpmautospec
rdobuilder 30d276
rdobuilder 30d276
# This package is rather exotic. The compiled library is a typical shared
rdobuilder 30d276
# library with a C API. However, it has only a tiny bit of C source code. Most
rdobuilder 30d276
# of the library is written in TypeScript, which is transpiled to C, via LLVM
rdobuilder 30d276
# IR, using llparse (https://github.com/nodejs/llparse)—all of which happens
rdobuilder 30d276
# within the NodeJS ecosystem.
rdobuilder 30d276
#
rdobuilder 30d276
# The package therefore “builds like” a NodeJS package, and to the extent they
rdobuilder 30d276
# are relevant we apply the NodeJS packaging guidelines. However, the result of
rdobuilder 30d276
# the build “installs like” a traditional C library package and has no NodeJS
rdobuilder 30d276
# dependencies, including bundled ones.
rdobuilder 30d276
#
rdobuilder 30d276
# Furthermore, the package is registered with npm as “llhttp”, but current
rdobuilder 30d276
# releases are not published there, so we use the GitHub archive as the
rdobuilder 30d276
# canonical source and use a custom bundler script based on
rdobuilder 30d276
# nodejs-packaging-bundler to fetch NodeJS build dependencies.
rdobuilder 30d276
#
rdobuilder 30d276
# Overall, we cherry-pick from the standard and NodeJS packaging guidelines as
rdobuilder 30d276
# each seems to best apply, understanding that this package does not fit well
rdobuilder 30d276
# into any of the usual patterns or templates.
rdobuilder 30d276
#
rdobuilder 30d276
# Note that there is now a “release” tarball, e.g.
rdobuilder 30d276
# https://github.com/nodejs/llhttp/archive/refs/tags/release/v%%{version}tar.gz,
rdobuilder 30d276
# that allows this package to be built without the NodeJS/TypeScript machinery.
rdobuilder 30d276
# However, the release archive lacks the original TypeScript source code for
rdobuilder 30d276
# the generated C code, which we would need to include in the source RPM as an
rdobuilder 30d276
# additional source even if we do not do the re-generation ourselves.
rdobuilder 30d276
rdobuilder 30d276
Name:           llhttp
rdobuilder 30d276
Version:        9.2.1
rdobuilder 30d276
%global so_version 9.2
rdobuilder 30d276
Release:        %autorelease
rdobuilder 30d276
Summary:        Port of http_parser to llparse
rdobuilder 30d276
rdobuilder 30d276
# License of llhttp is (SPDX) MIT; nothing from the NodeJS dependency bundle is
rdobuilder 30d276
# installed, so its contents do not contribute to the license of the binary
rdobuilder 30d276
# RPMs, and we do not need a file llhttp-%%{version}-bundled-licenses.txt.
rdobuilder 30d276
License:        MIT
rdobuilder 30d276
URL:            https://github.com/nodejs/llhttp
rdobuilder 30d276
Source0:        %{url}/archive/v%{version}/llhttp-%{version}.tar.gz
rdobuilder 30d276
rdobuilder 30d276
# Based closely on nodejs-packaging-bundler, except:
rdobuilder 30d276
#
rdobuilder 30d276
# - The GitHub source tarball specified in this spec file is used since the
rdobuilder 30d276
#   current version is not typically published on npm
rdobuilder 30d276
# - No production dependency bundle is generated, since none is needed—and
rdobuilder 30d276
#   therefore, no bundled licenses text file is generated either
rdobuilder 30d276
Source1:        llhttp-packaging-bundler
rdobuilder 30d276
# Created with llhttp-packaging-bundler (Source1):
rdobuilder 30d276
Source2:        llhttp-%{version}-nm-dev.tar.zst
rdobuilder 30d276
rdobuilder 30d276
# While nothing in the dev bundle is installed, we still choose to audit for
rdobuilder 30d276
# null licenses at build time and to keep manually-approved exceptions in a
rdobuilder 30d276
# file.
rdobuilder 30d276
Source3:        check-null-licenses
rdobuilder 30d276
Source4:        audited-null-licenses.toml
rdobuilder 30d276
rdobuilder 30d276
# The compiled RPM does not depend on NodeJS at all, but we cannot *build* it
rdobuilder 30d276
# on architectures without NodeJS.
rdobuilder 30d276
ExclusiveArch:  %{nodejs_arches}
rdobuilder 30d276
rdobuilder 30d276
# For generating the C source “release” from TypeScript:
rdobuilder 30d276
BuildRequires:  nodejs-devel
rdobuilder 30d276
BuildRequires:  make
rdobuilder 30d276
rdobuilder 30d276
# For compiling the C library
rdobuilder 30d276
BuildRequires:  cmake
rdobuilder 30d276
BuildRequires:  gcc
rdobuilder 30d276
rdobuilder 30d276
# For tests
rdobuilder 30d276
BuildRequires:  gcc-c++
rdobuilder 30d276
rdobuilder 30d276
# For check-null-licenses
rdobuilder 30d276
BuildRequires:  python3-devel
rdobuilder 30d276
BuildRequires:  (python3dist(tomli) if python3 < 3.11)
rdobuilder 30d276
rdobuilder 30d276
%description
rdobuilder 30d276
This project is a port of http_parser to TypeScript. llparse is used to
rdobuilder 30d276
generate the output C source file, which could be compiled and linked with the
rdobuilder 30d276
embedder's program (like Node.js).
rdobuilder 30d276
rdobuilder 30d276
rdobuilder 30d276
%package devel
rdobuilder 30d276
Summary:        Development files for llhttp
rdobuilder 30d276
rdobuilder 30d276
Requires:       llhttp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
rdobuilder 30d276
rdobuilder 30d276
%description devel
rdobuilder 30d276
The llhttp-devel package contains libraries and header files for
rdobuilder 30d276
developing applications that use llhttp.
rdobuilder 30d276
rdobuilder 30d276
rdobuilder 30d276
%prep
rdobuilder 30d276
%autosetup
rdobuilder 30d276
rdobuilder 30d276
# Remove build flags specifying ISA extensions not in the architectural
rdobuilder 30d276
# baseline from the test fixture setup.
rdobuilder 30d276
sed -r -i 's@([[:blank:]]*)(.*-m(sse4))@\1// \2@' test/fixtures/index.ts
rdobuilder 30d276
rdobuilder 30d276
# We build the library that we install via release/CMakeLists.txt, but the
rdobuilder 30d276
# tests are built via Makefile targets. Don’t apply non-default optimization or
rdobuilder 30d276
# debug flags to the test executables.
rdobuilder 30d276
sed -r -i 's@ -[Og].\b@@g' Makefile
rdobuilder 30d276
rdobuilder 30d276
# Set up bundled (dev) node modules required to generate the C sources from the
rdobuilder 30d276
# TypeScript sources.
rdobuilder 30d276
tar --zstd --extract --file='%{SOURCE2}'
rdobuilder 30d276
mkdir -p node_modules
rdobuilder 30d276
pushd node_modules
rdobuilder 30d276
ln -s ../node_modules_dev/* .
rdobuilder 30d276
ln -s ../node_modules_dev/.bin .
rdobuilder 30d276
popd
rdobuilder 30d276
rdobuilder 30d276
# We run ts-node out of node_modules/.bin rather than using npx (which we will
rdobuilder 30d276
# not have available).
rdobuilder 30d276
sed -r -i 's@\bnpx[[:blank:]](ts-node)\b@node_modules/.bin/\1@' Makefile
rdobuilder 30d276
rdobuilder 30d276
rdobuilder 30d276
%build
rdobuilder 30d276
# Generate the C source “release” from TypeScript using the “node_modules_dev”
rdobuilder 30d276
# bundle.
rdobuilder 30d276
%make_build release RELEASE='%{version}'
rdobuilder 30d276
rdobuilder 30d276
# To help prove that nothing from the bundled NodeJS dev dependencies is
rdobuilder 30d276
# included in the binary packages, remove the “node_modules” symlinks.
rdobuilder 30d276
rm -rvf node_modules
rdobuilder 30d276
rdobuilder 30d276
cd release
rdobuilder 30d276
%cmake
rdobuilder 30d276
%cmake_build
rdobuilder 30d276
rdobuilder 30d276
rdobuilder 30d276
%install
rdobuilder 30d276
cd release
rdobuilder 30d276
%cmake_install
rdobuilder 30d276
rdobuilder 30d276
rdobuilder 30d276
%check
rdobuilder 30d276
# Symlink the NodeJS bundle again so that we can test with Mocha
rdobuilder 30d276
mkdir -p node_modules
rdobuilder 30d276
pushd node_modules
rdobuilder 30d276
ln -s ../node_modules_dev/* .
rdobuilder 30d276
ln -s ../node_modules_dev/.bin .
rdobuilder 30d276
popd
rdobuilder 30d276
rdobuilder 30d276
# Verify that no bundled dev dependency has a null license field, unless we
rdobuilder 30d276
# already audited it by hand. This reduces the chance of accidentally including
rdobuilder 30d276
# code with license problems in the source RPM.
rdobuilder 30d276
%{python3} '%{SOURCE3}' --exceptions '%{SOURCE4}' --with dev node_modules_dev
rdobuilder 30d276
rdobuilder 30d276
%set_build_flags
rdobuilder 30d276
# http-loose-request.c:7205:20: error: invalid conversion from 'void*' to
rdobuilder 30d276
#     'const unsigned char*' [-fpermissive]
rdobuilder 30d276
#  7205 |     start = state->_span_pos0;
rdobuilder 30d276
#       |             ~~~~~~~^~~~~~~~~~
rdobuilder 30d276
#       |                    |
rdobuilder 30d276
#       |                    void*
rdobuilder 30d276
export CXXFLAGS="${CXXFLAGS-} -fpermissive"
rdobuilder 30d276
export CFLAGS="${CFLAGS-} -fpermissive"
rdobuilder 30d276
export CLANG=gcc
rdobuilder 30d276
# See scripts.test in package.json:
rdobuilder 30d276
NODE_ENV=test node -r ts-node/register/type-check ./test/md-test.ts
rdobuilder 30d276
rdobuilder 30d276
rdobuilder 30d276
%files
rdobuilder 30d276
%license release/LICENSE-MIT
rdobuilder 30d276
%{_libdir}/libllhttp.so.%{so_version}{,.*}
rdobuilder 30d276
rdobuilder 30d276
rdobuilder 30d276
%files devel
rdobuilder 30d276
%doc release/README.md
rdobuilder 30d276
%{_includedir}/llhttp.h
rdobuilder 30d276
%{_libdir}/libllhttp.so
rdobuilder 30d276
%{_libdir}/pkgconfig/libllhttp.pc
rdobuilder 30d276
%{_libdir}/cmake/llhttp/
rdobuilder 30d276
rdobuilder 30d276
rdobuilder 30d276
%changelog
rdobuilder 30d276
## START: Generated by rpmautospec
rdobuilder 30d276
* Thu Apr 11 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 9.2.1-1
rdobuilder 30d276
- Update to 9.2.1 (close RHBZ#2273352, fix CVE-2024-27982)
rdobuilder 30d276
- Switch from xz to zstd compression for the “dev” bundle archive
rdobuilder 30d276
rdobuilder 30d276
* Thu Apr 11 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 9.2.0-4
rdobuilder 30d276
- Format check-null-licenses with “ruff format”
rdobuilder 30d276
rdobuilder 30d276
* Thu Apr 11 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 9.2.0-1
rdobuilder 30d276
- Update to 9.2.0 (close RHBZ#2263250)
rdobuilder 30d276
rdobuilder 30d276
* Thu Apr 11 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 9.1.3-2
rdobuilder 30d276
- Compress the dev dependency bundle with xz instead of gzip
rdobuilder 30d276
rdobuilder 30d276
* Thu Nov 30 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 9.1.3-1
rdobuilder 30d276
- Update to 9.1.3 (close RHBZ#2242220)
rdobuilder 30d276
rdobuilder 30d276
* Thu Nov 30 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 9.1.2-1
rdobuilder 30d276
- Update to 9.1.2
rdobuilder 30d276
rdobuilder 30d276
* Thu Nov 30 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 9.1.1-1
rdobuilder 30d276
- Update to 9.1.1
rdobuilder 30d276
rdobuilder 30d276
* Thu Nov 30 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 9.1.0-1
rdobuilder 30d276
- Update to 9.1.0
rdobuilder 30d276
rdobuilder 30d276
* Thu Nov 30 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 9.0.1-1
rdobuilder 30d276
- Update to 9.0.1 (close RHBZ#2228290)
rdobuilder 30d276
rdobuilder 30d276
* Thu Nov 30 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 9.0.0-1
rdobuilder 30d276
- Update to 9.0.0
rdobuilder 30d276
rdobuilder 30d276
* Sat Jul 29 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 8.1.1-1
rdobuilder 30d276
- Update to 8.1.1 (close RHBZ#2216591)
rdobuilder 30d276
rdobuilder 30d276
* Sat Jul 29 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 8.1.0-3
rdobuilder 30d276
- Fix test compiling/execution
rdobuilder 30d276
rdobuilder 30d276
* Sat Jul 29 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 8.1.0-2
rdobuilder 30d276
- Indicate dirs. in files list with trailing slashes
rdobuilder 30d276
rdobuilder 30d276
* Sat Jul 29 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 8.1.0-1
rdobuilder 30d276
- Update to 8.1.0 (close RHBZ#2131175)
rdobuilder 30d276
rdobuilder 30d276
* Sat Jul 29 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 8.0.0-1
rdobuilder 30d276
- Update to 8.0.0 (close RHBZ#2131175)
rdobuilder 30d276
rdobuilder 30d276
* Sat Jul 29 2023 Stephen Gallagher <sgallagh@redhat.com> - 6.0.10-1
rdobuilder 30d276
- Update to v6.0.10
rdobuilder 30d276
rdobuilder 30d276
* Sat Jul 29 2023 Miro Hrončok <miro@hroncok.cz> - 6.0.9-2
rdobuilder 30d276
- Use tomllib/python-tomli instead of dead upstream python-toml
rdobuilder 30d276
rdobuilder 30d276
* Sat Jul 29 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 6.0.9-1
rdobuilder 30d276
- Update to 6.0.9 (close RHBZ#2116231)
rdobuilder 30d276
- Bumped .so version from downstream 0.1 to upstream 6.0
rdobuilder 30d276
- Better upstream support for building and installing a shared library
rdobuilder 30d276
- The -devel package now contains a .pc file
rdobuilder 30d276
- Tests are now built with gcc and fully respect distro flags
rdobuilder 30d276
rdobuilder 30d276
* Sat Jul 29 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 6.0.6-6
rdobuilder 30d276
- Drop “forge” macros, which aren’t really doing much here
rdobuilder 30d276
rdobuilder 30d276
* Fri Dec 24 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 6.0.6-5
rdobuilder 30d276
- Add a note about LLHTTP_STRICT_MODE to the package description
rdobuilder 30d276
rdobuilder 30d276
* Fri Dec 24 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 6.0.6-4
rdobuilder 30d276
- Revert "Build with LLHTTP_STRICT_MODE enabled"
rdobuilder 30d276
rdobuilder 30d276
* Wed Dec 22 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 6.0.6-3
rdobuilder 30d276
- Build with LLHTTP_STRICT_MODE enabled
rdobuilder 30d276
rdobuilder 30d276
* Tue Dec 14 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 6.0.6-2
rdobuilder 30d276
- Dep. on cmake-filesystem is now auto-generated
rdobuilder 30d276
rdobuilder 30d276
* Mon Dec 06 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 6.0.6-1
rdobuilder 30d276
- Initial package (close RHBZ#2029461)
rdobuilder 30d276
## END: Generated by rpmautospec