summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-10-28 08:01:33 +0000
committerCoprDistGit <infra@openeuler.org>2026-10-28 08:01:33 +0000
commit859e9edcc3887ef7d6d569b476e970032a2c55ab (patch)
treed609aa012b875f659e9c88a0e5fcbaed234b3670
parentfb14c3cfa4108eb2a97318f2a81c83d557b2e8db (diff)
automatic import of opennjetopeneuler24.03_LTS_SP4
-rw-r--r--.gitignore1
-rw-r--r--fix-cmake4.patch67
-rw-r--r--fix-llhttp-avail.patch19
-rw-r--r--opennjet.spec136
-rw-r--r--sources2
5 files changed, 95 insertions, 130 deletions
diff --git a/.gitignore b/.gitignore
index 4c5dd44..945f513 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/v4.0.2.0.tar.gz
+/opennjet-4.0.2.0.tar.gz
diff --git a/fix-cmake4.patch b/fix-cmake4.patch
deleted file mode 100644
index 41e481e..0000000
--- a/fix-cmake4.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-diff -Naur a/auto/lib/librdkafka/CMakeLists.txt b/auto/lib/librdkafka/CMakeLists.txt
---- a/auto/lib/librdkafka/CMakeLists.txt 2026-01-06 08:22:00.000000000 +0800
-+++ b/auto/lib/librdkafka/CMakeLists.txt 2026-10-20 16:47:45.152208900 +0800
-@@ -1,4 +1,4 @@
--cmake_minimum_required(VERSION 3.2)
-+cmake_minimum_required(VERSION 3.5)
-
- include("packaging/cmake/parseversion.cmake")
- parseversion("src/rdkafka.h")
-diff -Naur a/auto/lib/luapkg/resty-cjson/CMakeLists.txt b/auto/lib/luapkg/resty-cjson/CMakeLists.txt
---- a/auto/lib/luapkg/resty-cjson/CMakeLists.txt 2026-01-06 08:22:00.000000000 +0800
-+++ b/auto/lib/luapkg/resty-cjson/CMakeLists.txt 2026-10-20 16:47:45.214731000 +0800
-@@ -4,7 +4,7 @@
- # Windows: set LUA_DIR=c:\lua51
-
- project(lua-cjson C)
--cmake_minimum_required(VERSION 2.6)
-+cmake_minimum_required(VERSION 3.5)
-
- option(USE_INTERNAL_FPCONV "Use internal strtod() / g_fmt() code for performance")
- option(MULTIPLE_THREADS "Support multi-threaded apps with internal fpconv - recommended" ON)
-diff -Naur a/auto/lib/mariadb/CMakeLists.txt b/auto/lib/mariadb/CMakeLists.txt
---- a/auto/lib/mariadb/CMakeLists.txt 2026-01-06 08:22:00.000000000 +0800
-+++ b/auto/lib/mariadb/CMakeLists.txt 2026-10-20 16:47:45.281937900 +0800
-@@ -2,7 +2,7 @@
-
- # This is the LGPL libmariadb project.
-
--CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
-+CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
- INCLUDE(CheckFunctionExists)
- IF(COMMAND CMAKE_POLICY)
- SET(NEW_POLICIES CMP0003 CMP0022 CMP0023 CMP0077 CMP0069 CMP0075)
-diff -Naur a/auto/lib/mariadb/external/zlib/ucm.cmake b/auto/lib/mariadb/external/zlib/ucm.cmake
---- a/auto/lib/mariadb/external/zlib/ucm.cmake 2026-01-06 08:22:00.000000000 +0800
-+++ b/auto/lib/mariadb/external/zlib/ucm.cmake 2026-10-20 16:47:45.317401100 +0800
-@@ -10,7 +10,7 @@
- # The documentation can be found at the library's page:
- # https://github.com/onqtam/ucm
-
--cmake_minimum_required(VERSION 2.8.12)
-+cmake_minimum_required(VERSION 3.5)
-
- include(CMakeParseArguments)
-
-diff -Naur a/auto/lib/njetmq/CMakeLists.txt b/auto/lib/njetmq/CMakeLists.txt
---- a/auto/lib/njetmq/CMakeLists.txt 2026-01-06 08:22:00.000000000 +0800
-+++ b/auto/lib/njetmq/CMakeLists.txt 2026-10-20 16:47:45.187713400 +0800
-@@ -4,7 +4,7 @@
- # To configure the build options either use the CMake gui, or run the command
- # line utility including the "-i" option.
-
--cmake_minimum_required(VERSION 3.0)
-+cmake_minimum_required(VERSION 3.5)
- cmake_policy(SET CMP0042 NEW)
-
- project(mosquitto)
-diff -Naur a/auto/lib/tcc-0.9.26/CMakeLists.txt b/auto/lib/tcc-0.9.26/CMakeLists.txt
---- a/auto/lib/tcc-0.9.26/CMakeLists.txt 2026-01-06 08:22:00.000000000 +0800
-+++ b/auto/lib/tcc-0.9.26/CMakeLists.txt 2026-10-20 16:47:45.242129000 +0800
-@@ -1,5 +1,5 @@
- project(tcc C)
--cmake_minimum_required(VERSION 2.6)
-+cmake_minimum_required(VERSION 3.5)
- enable_testing()
-
- # Detect native platform
diff --git a/fix-llhttp-avail.patch b/fix-llhttp-avail.patch
deleted file mode 100644
index ee82b2b..0000000
--- a/fix-llhttp-avail.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -Naur a/modules/njet-stream-ws-module/src/http/llhttp.c b/modules/njet-stream-ws-module/src/http/llhttp.c
---- a/modules/njet-stream-ws-module/src/http/llhttp.c 2026-01-06 08:22:00.000000000 +0800
-+++ b/modules/njet-stream-ws-module/src/http/llhttp.c 2026-10-20 17:23:34.977025300 +0800
-@@ -2632,7 +2632,6 @@
- if (endp - p >= 16) {
- __m128i ranges;
- __m128i input;
-- int avail;
- int match_len;
-
- /* Load input */
-@@ -2862,7 +2861,6 @@
- if (endp - p >= 16) {
- __m128i ranges;
- __m128i input;
-- int avail;
- int match_len;
-
- /* Load input */
diff --git a/opennjet.spec b/opennjet.spec
index 03a559f..88651d7 100644
--- a/opennjet.spec
+++ b/opennjet.spec
@@ -1,36 +1,89 @@
-Name: opennjet
-Version: 4.0.2.0
-Release: 1%{?dist}
-
-Summary: OpenNJet Application Engine
-License: MulanPSL-2.0
-URL: https://gitee.com/njet-rd/njet
-
-SOURCE0: https://github.com/OpenNJet/OpenNJet/archive/refs/tags/v%{version}.tar.gz
-Patch0: fix-cmake4.patch
-Patch1: fix-llhttp-avail.patch
-
-Requires(pre): shadow-utils
-BuildRequires: systemd make gcc gcc-c++ vim-common m4 autoconf automake cmake zlib-devel openssl-devel pcre-devel libtool libtool-ltdl pkgconfig patch
+# topdir: opennjet-4.0.2.0
+# OpenNJet is an nginx-derived application engine for cloud-native applications.
+# Built via upstream build_cc.sh which bundles tongsuo/openssl, luajit, pcre, etc.
+# Binary and service retain upstream name "njet"; package name is "opennjet".
+
+Name: opennjet
+Version: 4.0.2.0
+Release: 1%{?dist}
+Summary: OpenNJet Application Engine - nginx-derived cloud-native runtime
+
+License: MulanPSL-2.0
+URL: https://github.com/OpenNJet/OpenNJet
+Source0: https://github.com/OpenNJet/OpenNJet/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
+
+Group: System Environment/Daemons
+Packager: openEuler Builder <builder@openeuler.org>
+
+BuildRequires: gcc
+BuildRequires: gcc-c++
+BuildRequires: make
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
+BuildRequires: libtool-ltdl-devel
+BuildRequires: m4
+BuildRequires: cmake
+BuildRequires: perl
+BuildRequires: pkgconfig
+BuildRequires: vim-common
+BuildRequires: pcre-devel
+BuildRequires: zlib-devel
+BuildRequires: openssl-devel
+BuildRequires: systemd
+
+Requires(pre): shadow-utils
+Requires(post): systemd
+Requires(post): libcap
+Requires(preun): systemd
+Requires(postun): systemd
%description
-OpenNJet 应用引擎是基于 NGINX 的面向互联网和云原生应用提供的运行时组态服务程序,作为底层引擎,OpenNJet 实现了NGINX 云原生功能增强、安全加固和代码重构,利用动态加载机制可以实现不同的产品形态,如Web服务器、流媒体服务器、负载均衡、代理(Proxy)、应用中间件、API网关、消息队列等产品形态等等。
+OpenNJet is a high-performance, lightweight web application and proxy software.
+As a cloud-native service mesh data plane, NJet provides dynamic configuration
+loading, active health checks, cluster high availability, and declarative API.
+Through the CoPilot co-pilot service framework, it achieves high extensibility
+while isolating control plane and data plane.
+
+OpenNJet 应用引擎是基于 NGINX 的面向互联网和云原生应用提供的运行时组态服务程序,
+作为底层引擎,OpenNJet 实现了 NGINX 云原生功能增强、安全加固和代码重构,
+利用动态加载机制可以实现不同的产品形态,如 Web 服务器、流媒体服务器、负载均衡、
+代理(Proxy)、应用中间件、API 网关、消息队列等产品形态。
%prep
-%autosetup -p1 -n OpenNJet-%{version}
+%autosetup -n %{name}-%{version}
%build
-sed -i 's/--strict-warnings//g' ./build_cc.sh && ./build_cc.sh conf && make -j `nproc`
+# Remove --strict-warnings from openssl build options (compiler compatibility)
+sed -i 's/--strict-warnings//g' ./build_cc.sh
+
+# Configure (bundles tongsuo/openssl, luajit, etc. from auto/lib/)
+./build_cc.sh conf
+
+# Build njet main binary
+make -j $(nproc)
+
+# Build auxiliary tools (agw_passwd, etc.)
make tools
+
+# Compile lua scripts to bytecode and shared objects
./build_lua.sh
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/local/njet/{apps,logs,data,modules,lib/tcc,sbin,lualib/lib,lualib/clib}
mkdir -p %{buildroot}/var/log/njet/logs
+
+# Install njet binary, libraries, and bundled components
DESTDIR=%{buildroot} ./build_cc.sh install
+
+# Copy pre-built configuration files and systemd unit from upstream rpm layout
cp -a build/rpm/njet.conf.files/* %{buildroot}
+
+# Remove static libraries from lib/ (preserve lib/tcc/*.a needed at runtime)
rm -f %{buildroot}/usr/local/njet/lib/*.a
+
+# Copy compiled lua bytecode modules
cp -a objs/scripts/so/* %{buildroot}/usr/local/njet/lualib/clib/
rm -rf objs/scripts/so
cp -a objs/scripts/* %{buildroot}/usr/local/njet/modules/
@@ -46,35 +99,44 @@ if [ "$1" -eq 1 ]; then
fi
%post
-
-grep -q /usr/local/lib /etc/ld.so.conf
-
+grep -q /usr/local/lib /etc/ld.so.conf 2>/dev/null
if [ $? != 0 ] ; then
echo "/usr/local/lib" >> /etc/ld.so.conf
fi
-/bin/chmod a+x /usr/local/njet/sbin/agw_passwd
-/usr/local/njet/sbin/agw_passwd /usr/local/njet/apigw_data/api_gateway.db
+if [ -x /usr/local/njet/sbin/agw_passwd ]; then
+ /bin/chmod a+x /usr/local/njet/sbin/agw_passwd
+ /usr/local/njet/sbin/agw_passwd /usr/local/njet/apigw_data/api_gateway.db || true
+fi
ldconfig
+systemctl daemon-reload || true
+systemctl enable njet.service || true
-systemctl daemon-reload
-systemctl enable njet.service
-
-/usr/sbin/setcap cap_dac_override,cap_dac_read_search,cap_net_bind_service,cap_net_admin,cap_net_raw,cap_setuid=eip /usr/local/njet/sbin/njet
+if [ -x /usr/sbin/setcap ] && [ -x /usr/local/njet/sbin/njet ]; then
+ /usr/sbin/setcap cap_dac_override,cap_dac_read_search,cap_net_bind_service,cap_net_admin,cap_net_raw,cap_setuid=eip /usr/local/njet/sbin/njet || true
+fi
%preun
-systemctl stop njet.service >/dev/null 2>&1
-systemctl disable njet.service
-systemctl daemon-reload
+if [ "$1" -eq 0 ]; then
+ systemctl stop njet.service >/dev/null 2>&1 || true
+ systemctl disable njet.service || true
+ systemctl daemon-reload || true
+fi
%postun
+if [ "$1" -ge 1 ]; then
+ systemctl daemon-reload || true
+fi
+ldconfig 2>/dev/null || true
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
+%license LICENSE
+%doc README.md CHANGES NOTICE
/etc/systemd/system/njet.service.d/filelimit.conf
/etc/ld.so.conf.d/njet.conf
%{_unitdir}/njet.service
@@ -89,17 +151,5 @@ rm -rf %{buildroot}
%config(noreplace) /usr/local/njet/html/index.html
%changelog
-* Wed Oct 21 2026 unac <1317113781@qq.com> - 4.0.2.0-1
-- update to 4.0.2.0
-
-* Fri Dec 29 2023 hongxina <hongxina@tmlake.com> - 2.0.0-1
-- update to 2.0.0
-
-* Wed Nov 8 2023 hongxina <hongxina@tmlake.com> - 1.2.3-1
-- update to 1.2.3
-
-* Wed Oct 18 2023 hongxina <hongxina@tmlake.com> - 1.2.2-1
-- DESC: update to 1.2.2-1
-
-* Tue Aug 15 2023 hongxina <hongxina@tmlake.com> - 1.1.2-1
-- init
+* Wed Oct 28 2026 openEuler Builder <builder@openeuler.org> - 4.0.2.0-1
+- Initial package for openEuler based on OpenNJet 4.0.2.0
diff --git a/sources b/sources
index d52b44c..0ba97e5 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-63a3327fdd1e435062657d7bf0c8e4f1 v4.0.2.0.tar.gz
+91cf53f4d782169851d71fae3d7bcf16 opennjet-4.0.2.0.tar.gz