From 8555782f58394d620fda52b77a8e228ee435b327 Mon Sep 17 00:00:00 2001 From: ebasov Date: Wed, 6 Nov 2024 11:04:35 +0300 Subject: [PATCH 1/2] add php build --- .gitignore | 7 +++--- .openlitespeed.metadata | 5 ++-- SOURCES/add-build-admin-php.patch | 40 +++++++++++++++++++++++++++++++ SPECS/openlitespeed.spec | 20 +++++++++++----- 4 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 SOURCES/add-build-admin-php.patch diff --git a/.gitignore b/.gitignore index 785503c..277a051 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ -SOURCES/openlitespeed-1.8.2.tar.gz -SOURCES/third-party.tar.xz -SOURCES/admin_php.tar.xz SOURCES/ls-hpack-2.3.3.tar.gz SOURCES/ls-qpack-2.5.4.tar.gz SOURCES/lsquic-4.0.12.tar.gz +SOURCES/openlitespeed-1.8.2.tar.gz +SOURCES/php-7.4.33.tar.gz +SOURCES/php-litespeed-8.1.tgz +SOURCES/third-party.tar.xz diff --git a/.openlitespeed.metadata b/.openlitespeed.metadata index d38c93b..f26767a 100644 --- a/.openlitespeed.metadata +++ b/.openlitespeed.metadata @@ -1,6 +1,7 @@ -b737416510aafc37fc2e1cf0f64b57b66f1db854 SOURCES/admin_php.tar.xz 343f961c9b93d36b4a8874f9fbf9e3087b0e7e00 SOURCES/ls-hpack-2.3.3.tar.gz 8ad5b9c2da97e40a0efc1927def334957ea14c58 SOURCES/ls-qpack-2.5.4.tar.gz ea49cda7da4b07fe1cfd14d3c29f2232616c461c SOURCES/lsquic-4.0.12.tar.gz -068b78e67475debd2321fed6195989dad28dad43 SOURCES/openlitespeed-1.8.2.tar.gz +d7e14705c3909dd7218a686a4836f50a56810eea SOURCES/openlitespeed-1.8.2.tar.gz +7c29812c51880390b74a5b23f0afe61e3b374645 SOURCES/php-7.4.33.tar.gz +6c6cca5a290041a312c3d0c7e9a1fa925f47fa7c SOURCES/php-litespeed-8.1.tgz 63ea80ec5e804e3b06cbe1d88ee300d08208719b SOURCES/third-party.tar.xz diff --git a/SOURCES/add-build-admin-php.patch b/SOURCES/add-build-admin-php.patch new file mode 100644 index 0000000..ad61dc2 --- /dev/null +++ b/SOURCES/add-build-admin-php.patch @@ -0,0 +1,40 @@ +diff --git a/dist/admin/misc/build_admin_php.sh b/dist/admin/misc/build_admin_php.sh +index 0edb3d4..623e55b 100755 +--- a/dist/admin/misc/build_admin_php.sh ++++ b/dist/admin/misc/build_admin_php.sh +@@ -13,7 +13,6 @@ LSWS_HOME=`dirname $BASE_DIR` + PATH=$PATH + PHP_VERSION=7.4.33 + PHP_BUILD_DIR=$LSWS_HOME/phpbuild +-mkdir ${PHP_BUILD_DIR} + LOG_FILE=${PHP_BUILD_DIR}/adminphp.log + + # detect download method +@@ -35,7 +34,7 @@ else + fi + + LSAPI_VERSION=8.1 +-PHP_CONF_OPTIONS="--prefix=/tmp --disable-all --with-litespeed --enable-session --enable-posix --enable-xml --with-libexpat-dir=/usr --with-zlib --enable-sockets --enable-bcmath --enable-json" ++PHP_CONF_OPTIONS="--prefix=/tmp --disable-all --enable-litespeed --enable-session --enable-posix --enable-xml --libdir=/usr/lib64 --with-zlib --enable-sockets --enable-bcmath --enable-json --with-libxml" + + PLF=`uname -p` + if [ "x$PLF" = "xx86_64" ] ; then +diff --git a/dist/install.sh b/dist/install.sh +index acd4a94..b4a422f 100755 +--- a/dist/install.sh ++++ b/dist/install.sh +@@ -33,11 +33,11 @@ inst_admin_php() + + if [ "x$OS" = "xLinux" ] ; then + if [ "x$ARCH" = "xx86_64" ] ; then +- mv $TEMPDIR/admin/fcgi-bin/admin_php $LSWS_HOME/admin/fcgi-bin/ ++ mv $TEMPDIR/admin/fcgi-bin/admin_php-7.4.33 $LSWS_HOME/admin/fcgi-bin/admin_php + elif [ "x$ARCH" = "xaarch64" ] ; then +- $DLCMD $LSWS_HOME/admin/fcgi-bin/admin_php http://www.litespeedtech.com/packages/lsphp7_bin/aarch64/lsphp ++ mv $TEMPDIR/admin/fcgi-bin/admin_php-7.4.33 $LSWS_HOME/admin/fcgi-bin/admin_php + else +- $DLCMD $LSWS_HOME/admin/fcgi-bin/admin_php http://www.litespeedtech.com/packages/lsphp5_bin/i386/lsphp5 ++ mv $TEMPDIR/admin/fcgi-bin/admin_php-7.4.33 $LSWS_HOME/admin/fcgi-bin/admin_php + fi + + if [ $? = 0 ] ; then diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 6eb73dc..ad5c18e 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -2,7 +2,7 @@ Name: openlitespeed Version: 1.8.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. License: GPLv3+ Url: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -11,10 +11,12 @@ Source0: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{ Source1: third-party.tar.xz Source2: https://github.com/litespeedtech/lsquic/archive/refs/tags/v4.0.12.tar.gz#/lsquic-4.0.12.tar.gz Source3: https://github.com/litespeedtech/ls-hpack/archive/refs/tags/v2.3.3.tar.gz#/ls-hpack-2.3.3.tar.gz -Source4: admin_php.tar.xz -Source5: https://github.com/litespeedtech/ls-qpack/archive/refs/tags/v2.5.4.tar.gz#/ls-qpack-2.5.4.tar.gz +Source4: http://us1.php.net/distributions/php-7.4.33.tar.gz +Source5: http://www.litespeedtech.com/packages/lsapi/php-litespeed-8.1.tgz +Source6: https://github.com/litespeedtech/ls-qpack/archive/refs/tags/v2.5.4.tar.gz#/ls-qpack-2.5.4.tar.gz Patch0: fix-tarball-for-local-build.patch +Patch1: 2.patch BuildRequires: gcc BuildRequires: g++ @@ -63,8 +65,10 @@ Mod Security for openlitespeed webserver. tar -xpaf %{SOURCE2} tar -xpaf %{SOURCE3} mkdir %{_builddir}/%{name}-%{version}/dist/admin/fcgi-bin -tar -xpaf %{SOURCE4} -C %{_builddir}/%{name}-%{version}/dist/admin/fcgi-bin/ -tar -xpaf %{SOURCE5} +mkdir %{_builddir}/%{name}-%{version}/dist/phpbuild +cp %{SOURCE4} %{_builddir}/%{name}-%{version}/dist/phpbuild +cp %{SOURCE5} %{_builddir}/%{name}-%{version}/dist/phpbuild +tar -xpaf %{SOURCE6} %build rm -rf lsquic @@ -73,6 +77,8 @@ rm -rf lsquic/src/lshpack mv ls-hpack-2.3.3/ lsquic/src/lshpack rm -rf lsquic/src/liblsquic/ls-qpack mv ls-qpack-2.5.4/ lsquic/src/liblsquic/ls-qpack +touch dist/phpbuild/adminphp.log +sh -e dist/admin/misc/build_admin_php.sh sh -e build.sh %install @@ -100,7 +106,6 @@ chmod 755 %{buildroot}%{_lsws_dir}/bin/unmount_ns chmod 755 %{buildroot}%{_lsws_dir}/lsrecaptcha/_recaptcha chmod 755 %{buildroot}%{_lsws_dir}/admin/fcgi-bin/admin_php chmod 755 %{buildroot}%{_lsws_dir}/fcgi-bin/lsphp5 -chmod 755 %{buildroot}%{_lsws_dir}/admin/fcgi-bin/admin_php rm -f %{buildroot}%{_lsws_dir}/fcgi-bin/lsphp rm -f %{buildroot}%{_lsws_dir}/admin/misc/lsws.rc.gentoo @@ -259,6 +264,9 @@ fi %{_lsws_dir}/modules/mod_lua.so %changelog +* Wed Nov 6 2024 Eduard Basov - 1.8.2-3 +- Add build php + * Tue Oct 8 2024 Arkady L. Shane - 1.8.2-2 - Fix scripts conditions - Clean up spec -- 2.36.5 From 28dbd6cdc11efa02bc468b7d75d5769b88e33220 Mon Sep 17 00:00:00 2001 From: ebasov Date: Wed, 6 Nov 2024 11:06:47 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPECS/openlitespeed.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index ad5c18e..c4ee14e 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -16,7 +16,7 @@ Source5: http://www.litespeedtech.com/packages/lsapi/php-litespeed-8.1.tgz Source6: https://github.com/litespeedtech/ls-qpack/archive/refs/tags/v2.5.4.tar.gz#/ls-qpack-2.5.4.tar.gz Patch0: fix-tarball-for-local-build.patch -Patch1: 2.patch +Patch1: add-build-admin-php.patch BuildRequires: gcc BuildRequires: g++ -- 2.36.5