summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-10-28 07:52:19 +0000
committerCoprDistGit <infra@openeuler.org>2026-10-28 07:52:19 +0000
commitfb14c3cfa4108eb2a97318f2a81c83d557b2e8db (patch)
tree827e689b96d532fdd7eaeaa9019282a9fed392ce
parent5b0992ee3bc8ef829bbfd29d3164b90634ace3bd (diff)
automatic import of opennjet
-rw-r--r--.gitignore1
-rw-r--r--fix-cmake4.patch67
-rw-r--r--fix-llhttp-avail.patch19
-rw-r--r--opennjet.spec105
-rw-r--r--sources1
5 files changed, 193 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..4c5dd44 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/v4.0.2.0.tar.gz
diff --git a/fix-cmake4.patch b/fix-cmake4.patch
new file mode 100644
index 0000000..41e481e
--- /dev/null
+++ b/fix-cmake4.patch
@@ -0,0 +1,67 @@
+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
new file mode 100644
index 0000000..ee82b2b
--- /dev/null
+++ b/fix-llhttp-avail.patch
@@ -0,0 +1,19 @@
+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
new file mode 100644
index 0000000..03a559f
--- /dev/null
+++ b/opennjet.spec
@@ -0,0 +1,105 @@
+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
+
+%description
+OpenNJet 应用引擎是基于 NGINX 的面向互联网和云原生应用提供的运行时组态服务程序,作为底层引擎,OpenNJet 实现了NGINX 云原生功能增强、安全加固和代码重构,利用动态加载机制可以实现不同的产品形态,如Web服务器、流媒体服务器、负载均衡、代理(Proxy)、应用中间件、API网关、消息队列等产品形态等等。
+
+%prep
+%autosetup -p1 -n OpenNJet-%{version}
+
+%build
+sed -i 's/--strict-warnings//g' ./build_cc.sh && ./build_cc.sh conf && make -j `nproc`
+make tools
+./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
+DESTDIR=%{buildroot} ./build_cc.sh install
+cp -a build/rpm/njet.conf.files/* %{buildroot}
+rm -f %{buildroot}/usr/local/njet/lib/*.a
+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/
+
+%pre
+if [ "$1" -eq 1 ]; then
+ if ! getent group njet >/dev/null 2>&1; then
+ /usr/sbin/groupadd njet
+ fi
+ if ! getent passwd njet >/dev/null 2>&1; then
+ /usr/sbin/useradd njet -g njet -M -s /sbin/nologin
+ fi
+fi
+
+%post
+
+grep -q /usr/local/lib /etc/ld.so.conf
+
+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
+
+ldconfig
+
+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
+
+%preun
+systemctl stop njet.service >/dev/null 2>&1
+systemctl disable njet.service
+systemctl daemon-reload
+
+%postun
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+/etc/systemd/system/njet.service.d/filelimit.conf
+/etc/ld.so.conf.d/njet.conf
+%{_unitdir}/njet.service
+%attr(-,njet,njet) /usr/local/njet/
+%attr(777,njet,njet) /var/log/njet/logs/
+
+%config(noreplace) /usr/local/njet/conf/ctrl_kv.conf
+%config(noreplace) /usr/local/njet/conf/goaccess.conf
+%config(noreplace) /usr/local/njet/conf/njet.conf
+%config(noreplace) /usr/local/njet/conf/njet_ctrl.conf
+%config(noreplace) /usr/local/njet/html/50x.html
+%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
diff --git a/sources b/sources
new file mode 100644
index 0000000..d52b44c
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+63a3327fdd1e435062657d7bf0c8e4f1 v4.0.2.0.tar.gz