summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--njs.spec69
1 files changed, 61 insertions, 8 deletions
diff --git a/njs.spec b/njs.spec
index c76f8f9..649e829 100644
--- a/njs.spec
+++ b/njs.spec
@@ -7,23 +7,35 @@
# Please, preserve the changelog entries
#
+# to disable upstream test suite
%bcond_without tests
-# require ONLINE build for sources download
+
+# to disable QuickJS engine
+%bcond_without quickjs
+
+# to enable WASM, require ONLINE build for sources download
%bcond_with wasm
%global gh_owner nginx
%global project njs
-%global gh_commit 9d4bf6c60aa60a828609f64d1b5c50f71bb7ef62
+%global gh_commit c5a29a7af8894ee1ec44ebda71ef0ea1f2a31af6
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global qjs_owner bellard
+%global qjs_project quickjs
+%global qjs_commit 6e2e68fd0896957f92eb6c242a2e048c1ef3cae0
+%global qjs_short %(c=%{qjs_commit}; echo ${c:0:7})
+
+
Name: %{project}
Summary: NGINX JavaScript
-Version: 0.8.5
+Version: 0.8.6
Release: 1%{?dist}
License: BSD-2-Clause
URL: https://github.com/%{gh_owner}/%{project}
Source0: https://github.com/%{gh_owner}/%{project}/archive/%{gh_commit}/%{project}-%{version}-%{gh_short}.tar.gz
+Source1: https://github.com/%{qjs_owner}/%{qjs_project}/archive/%{qjs_commit}/%{qjs_project}-%{qjs_short}.tar.gz
BuildRequires: make
BuildRequires: gcc
@@ -36,6 +48,10 @@ BuildRequires: libedit-devel
# For tests
BuildRequires: expect
+%if %{with quickjs}
+Provides: bundled(libquickjs)
+%endif
+
%description
NGINX JavaScript (njs).
@@ -58,13 +74,38 @@ Library and include files required for libnjs.
%prep
+%if %{with quickjs}
+: RPM build with QuickJS
+%setup -qn %{project}-%{gh_commit} -a1
+mv %{qjs_project}-%{qjs_commit} quickjs
+
+%else
+: RPM build without QuickJS
%setup -qn %{project}-%{gh_commit}
+%endif
%build
-./configure
+%if %{with quickjs}
+pushd quickjs
+CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" %make_build libquickjs.a
+popd
+
+./configure \
+ --with-quickjs \
+ --cc-opt="$RPM_OPT_FLAGS -Iquickjs" \
+ --ld-opt="$RPM_LD_FLAGS -Lquickjs"
-make %{?_smp_mflags}
+%else
+
+./configure \
+ --no-quickjs \
+ --cc-opt="$RPM_OPT_FLAGS" \
+ --ld-opt="$RPM_LD_FLAGS"
+
+%endif
+
+%make_build
make pc
# Fix pkgconfig
@@ -75,16 +116,22 @@ sed -e '/^prefix/s|=.*$|=%{_prefix}|' \
%install
-# Library
+: Library
install -dm 0755 %{buildroot}%{_includedir}/njs/
install -pm 0644 */njs*.h %{buildroot}%{_includedir}/njs/
install -dm 0755 %{buildroot}%{_libdir}/pkgconfig
install -pm 0755 build/libnjs.a %{buildroot}%{_libdir}
install -pm 0755 build/njs.pcx %{buildroot}%{_libdir}/pkgconfig/njs.pc
-# Command
+
+: Command
install -dm 0755 %{buildroot}%{_bindir}
install -pm 0755 build/njs %{buildroot}%{_bindir}
+%if %{with quickjs}
+: QuickJS
+install -pm 0755 build/libqjs.a %{buildroot}%{_libdir}
+%endif
+
%if %{with tests}
%check
@@ -93,7 +140,6 @@ make test %{?_smp_mflags}
%files
-%{!?_licensedir:%global license %%doc}
%license LICENSE
%{_bindir}/njs
@@ -103,9 +149,16 @@ make test %{?_smp_mflags}
%{_libdir}/libnjs.a
%{_includedir}/njs
%{_libdir}/pkgconfig/njs.pc
+%if %{with quickjs}
+%{_libdir}/libqjs.a
+%endif
%changelog
+* Wed Oct 2 2024 Remi Collet <remi@remirepo.net> - 0.8.6-1
+- update to 0.8.6
+- enable QuickJS engine
+
* Wed Jul 3 2024 Remi Collet <remi@remirepo.net> - 0.8.5-1
- update to 0.8.5