aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOkamura Kazuya <gentoo-guru@danceylove.net>2024-05-06 01:27:45 +0900
committerOkamura Kazuya <gentoo-guru@danceylove.net>2024-05-06 01:32:11 +0900
commitb02820917240dcc7606e0eeb50b5a08e4086b195 (patch)
tree0d11641d633b915ea23f5e9d2175d30aa8a01c73 /www-servers
parentsys-kernel/ugrd: Add 1.2.4 (diff)
downloadguru-b02820917240dcc7606e0eeb50b5a08e4086b195.tar.gz
guru-b02820917240dcc7606e0eeb50b5a08e4086b195.tar.bz2
guru-b02820917240dcc7606e0eeb50b5a08e4086b195.zip
www-servers/openlitespeed: new package, add 1.8.1
Openlitespeed cannot work because there is no php that supports litespeed. We are requesting additional support using the ticket below. dev-lang/php: add litespeed support. See also https://bugs.gentoo.org/908876 app-eselect/eselect-php: add openlitespeed. See also https://bugs.gentoo.org/908996 Signed-off-by: Okamura Kazuya <gentoo-guru@danceylove.net>
Diffstat (limited to 'www-servers')
-rw-r--r--www-servers/openlitespeed/Manifest2
-rw-r--r--www-servers/openlitespeed/files/openlitespeed-add-install-files.patch84
-rw-r--r--www-servers/openlitespeed/files/openlitespeed-disable-build-deps-libs.patch153
-rw-r--r--www-servers/openlitespeed/files/openlitespeed-link-boringssl-static-libs.patch46
-rw-r--r--www-servers/openlitespeed/metadata.xml11
-rw-r--r--www-servers/openlitespeed/openlitespeed-1.8.1.ebuild76
6 files changed, 372 insertions, 0 deletions
diff --git a/www-servers/openlitespeed/Manifest b/www-servers/openlitespeed/Manifest
new file mode 100644
index 000000000..2d35fa815
--- /dev/null
+++ b/www-servers/openlitespeed/Manifest
@@ -0,0 +1,2 @@
+DIST boringssl-fips-20230428.tar.gz 32288205 BLAKE2B 50588024cfd985b23be6f780197d092beae4b97bb2b5e01a6aca1477b0f5f0ffd0b6ac9558bd42fb5b4de4898a8987326afbe28422bb6dafbfc2104660958a83 SHA512 afdf94a4bbf4e92082ddcdb798c7b13e489f63ad50d9a79ee0f7222c0c830dd75a313cb8e3220816f1dc6872fe7493522938797c18c728e41a7c8f77bd597fc1
+DIST openlitespeed-1.8.1.tar.gz 8246228 BLAKE2B c1f4606160bb659fc2107e18cfdf3f63208369d6182210bbb419b34f588d3863baff4d9ffb2c60c6bb7d7ee021535d080d6c9d5172aa3f1d9ea8e0b550e37723 SHA512 6c5116d34199e201060795c960bd0ecfc7af499ac16c65d570cbefcee396b2f5156bb9478dfa08a66961682a3da857b34d983c39bf05e3471b1f4ad0ec8518c7
diff --git a/www-servers/openlitespeed/files/openlitespeed-add-install-files.patch b/www-servers/openlitespeed/files/openlitespeed-add-install-files.patch
new file mode 100644
index 000000000..aacbee975
--- /dev/null
+++ b/www-servers/openlitespeed/files/openlitespeed-add-install-files.patch
@@ -0,0 +1,84 @@
+I plan to eventually change the patch to install openlitespeed in the appropriate location instead of installing it in /usr/local/lsws/.
+diff --git a/dist/bin/lswsctrl b/dist/bin/lswsctrl
+index 0da2490e..6c294b35 100755
+--- a/dist/bin/lswsctrl
++++ b/dist/bin/lswsctrl
+@@ -7,7 +7,7 @@ PROG="$0"
+ # WSWATCH=1
+ #fi
+
+-EXECUTABLE=litespeed
++EXECUTABLE=openlitespeed
+ DESC="litespeed"
+ BASE_DIR=`dirname "$PROG"`
+ cd "$BASE_DIR"
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 34df52ff..90145c9a 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -178,6 +178,64 @@ target_link_libraries(ls_shmhashstat lsshm log4cxx edio util lsr pthread rt )
+ # target_link_libraries(shmlru_test ${litespeedlib} )
+
+
++file(MAKE_DIRECTORY ../dist/logs/)
++file(TOUCH ../dist/logs/lsrestart.log)
++install(FILES
++ ../dist/GPL.txt
++ ../dist/VERSION DESTINATION local/lsws
++)
++install(FILES ../dist/conf/httpd_config.conf DESTINATION local/lsws/conf)
++install(FILES
++ ../dist/conf/templates/rails.conf
++ ../dist/conf/templates/ccl.conf DESTINATION local/lsws/conf/templates
++)
++install(FILES
++ ../dist/conf/vhosts/Example/vhconf.conf
++ ../dist/conf/vhosts/Example/htgroup
++ ../dist/conf/vhosts/Example/htpasswd DESTINATION local/lsws/conf/vhosts/Example
++)
++install(FILES
++ ../dist/conf/mime.properties DESTINATION local/lsws/conf
++)
++install(FILES
++ ../dist/admin/conf/php.ini
++ ../dist/admin/conf/admin_config.conf DESTINATION local/lsws/admin/conf/
++)
++install(FILES
++ ../dist/admin/misc/convertxml.php
++ ../dist/admin/misc/gdb-bt
++ ../dist/admin/misc/genjCryptionKeyPair.php
++ ../dist/admin/misc/htpasswd.php
++ ../dist/admin/misc/lshttpd.service
++ ../dist/admin/misc/php.ini DESTINATION local/lsws/admin/misc
++)
++install(FILES
++ ../dist/admin/misc/admpass.sh
++ ../dist/admin/misc/build_admin_php.sh
++ ../dist/admin/misc/create_admin_keypair.sh
++ ../dist/admin/misc/convertxml.sh
++ ../dist/admin/misc/enable_phpa.sh
++ ../dist/admin/misc/gzipStatic.sh
++ ../dist/admin/misc/lscmctl
++ ../dist/admin/misc/lsup.sh
++ ../dist/admin/misc/lsws.rc
++ ../dist/admin/misc/lsws.rc.gentoo
++ ../dist/admin/misc/rc-inst.sh
++ ../dist/admin/misc/rc-uninst.sh
++ ../dist/admin/misc/testbeta.sh
++ ../dist/admin/misc/uninstall.sh DESTINATION local/lsws/admin/misc PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
++)
++install(FILES ../dist/bin/lswsctrl DESTINATION local/lsws/bin PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
++install(DIRECTORY
++ ../dist/fcgi-bin
++ ../dist/add-ons
++ ../dist/lsrecaptcha
++ ../dist/docs
++ ../dist/logs
++ ../dist/Example
++ ../dist/share DESTINATION local/lsws
++)
++install(DIRECTORY ../dist/admin/html.open DESTINATION local/lsws/admin/html.open)
+
+-install(TARGETS openlitespeed DESTINATION bin)
++install(TARGETS openlitespeed DESTINATION local/lsws/bin)
+
diff --git a/www-servers/openlitespeed/files/openlitespeed-disable-build-deps-libs.patch b/www-servers/openlitespeed/files/openlitespeed-disable-build-deps-libs.patch
new file mode 100644
index 000000000..8d2195587
--- /dev/null
+++ b/www-servers/openlitespeed/files/openlitespeed-disable-build-deps-libs.patch
@@ -0,0 +1,153 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 52f933f3..49dcb853 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -16,30 +16,15 @@ set(CMAKE_SKIP_BUILD_RPATH TRUE)
+
+ SET(LSQUIC_SERVER_MODE 1)
+
+-if (CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" AND
+- CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
+- if (${ALPINE})
+- message("Alpine X64")
+- else()
+- message("Set LINUX_X64")
+- set (LINUX_X64 ON)
+- endif()
+-endif()
+-if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
+- set (NOT_MACOS OFF)
+-else()
+- set (NOT_MACOS ON)
+-endif()
+-OPTION(MOD_PAGESPEED "Whether pagespeed should be built" ${LINUX_X64})
+-OPTION(MOD_SECURITY "Whether mod_security should be built" ${NOT_MACOS})
+-OPTION(MOD_LUA "Whether Lua should be built" ${LINUX_X64})
++OPTION(MOD_PAGESPEED "Whether pagespeed should be built" OFF)
++OPTION(MOD_SECURITY "Whether mod_security should be built" OFF)
++OPTION(MOD_LUA "Whether Lua should be built" OFF)
+ OPTION(MOD_REQPARSER "Whether modreqparser should be built" OFF)
+ OPTION(MOD_INSPECTOR "Whether modinspector should be built" OFF)
+ OPTION(MOD_UPLOADPROGRESS "Whether uploadprogress should be built" OFF)
+ OPTION(MOD_LSPHP "Whether mod_lsphp should be built" OFF)
+
+-include_directories( BEFORE include src/lshpack src/liblsquic/ls-qpack ${PROJECT_SOURCE_DIR}/../third-party/include/)
+-link_directories( ${PROJECT_SOURCE_DIR}/../third-party/lib/)
++include_directories( BEFORE include /usr/include/lsquic src/boringssl/include)
+
+ #SET (CMAKE_C_COMPILER "/usr/bin/clang")
+ #SET (CMAKE_CXX_COMPILER "/usr/bin/clang++")
+@@ -174,11 +159,11 @@ SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
+ set(BSSL_ADD_LIB decrepit)
+ ##########################################################################################
+ #If you want to use Brotli Compression, just un-comment out the following commands
+-set(BROTLI_ADD_LIB libbrotlidec-static.a libbrotlienc-static.a libbrotlicommon-static.a)
++set(BROTLI_ADD_LIB brotlidec brotlienc brotlicommon)
+ add_definitions(-DUSE_BROTLI)
+ ##########################################################################################
+ #If you want to use IP2Location, just un-comment out the following commands
+-set(IP2LOC_ADD_LIB libIP2Location.a)
++set(IP2LOC_ADD_LIB IP2Location)
+ add_definitions(-DUSE_IP2LOCATION)
+ ##########################################################################################
+ #If you want to use IPTOGEO2, just un-comment out the following commands
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 34df52ff..60e65b72 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -2,12 +2,10 @@ cmake_minimum_required(VERSION 3.0)
+
+ link_directories("/usr/lib64")
+
+-
+ add_subdirectory(adns)
+ add_subdirectory(edio)
+ add_subdirectory(extensions)
+ add_subdirectory(http)
+-add_subdirectory(liblsquic)
+ add_subdirectory(log4cxx)
+ add_subdirectory(lsiapi)
+ add_subdirectory(lsr)
+@@ -22,6 +20,7 @@ add_subdirectory(ssi)
+ add_subdirectory(thread)
+ add_subdirectory(util)
+ add_subdirectory(h2)
++add_subdirectory(boringssl)
+
+ ########### next target ###############
+
+@@ -158,8 +157,8 @@ SET( litespeedlib
+ registry cgi fcgi jk extensions lsapi proxy
+ socket sslpp lsshm thread log4cxx adns
+ quic h2 lsquic -Wl,--whole-archive util lsr -Wl,--no-whole-archive ${MMDB_LIB}
+- edio libssl.a libcrypto.a ${BSSL_ADD_LIB} ${libUnitTest}
+- libz.a libpcre.a libexpat.a libxml2.a
++ edio ssl crypto ls-qpack ls-hpack ${BSSL_ADD_LIB} ${libUnitTest}
++ z pcre expat xml2
+ ${IP2LOC_ADD_LIB} ${BROTLI_ADD_LIB} udns ${LINUX_AIO_LIB}
+ -nodefaultlibs pthread rt ${LIBSAN} ${LIBATOMIC}
+ ${CMAKE_DL_LIBS} ${STDCXX} crypt bcrypt m gcc_eh c c_nonshared gcc
+diff --git a/src/h2/CMakeLists.txt b/src/h2/CMakeLists.txt
+index 43372886..c73c835e 100644
+--- a/src/h2/CMakeLists.txt
++++ b/src/h2/CMakeLists.txt
+@@ -10,7 +10,6 @@ h2streampool.cpp
+ unpackedheaders.cpp
+ h2connbase.cpp
+ h2streambase.cpp
+-../lshpack/lshpack.c
+ )
+
+ add_library(h2 STATIC ${h2_STAT_SRCS})
+diff --git a/src/h2/unpackedheaders.cpp b/src/h2/unpackedheaders.cpp
+index 1b803c07..a58e2c18 100644
+--- a/src/h2/unpackedheaders.cpp
++++ b/src/h2/unpackedheaders.cpp
+@@ -4,7 +4,7 @@
+ #include <log4cxx/logger.h>
+ #include <lsr/ls_pool.h>
+ #include <util/stringtool.h>
+-#include <lshpack/lshpack.h>
++#include <lshpack.h>
+ #include <lsqpack.h>
+
+
+diff --git a/src/http/httprespheaders.cpp b/src/http/httprespheaders.cpp
+index e18762ee..6e2be6af 100644
+--- a/src/http/httprespheaders.cpp
++++ b/src/http/httprespheaders.cpp
+@@ -20,7 +20,7 @@
+ #include <http/httpserverversion.h>
+ #include <http/httpver.h>
+ #include <log4cxx/logger.h>
+-#include <lshpack/lshpack.h>
++#include <lshpack.h>
+ #include <socket/gsockaddr.h>
+ #include <util/datetime.h>
+ #include <util/stringtool.h>
+diff --git a/src/http/userdir.cpp b/src/http/userdir.cpp
+index 99ab0a35..65d14e87 100644
+--- a/src/http/userdir.cpp
++++ b/src/http/userdir.cpp
+@@ -33,7 +33,7 @@
+ #include <openssl/md5.h>
+ #include <openssl/sha.h>
+ #include <string.h>
+-#include <bcrypt.h>
++#include <libbcrypt.h>
+
+
+ UserDir::~UserDir()
+diff --git a/src/modules/modsecurity-ls/CMakeLists.txt b/src/modules/modsecurity-ls/CMakeLists.txt
+index c091ad9a..6effd30f 100644
+--- a/src/modules/modsecurity-ls/CMakeLists.txt
++++ b/src/modules/modsecurity-ls/CMakeLists.txt
+@@ -28,7 +28,7 @@ add_library(mod_security SHARED
+ )
+
+
+-target_link_libraries(mod_security libmodsecurity.a
++target_link_libraries(mod_security modsecurity
+ -nodefaultlibs libstdc++.a
+ pthread rt -llmdb -lxml2 -lcurl -lssl -lcrypto -lz -lpcre -lyajl
+ ${LIBSAN} crypt m gcc_eh c c_nonshared gcc)
diff --git a/www-servers/openlitespeed/files/openlitespeed-link-boringssl-static-libs.patch b/www-servers/openlitespeed/files/openlitespeed-link-boringssl-static-libs.patch
new file mode 100644
index 000000000..4ca7a46da
--- /dev/null
+++ b/www-servers/openlitespeed/files/openlitespeed-link-boringssl-static-libs.patch
@@ -0,0 +1,46 @@
+Modify the BoringSSL library to be included internally during OpenLiteSpeed construction, so that the BoringSSL library does not need to be installed by itself on the system.
+BoringSSL must always be built as static, so we intentionally removed the code that builds it as shared.
+diff --git a/src/boringssl/CMakeLists.txt b/src/boringssl/CMakeLists.txt
+index aac5f0d..37cbfa3 100644
+--- a/src/boringssl/CMakeLists.txt
++++ b/src/boringssl/CMakeLists.txt
+@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.10)
+ # Defer enabling C and CXX languages.
+ project(BoringSSL NONE)
+
++set(BUILD_SHARED_LIBS OFF)
++
+ # Don't install BoringSSL to system directories by default; it has no stable
+ # ABI. Instead, default to an "install" directory under the source.
+ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+@@ -36,7 +38,7 @@ if(CMAKE_VERSION VERSION_LESS "3.14")
+ endif()
+
+ # Wrap the CMake install function so we can disable it.
+-set(INSTALL_ENABLED 1)
++set(INSTALL_ENABLED 0)
+ function(install_if_enabled)
+ if(INSTALL_ENABLED)
+ install(${ARGV})
+@@ -139,7 +141,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
+ if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
+ # Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration
+ # primarily on our normal Clang one.
+- set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -Wshadow -Wtype-limits")
++ set(C_CXX_FLAGS "-Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -Wshadow -Wtype-limits -fPIC")
+ if(MSVC)
+ # clang-cl sets different default warnings than clang. It also treats -Wall
+ # as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall.
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 52f933f3..6df38490 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -174,7 +174,7 @@ SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
+ #If you want to use BoringSSL, just un-comment out the following commands
+ #AND YOU NEED TO HAVE THE files ready in openlitespeed/ssl
+ #You can run the dlbssl.sh to make them ready
+-set(BSSL_ADD_LIB libdecrepit.a)
++set(BSSL_ADD_LIB decrepit)
+ ##########################################################################################
+ #If you want to use Brotli Compression, just un-comment out the following commands
+ set(BROTLI_ADD_LIB libbrotlidec-static.a libbrotlienc-static.a libbrotlicommon-static.a)
diff --git a/www-servers/openlitespeed/metadata.xml b/www-servers/openlitespeed/metadata.xml
new file mode 100644
index 000000000..149e6b2e3
--- /dev/null
+++ b/www-servers/openlitespeed/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>trakrailysurely@danceylove.net</email>
+ <name>Okamura Kazuya</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">litespeedtech/openlitespeed</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/openlitespeed/openlitespeed-1.8.1.ebuild b/www-servers/openlitespeed/openlitespeed-1.8.1.ebuild
new file mode 100644
index 000000000..1970fef0d
--- /dev/null
+++ b/www-servers/openlitespeed/openlitespeed-1.8.1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+BORINGSSL_COMMIT="15655052e8701f908937204785eaa8cd4363099f"
+
+DESCRIPTION="LiteSpeed QUIC (LSQUIC) Library"
+HOMEPAGE="https://github.com/litespeedtech/lsquic/"
+SRC_URI="
+ https://github.com/litespeedtech/openlitespeed/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/google/boringssl/archive/${BORINGSSL_COMMIT}.tar.gz -> boringssl-fips-20230428.tar.gz
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+
+IUSE="static-libs ruby"
+RESTRICT=""
+
+DEPEND="
+ dev-lang/go
+ dev-libs/modsecurity
+ app-arch/brotli
+ dev-libs/yajl
+ virtual/libcrypt
+ ruby? ( dev-lang/ruby )
+ dev-libs/lsquic:=[static-libs=]
+ dev-libs/ls-qpack:=[static-libs=]
+ dev-libs/ls-hpack:=[static-libs=]
+"
+
+RDEPEND="
+ acct-user/lsadm
+ acct-group/lsadm"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-link-boringssl-static-libs.patch
+ "${FILESDIR}"/${PN}-disable-build-deps-libs.patch
+ "${FILESDIR}"/${PN}-add-install-files.patch
+)
+
+src_unpack() {
+ default
+ unpack boringssl-fips-20230428.tar.gz
+ mv boringssl-${BORINGSSL_COMMIT} "${S}"/src/boringssl || die
+}
+
+src_configure() {
+ # LSWS variables
+ SERVERROOT=/usr/local/lsws
+ OPENLSWS_USER=nobody
+ OPENLSWS_GROUP=nobody
+ OPENLSWS_EMAIL=root@localhost
+ OPENLSWS_ADMINPORT=7080
+ DEFAULT_TMP_DIR=/tmp/lshttpd
+ if use ruby ; then
+ RUBY_PATH=/usr/bin/ruby
+ else
+ RUBY_PATH=
+ fi
+ OPENLSWS_EXAMPLEPORT=8088
+
+ sed -e "s/%ADMIN_PORT%/$OPENLSWS_ADMINPORT/" "${S}/dist/admin/conf/admin_config.conf.in" > "${S}/dist/admin/conf/admin_config.conf"
+ sed -e "s/%USER%/$OPENLSWS_USER/" -e "s/%GROUP%/$OPENLSWS_GROUP/" -e "s#%DEFAULT_TMP_DIR%#$DEFAULT_TMP_DIR#" -e "s/%ADMIN_EMAIL%/$OPENLSWS_EMAIL/" -e "s/%HTTP_PORT%/$OPENLSWS_EXAMPLEPORT/" -e "s/%RUBY_BIN%/$RUBY_PATH/" "${S}/dist/conf/httpd_config.conf.in" > "${S}/dist/conf/httpd_config.conf"
+ sed "s:%LSWS_CTRL%:$SERVERROOT/bin/lswsctrl:" "${S}/dist/admin/misc/lsws.rc.in" > "${S}/dist/admin/misc/lsws.rc"
+ sed "s:%LSWS_CTRL%:$SERVERROOT/bin/lswsctrl:" "${S}/dist/admin/misc/lsws.rc.gentoo.in" > "${S}/dist/admin/misc/lsws.rc.gentoo"
+ sed "s:%LSWS_CTRL%:$SERVERROOT/bin/lswsctrl:" "${S}/dist/admin/misc/lshttpd.service.in" > "${S}/dist/admin/misc/lshttpd.service"
+
+ local mycmakeargs=(
+ )
+ cmake_src_configure
+}