summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--sources1
-rw-r--r--swoole-5.1.3-fix-brotli-libname.patch18
-rw-r--r--swoole.spec89
4 files changed, 109 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..45f6b57 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/swoole-5.1.3.tgz
diff --git a/sources b/sources
new file mode 100644
index 0000000..f933279
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+199ab2fc774f8087cbbf72b031be4cbc swoole-5.1.3.tgz
diff --git a/swoole-5.1.3-fix-brotli-libname.patch b/swoole-5.1.3-fix-brotli-libname.patch
new file mode 100644
index 0000000..103da1e
--- /dev/null
+++ b/swoole-5.1.3-fix-brotli-libname.patch
@@ -0,0 +1,18 @@
+--- a/config.m4.orig 2024-07-31 23:13:08.753608500 +0800
++++ b/config.m4 2024-07-31 23:13:27.803723100 +0800
+@@ -842,7 +842,6 @@
+ if test "$PHP_BROTLI" != "no" || test "$PHP_BROTLI_DIR" != "no"; then
+ if test "$PHP_BROTLI_DIR" != "no"; then
+ PHP_ADD_INCLUDE("${PHP_BROTLI_DIR}/include")
+- PHP_ADD_LIBRARY_WITH_PATH(brotli, "${PHP_BROTLI_DIR}/${PHP_LIBDIR}")
+ PHP_ADD_LIBRARY_WITH_PATH(brotlienc, "${PHP_BROTLI_DIR}/${PHP_LIBDIR}")
+ PHP_ADD_LIBRARY_WITH_PATH(brotlidec, "${PHP_BROTLI_DIR}/${PHP_LIBDIR}")
+ else
+@@ -981,7 +980,6 @@
+ AC_DEFINE(SW_HAVE_COMPRESSION, 1, [have compression])
+ AC_DEFINE(SW_HAVE_BROTLI, 1, [have brotli encoder])
+ PHP_ADD_INCLUDE("${PHP_BROTLI_DIR}/include")
+- PHP_ADD_LIBRARY_WITH_PATH(brotli, "${PHP_BROTLI_DIR}/${PHP_LIBDIR}")
+ PHP_ADD_LIBRARY_WITH_PATH(brotlienc, "${PHP_BROTLI_DIR}/${PHP_LIBDIR}")
+ PHP_ADD_LIBRARY_WITH_PATH(brotlidec, "${PHP_BROTLI_DIR}/${PHP_LIBDIR}")
+ fi
diff --git a/swoole.spec b/swoole.spec
new file mode 100644
index 0000000..9819e9a
--- /dev/null
+++ b/swoole.spec
@@ -0,0 +1,89 @@
+%global ini_name 40-swoole.ini
+
+Name: swoole
+Version: 5.1.3
+Release: 1
+Summary: Event-driven asynchronous and concurrent networking engine with high performance for PHP
+License: Apache 2.0
+URL: https://www.swoole.com/
+Source0: https://github.com/swoole/swoole-src/releases/download/v%{version}/%{name}-%{version}.tgz
+Patch0: swoole-5.1.3-fix-brotli-libname.patch
+BuildRequires: php(language) >= 8.0
+BuildRequires: php-cli >= 8.0
+BuildRequires: php-devel
+BuildRequires: openssl-devel >= 1.0.2
+BuildRequires: curl-devel
+BuildRequires: c-ares-devel
+BuildRequires: libnghttp2-devel
+BuildRequires: pkgconfig(libbrotlienc)
+BuildRequires: pkgconfig(libbrotlidec)
+BuildRequires: libpq-devel
+Requires: php(api) = %{php_core_api}
+Requires: php-curl
+
+%description
+Event-driven asynchronous and concurrent networking engine with high performance for PHP.
+ - event-driven
+ - coroutine
+ - asynchronous non-blocking
+ - multi-thread reactor
+ - multi-process worker
+ - multi-protocol
+ - millisecond timer
+ - built-in tcp/http/websocket/http2 server
+ - coroutine tcp/http/websocket client
+ - coroutine mysql client
+ - coroutine redis client
+ - coroutine read/write file system
+ - coroutine dns lookup
+ - support IPv4/IPv6/UnixSocket/TCP/UDP
+ - support SSL/TLS encrypted transmission
+
+%package devel
+Summary: Development files for %{name}
+Requires: %{name} = %{version}
+Requires: php-devel >= 8.0
+
+%description devel
+Development files for %{name}.
+
+%prep
+%autosetup -p1 -n %{name}-%{version}
+
+# Drop in the bit of configuration
+cat << 'EOF' | tee %{ini_name}
+; Enable swoole extension module
+extension = swoole.so
+EOF
+
+%build
+%{_bindir}/phpize
+%configure \
+ --enable-openssl \
+ --with-openssl-dir=%{_prefix} \
+ --enable-brotli \
+ --enable-cares \
+ --enable-swoole-curl \
+ --with-nghttp2-dir=%{_prefix} \
+ --enable-swoole-pgsql
+%make_build
+
+%install
+%make_install INSTALL_ROOT=%{buildroot}
+
+install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
+
+%files
+%license LICENSE
+%{php_inidir}/%{ini_name}
+%{_libdir}/php/modules/swoole.so
+
+%files devel
+%{_includedir}/php/ext/swoole
+
+%changelog
+* Wed Jul 31 2024 Funda Wang <fundawang@yeah.net> - 5.1.3-1
+- update to version 5.1.3
+
+* Mon Aug 21 2023 Funda Wang <fundawang@yeah.net> - 5.0.3-1
+- Import package