From efdc75f1b9dd1df7c82b42db2eed5aa2a6d6d0a4 Mon Sep 17 00:00:00 2001 From: fbrosson Date: Sun, 24 Jul 2016 21:23:36 +0000 Subject: [PATCH] lighttpd: bump to 1.4.40, drop x86_gcc2, add x86 secondary arch. (#721) * Configure with more options: --with-libxml --with-ldap --with-lua --with-sqlite --with-uuid --with-webdav-locks * Create a read-only copy of system/settings/lighttpd/ in system/data/lighttpd/template-settings/. * Rename index.shtml to index.lighttpd.shtml to make it easier to share the same document-root with other web servers. * Add quickstart.txt in $docDir with some useful information. --- .../create-lighttpd-directories.sh | 13 ++ .../additional-files/create_directories.sh | 13 -- .../lighttpd/additional-files/quickstart.txt | 11 ++ ...d-1.4.39.recipe => lighttpd-1.4.40.recipe} | 148 ++++++++++++------ .../lighttpd/patches/lighttpd-1.4.39.patch | 22 --- .../lighttpd/patches/lighttpd-1.4.40.patch | 30 ++++ 6 files changed, 153 insertions(+), 84 deletions(-) create mode 100755 www-servers/lighttpd/additional-files/create-lighttpd-directories.sh delete mode 100755 www-servers/lighttpd/additional-files/create_directories.sh create mode 100644 www-servers/lighttpd/additional-files/quickstart.txt rename www-servers/lighttpd/{lighttpd-1.4.39.recipe => lighttpd-1.4.40.recipe} (53%) delete mode 100644 www-servers/lighttpd/patches/lighttpd-1.4.39.patch create mode 100644 www-servers/lighttpd/patches/lighttpd-1.4.40.patch diff --git a/www-servers/lighttpd/additional-files/create-lighttpd-directories.sh b/www-servers/lighttpd/additional-files/create-lighttpd-directories.sh new file mode 100755 index 000000000..c05896515 --- /dev/null +++ b/www-servers/lighttpd/additional-files/create-lighttpd-directories.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +mkdir -p var/www/htdocs + +if [ ! -e var/www/htdocs/index.lighttpd.shtml ]; then + ln -s /system/data/lighttpd/www/htdocs/index.lighttpd.shtml var/www/htdocs +fi + +if [ ! -e var/www/htdocs/index.lighttpd.html ]; then + ln -s /system/data/lighttpd/www/htdocs/index.lighttpd.html var/www/htdocs +fi + +mkdir -p var/log/lighttpd var/lib/lighttpd var/cache/lighttpd var/tmp/lighttpd diff --git a/www-servers/lighttpd/additional-files/create_directories.sh b/www-servers/lighttpd/additional-files/create_directories.sh deleted file mode 100755 index 0f4b16b86..000000000 --- a/www-servers/lighttpd/additional-files/create_directories.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -mkdir -p var/www/htdocs - -if [ ! -e var/www/htdocs/index.shtml ]; then - ln -s /system/data/lighttpd/www/htdocs/index.shtml var/www/htdocs -fi - -if [ ! -e var/www/htdocs/index.lighttpd.html ]; then - ln -s /system/data/lighttpd/www/htdocs/index.lighttpd.html var/www/htdocs -fi - -mkdir -p var/log/lighttpd var/lib/lighttpd var/cache/lighttpd diff --git a/www-servers/lighttpd/additional-files/quickstart.txt b/www-servers/lighttpd/additional-files/quickstart.txt new file mode 100644 index 000000000..af7af8ed6 --- /dev/null +++ b/www-servers/lighttpd/additional-files/quickstart.txt @@ -0,0 +1,11 @@ +The configuration lives in /system/settings/lighttpd/ and is not overwritten if already present when lighttpd is installed or upgraded. +Template read-only configuration files are in /system/data/lighttpd/template-settings/ and correspond to the default configuration for the version of lighttpd being installed. + +The default document root is /system/data/www/htdocs/. +It can be easily changed to an alternate directory, e.g. /var/www/htdocs/. +With the default configuration, access.log and error.log live in /var/log/lighttpd/. + +lighttpd can be started with: + lighttpd -f /system/settings/lighttpd/lighttpd.conf +and stopped with: + kill $(cat /var/lighttpd.pid) diff --git a/www-servers/lighttpd/lighttpd-1.4.39.recipe b/www-servers/lighttpd/lighttpd-1.4.40.recipe similarity index 53% rename from www-servers/lighttpd/lighttpd-1.4.39.recipe rename to www-servers/lighttpd/lighttpd-1.4.40.recipe index e6422d33b..ff421e8cd 100644 --- a/www-servers/lighttpd/lighttpd-1.4.39.recipe +++ b/www-servers/lighttpd/lighttpd-1.4.40.recipe @@ -9,19 +9,27 @@ solution for every server that is suffering load problems." HOMEPAGE="https://www.lighttpd.net/" COPYRIGHT="2003-2016 Jan Kneschke" LICENSE="BSD (3-clause)" -REVISION="2" +REVISION="1" SOURCE_URI="https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-$portVersion.tar.gz" -CHECKSUM_SHA256="bc5f910f78b8cbae3e8fe1a1d8558259f09dbe50dd3907db771404bfab27bb2e" +CHECKSUM_SHA256="dd56f46a586192e140600f32836b38a1c276d86692721d53c7976af14a904886" PATCHES="lighttpd-$portVersion.patch" ADDITIONAL_FILES=" - create_directories.sh + create-lighttpd-directories.sh index.template + quickstart.txt " -ARCHITECTURES="x86_gcc2 x86 x86_64 ?arm ?ppc" +ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm ?ppc" +SECONDARY_ARCHITECTURES="!x86_gcc2 x86" + +if [ "$targetArchitecture" != x86_gcc2 ]; then + commandBinDir=$binDir +else + commandBinDir=$prefix/bin +fi PROVIDES=" - lighttpd = $portVersion + lighttpd$secondaryArchSuffix = $portVersion cmd:lighttpd cmd:lighttpd_angel lib:mod_access @@ -58,31 +66,38 @@ PROVIDES=" lib:mod_webdav " REQUIRES=" - haiku - lib:libbz2 - lib:libcrypto - lib:libpcre - lib:libsqlite3 - lib:libssl - lib:libxml2 - lib:libz + haiku$secondaryArchSuffix + lib:libbz2$secondaryArchSuffix + lib:libcrypto$secondaryArchSuffix + lib:libldap$secondaryArchSuffix + lib:liblua$secondaryArchSuffix + lib:libpcre$secondaryArchSuffix + lib:libsqlite3$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libuuid$secondaryArchSuffix + lib:libxml2$secondaryArchSuffix + lib:libz$secondaryArchSuffix " PROVIDES_devel=" - lighttpd_devel = $portVersion + lighttpd${secondaryArchSuffix}_devel = $portVersion " REQUIRES_devel=" - lighttpd == $portVersion base + lighttpd$secondaryArchSuffix == $portVersion base " BUILD_REQUIRES=" - haiku_devel - devel:libbz2 - devel:libpcre - devel:libsqlite3 - devel:libssl - devel:libxml2 - devel:libz + haiku${secondaryArchSuffix}_devel + devel:libbz2$secondaryArchSuffix + devel:libcrypto$secondaryArchSuffix + devel:libldap$secondaryArchSuffix + devel:liblua$secondaryArchSuffix + devel:libpcre$secondaryArchSuffix + devel:libsqlite3$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + devel:libxml2$secondaryArchSuffix + devel:libuuid$secondaryArchSuffix + devel:libz$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:aclocal @@ -90,10 +105,10 @@ BUILD_PREREQUIRES=" cmd:autom4te cmd:automake cmd:awk - cmd:gcc + cmd:gcc$secondaryArchSuffix cmd:make cmd:perl - cmd:pkg_config + cmd:pkg_config$secondaryArchSuffix cmd:sed cmd:uname cmd:which @@ -126,15 +141,41 @@ GLOBAL_WRITABLE_FILES=" settings/lighttpd/conf.d/trigger_b4_dl.conf keep-old settings/lighttpd/conf.d/userdir.conf keep-old settings/lighttpd/conf.d/webdav.conf keep-old - " + " USER_SETTINGS_FILES=" settings/lighttpd directory settings/lighttpd/conf.d directory + settings/lighttpd/lighttpd.conf template data/lighttpd/template-settings/lighttpd.conf + settings/lighttpd/modules.conf template data/lighttpd/template-settings/modules.conf + settings/lighttpd/conf.d/access_log.conf template data/lighttpd/template-settings/conf.d/access_log.conf + settings/lighttpd/conf.d/auth.conf template data/lighttpd/template-settings/conf.d/auth.conf + settings/lighttpd/conf.d/cgi.conf template data/lighttpd/template-settings/conf.d/cgi.conf + settings/lighttpd/conf.d/cml.conf template data/lighttpd/template-settings/conf.d/cml.conf + settings/lighttpd/conf.d/compress.conf template data/lighttpd/template-settings/conf.d/compress.conf + settings/lighttpd/conf.d/debug.conf template data/lighttpd/template-settings/conf.d/debug.conf + settings/lighttpd/conf.d/dirlisting.conf template data/lighttpd/template-settings/conf.d/dirlisting.conf + settings/lighttpd/conf.d/evhost.conf template data/lighttpd/template-settings/conf.d/evhost.conf + settings/lighttpd/conf.d/expire.conf template data/lighttpd/template-settings/conf.d/expire.conf + settings/lighttpd/conf.d/fastcgi.conf template data/lighttpd/template-settings/conf.d/fastcgi.conf + settings/lighttpd/conf.d/geoip.conf template data/lighttpd/template-settings/conf.d/geoip.conf + settings/lighttpd/conf.d/magnet.conf template data/lighttpd/template-settings/conf.d/magnet.conf + settings/lighttpd/conf.d/mime.conf template data/lighttpd/template-settings/conf.d/mime.conf + settings/lighttpd/conf.d/mysql_vhost.conf template data/lighttpd/template-settings/conf.d/mysql_vhost.conf + settings/lighttpd/conf.d/proxy.conf template data/lighttpd/template-settings/conf.d/proxy.conf + settings/lighttpd/conf.d/rrdtool.conf template data/lighttpd/template-settings/conf.d/rrdtool.conf + settings/lighttpd/conf.d/scgi.conf template data/lighttpd/template-settings/conf.d/scgi.conf + settings/lighttpd/conf.d/secdownload.conf template data/lighttpd/template-settings/conf.d/secdownload.conf + settings/lighttpd/conf.d/simple_vhost.conf template data/lighttpd/template-settings/conf.d/simple_vhost.conf + settings/lighttpd/conf.d/ssi.conf template data/lighttpd/template-settings/conf.d/ssi.conf + settings/lighttpd/conf.d/status.conf template data/lighttpd/template-settings/conf.d/status.conf + settings/lighttpd/conf.d/trigger_b4_dl.conf template data/lighttpd/template-settings/conf.d/trigger_b4_dl.conf + settings/lighttpd/conf.d/userdir.conf template data/lighttpd/template-settings/conf.d/userdir.conf + settings/lighttpd/conf.d/webdav.conf template data/lighttpd/template-settings/conf.d/webdav.conf " POST_INSTALL_SCRIPTS=" - $relativePostInstallDir/create_directories.sh + $relativePostInstallDir/create-lighttpd-directories.sh " BUILD() @@ -142,9 +183,11 @@ BUILD() aclocal autoconf automake - runConfigure --omit-dirs libDir ./configure --libdir=$libDir/lighttpd \ + runConfigure --omit-dirs "libDir sbinDir" ./configure \ + --libdir=$libDir/lighttpd --sbindir=$commandBinDir \ --with-openssl --with-zlib --with-bzip2 --with-pcre \ - --with-webdav-props + --with-libxml --with-ldap --with-lua --with-sqlite \ + --with-uuid --with-webdav-locks --with-webdav-props make $jobArgs } @@ -152,14 +195,18 @@ INSTALL() { make install mkdir -p $postInstallDir - cp -f $portDir/additional-files/create_directories.sh $postInstallDir + cp -f $portDir/additional-files/create-lighttpd-directories.sh $postInstallDir rm $libDir/lighttpd/mod_*.la mkdir -p \ $localStateDir/cache/lighttpd \ $localStateDir/lib/lighttpd \ $localStateDir/log/lighttpd \ + $localStateDir/tmp/lighttpd \ $localStateDir/www/htdocs \ - $settingsDir/lighttpd/conf.d + $settingsDir/lighttpd/conf.d \ + $dataDir/lighttpd \ + $docDir + cp -f $portDir/additional-files/quickstart.txt $docDir # Tweak lighttpd.conf to have a working config with mod_ssi enabled. # Tweak ssi.conf to add index.shtml as index-file.names for mod_indexfile. @@ -168,7 +215,7 @@ INSTALL() # choses to disable SSI. cp doc/config/lighttpd.conf $settingsDir/lighttpd - sed \ + sed -i \ -e "/^var\.log_root/ \ s|\"/var\(/log/lighttpd\"\)|\"$localStateDir\1|" \ -e "/^var\.server_root/ \ @@ -191,51 +238,54 @@ INSTALL() -e "/^server\.event-handler/ \ s|\"linux-sysepoll\"|\"select\"|" \ -e "/^server\.upload-dirs/ \ - s|\"/var/tmp\"|\"$localStateDir/tmp\"|" \ + s|\"/var/tmp\"|\"$localStateDir/tmp/lighttpd\"|" \ -e "/^#ssl\.pemfile/ \ s|\"/etc/ssl\(/private/lighttpd.pem\"\)|\"$dataDir\1|" \ -e "/^include \"modules\.conf\"/ \ a index-file.names += ( \"index.lighttpd.html\" )" \ - -i $settingsDir/lighttpd/lighttpd.conf + $settingsDir/lighttpd/lighttpd.conf cp doc/config/modules.conf $settingsDir/lighttpd - sed \ + sed -i \ -e "s|^#\(include \"conf\.d/ssi\.conf\"\)|\1|" \ - -i $settingsDir/lighttpd/modules.conf + $settingsDir/lighttpd/modules.conf cp doc/config/conf.d/*.conf $settingsDir/lighttpd/conf.d - sed \ + sed -i \ -e "/^ssi\.extension/ \ - a index-file.names += ( \"index.shtml\" )" \ - -i $settingsDir/lighttpd/conf.d/ssi.conf + a index-file.names += ( \"index.lighttpd.shtml\" )" \ + $settingsDir/lighttpd/conf.d/ssi.conf + + # Create a read-only copy of the settings + cp -rp $settingsDir/lighttpd $dataDir/lighttpd/template-settings mkdir -p $dataDir/lighttpd/www/htdocs # Create and install a static index.lighttpd.html test page from the template. - cp $portDir/additional-files/index.template \ + cp $portDir/additional-files/index.template \ $dataDir/lighttpd/www/htdocs/index.lighttpd.html - sed \ + sed -i \ -e "s|@SYSTEM@|`uname -a`|" \ -e "s|@GETARCH@|`getarch`|" \ -e "s|@HOSTNAME@|`uname -n`|" \ -e "s|@LIGHTTPD_VERSION@|lighttpd/$portVersion|" \ - -i $dataDir/lighttpd/www/htdocs/index.lighttpd.html + $dataDir/lighttpd/www/htdocs/index.lighttpd.html # Create and install the SSI index.shtml test page from the template. - cp $portDir/additional-files/index.template \ - $dataDir/lighttpd/www/htdocs/index.shtml - sed \ + cp $portDir/additional-files/index.template \ + $dataDir/lighttpd/www/htdocs/index.lighttpd.shtml + sed -i \ -e "s|@SYSTEM@||" \ -e "s|@GETARCH@||" \ -e "s|@HOSTNAME@||" \ -e "s|@LIGHTTPD_VERSION@||" \ - -i $dataDir/lighttpd/www/htdocs/index.shtml + $dataDir/lighttpd/www/htdocs/index.lighttpd.shtml -# Install headers in develop/headers/lighttpd/ for building third-party modules. - mkdir -p $developDir/headers/lighttpd - cp -p src/*.h $developDir/headers/lighttpd +# Install headers in $includeDir/lighttpd/ for building third-party modules. + mkdir -p $includeDir/lighttpd + cp -p src/*.h $includeDir/lighttpd # Remove those headers that won't ever be needed for building a module. for i in \ configparser.h \ @@ -243,7 +293,7 @@ INSTALL() proc_open.h \ request.h do - rm -f $developDir/headers/lighttpd/$i + rm -f $includeDir/lighttpd/$i done packageEntries devel $developDir diff --git a/www-servers/lighttpd/patches/lighttpd-1.4.39.patch b/www-servers/lighttpd/patches/lighttpd-1.4.39.patch deleted file mode 100644 index ac1e88ebe..000000000 --- a/www-servers/lighttpd/patches/lighttpd-1.4.39.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -upr lighttpd-1.4.39/configure.ac lighttpd-1.4.39-haiku/configure.ac ---- lighttpd-1.4.39/configure.ac 2015-12-05 14:17:22.000000000 +0000 -+++ lighttpd-1.4.39-haiku/configure.ac -@@ -279,6 +279,9 @@ AC_SEARCH_LIBS(socket,socket) - AC_SEARCH_LIBS(gethostbyname,nsl socket) - AC_SEARCH_LIBS(hstrerror,resolv) - -+dnl On Haiku the accept function is in libnetwork -+AC_SEARCH_LIBS(accept,network) -+ - save_LIBS=$LIBS - AC_SEARCH_LIBS(dlopen,dl,[ - AC_CHECK_HEADERS([dlfcn.h],[ -@@ -690,7 +693,7 @@ AM_CONDITIONAL(CHECK_WITH_FASTCGI, test - dnl check for extra compiler options (warning options) - if test "${GCC}" = "yes"; then - TRY_CFLAGS([-Wall -W -Wshadow -pedantic]) -- TRY_CFLAGS([-std=gnu99]) -+ TRY_CFLAGS([-std=gnu9x]) - fi - - AC_ARG_ENABLE(extra-warnings, diff --git a/www-servers/lighttpd/patches/lighttpd-1.4.40.patch b/www-servers/lighttpd/patches/lighttpd-1.4.40.patch new file mode 100644 index 000000000..9d2a4e542 --- /dev/null +++ b/www-servers/lighttpd/patches/lighttpd-1.4.40.patch @@ -0,0 +1,30 @@ +diff -upr lighttpd-1.4.40/configure.ac lighttpd-1.4.40-haiku/configure.ac +--- lighttpd-1.4.40/configure.ac 2016-07-16 10:06:16.000000000 +0000 ++++ lighttpd-1.4.40-haiku/configure.ac +@@ -136,7 +136,6 @@ dnl AC_FUNC_REALLOC + AC_TYPE_SIGNAL + AC_FUNC_STAT + AC_FUNC_STRFTIME +-AC_CHECK_FUNCS([issetugid inet_pton]) + + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) +@@ -284,6 +283,9 @@ AC_SEARCH_LIBS(socket,socket) + AC_SEARCH_LIBS(gethostbyname,nsl socket) + AC_SEARCH_LIBS(hstrerror,resolv) + ++dnl On Haiku accept() and friends are in libnetwork ++AC_SEARCH_LIBS(accept,network) ++ + save_LIBS=$LIBS + AC_SEARCH_LIBS(dlopen,dl,[ + AC_CHECK_HEADERS([dlfcn.h],[ +@@ -692,7 +694,7 @@ case $host_os in + * ) ;; + esac + +-AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \ ++AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop inet_pton issetugid memset mmap munmap strchr \ + strdup strerror strstr strtol sendfile getopt socket lstat \ + gethostbyname poll epoll_ctl getrlimit chroot \ + getuid select signal pathconf madvise posix_fadvise posix_madvise \