Merge pull request #470 from fbrosson/lighttpd

lighttpd: use autoconf instead of patching configure
This commit is contained in:
waddlesplash
2016-03-06 12:16:49 -05:00
4 changed files with 192 additions and 66 deletions

View File

@@ -0,0 +1,13 @@
#!/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

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Webserver testpage for lighttpd on Haiku</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div>This is only a test page for <a href="https://www.lighttpd.net/">lighttpd</a> on <a href="https://www.haiku-os.org/">Haiku</a>.
Haiku is not responsible for the contents of this server or domain.
<table>
<tr><th>Operating system:</th><td>@SYSTEM@</td></tr>
<tr><th>Architecture:</th><td>@GETARCH@</td></tr>
<tr><th>Host:</th><td>@HOSTNAME@</td></tr>
<tr><th>Webserver version:</th><td>@LIGHTTPD_VERSION@</td></tr>
</table>
</div>
</body>
</html>

View File

@@ -9,12 +9,16 @@ solution for every server that is suffering load problems."
HOMEPAGE="https://www.lighttpd.net/" HOMEPAGE="https://www.lighttpd.net/"
COPYRIGHT="2003-2016 Jan Kneschke" COPYRIGHT="2003-2016 Jan Kneschke"
LICENSE="BSD (3-clause)" LICENSE="BSD (3-clause)"
REVISION="1" REVISION="2"
SOURCE_URI="https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-$portVersion.tar.gz" SOURCE_URI="https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-$portVersion.tar.gz"
CHECKSUM_SHA256="bc5f910f78b8cbae3e8fe1a1d8558259f09dbe50dd3907db771404bfab27bb2e" CHECKSUM_SHA256="bc5f910f78b8cbae3e8fe1a1d8558259f09dbe50dd3907db771404bfab27bb2e"
PATCHES="lighttpd-$portVersion.patch" PATCHES="lighttpd-$portVersion.patch"
ADDITIONAL_FILES="
create_directories.sh
index.template
"
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64 ?arm ?ppc" ARCHITECTURES="x86_gcc2 x86 x86_64 ?arm ?ppc"
PROVIDES=" PROVIDES="
lighttpd = $portVersion lighttpd = $portVersion
@@ -58,44 +62,14 @@ REQUIRES="
lib:libbz2 lib:libbz2
lib:libcrypto lib:libcrypto
lib:libpcre lib:libpcre
lib:libsqlite3
lib:libssl lib:libssl
lib:libxml2
lib:libz lib:libz
" "
PROVIDES_devel=" PROVIDES_devel="
lighttpd_devel = $portVersion lighttpd_devel = $portVersion
devel:mod_access
devel:mod_accesslog
devel:mod_alias
devel:mod_auth
devel:mod_cgi
devel:mod_cml
devel:mod_compress
devel:mod_dirlisting
devel:mod_evasive
devel:mod_evhost
devel:mod_expire
devel:mod_extforward
devel:mod_fastcgi
devel:mod_flv_streaming
devel:mod_indexfile
devel:mod_magnet
devel:mod_mysql_vhost
devel:mod_proxy
devel:mod_redirect
devel:mod_rewrite
devel:mod_rrdtool
devel:mod_scgi
devel:mod_secdownload
devel:mod_setenv
devel:mod_simple_vhost
devel:mod_ssi
devel:mod_staticfile
devel:mod_status
devel:mod_trigger_b4_dl
devel:mod_userdir
devel:mod_usertrack
devel:mod_webdav
" "
REQUIRES_devel=" REQUIRES_devel="
lighttpd == $portVersion base lighttpd == $portVersion base
@@ -105,41 +79,172 @@ BUILD_REQUIRES="
haiku_devel haiku_devel
devel:libbz2 devel:libbz2
devel:libpcre devel:libpcre
devel:libsqlite3
devel:libssl devel:libssl
devel:libxml2
devel:libz devel:libz
" "
BUILD_PREREQUIRES=" BUILD_PREREQUIRES="
cmd:aclocal cmd:aclocal
cmd:autoconf
cmd:autom4te cmd:autom4te
cmd:automake cmd:automake
cmd:awk cmd:awk
cmd:gcc cmd:gcc
cmd:git
cmd:make cmd:make
cmd:perl cmd:perl
cmd:pkg_config cmd:pkg_config
cmd:sed
cmd:uname
cmd:which cmd:which
" "
GLOBAL_WRITABLE_FILES="
settings/lighttpd/lighttpd.conf keep-old
settings/lighttpd/modules.conf keep-old
settings/lighttpd/conf.d/access_log.conf keep-old
settings/lighttpd/conf.d/auth.conf keep-old
settings/lighttpd/conf.d/cgi.conf keep-old
settings/lighttpd/conf.d/cml.conf keep-old
settings/lighttpd/conf.d/compress.conf keep-old
settings/lighttpd/conf.d/debug.conf keep-old
settings/lighttpd/conf.d/dirlisting.conf keep-old
settings/lighttpd/conf.d/evhost.conf keep-old
settings/lighttpd/conf.d/expire.conf keep-old
settings/lighttpd/conf.d/fastcgi.conf keep-old
settings/lighttpd/conf.d/geoip.conf keep-old
settings/lighttpd/conf.d/magnet.conf keep-old
settings/lighttpd/conf.d/mime.conf keep-old
settings/lighttpd/conf.d/mysql_vhost.conf keep-old
settings/lighttpd/conf.d/proxy.conf keep-old
settings/lighttpd/conf.d/rrdtool.conf keep-old
settings/lighttpd/conf.d/scgi.conf keep-old
settings/lighttpd/conf.d/secdownload.conf keep-old
settings/lighttpd/conf.d/simple_vhost.conf keep-old
settings/lighttpd/conf.d/ssi.conf keep-old
settings/lighttpd/conf.d/status.conf keep-old
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
"
POST_INSTALL_SCRIPTS="
$relativePostInstallDir/create_directories.sh
"
BUILD() BUILD()
{ {
aclocal aclocal
autoconf
automake automake
runConfigure ./configure --with-openssl runConfigure --omit-dirs libDir ./configure --libdir=$libDir/lighttpd \
--with-openssl --with-zlib --with-bzip2 --with-pcre \
--with-webdav-props
make $jobArgs make $jobArgs
} }
INSTALL() INSTALL()
{ {
make install make install
mkdir -p $postInstallDir
cp -f $portDir/additional-files/create_directories.sh $postInstallDir
rm $libDir/lighttpd/mod_*.la
mkdir -p \
$localStateDir/cache/lighttpd \
$localStateDir/lib/lighttpd \
$localStateDir/log/lighttpd \
$localStateDir/www/htdocs \
$settingsDir/lighttpd/conf.d
prepareInstalledDevelLibs mod_access mod_accesslog mod_alias mod_auth \ # Tweak lighttpd.conf to have a working config with mod_ssi enabled.
mod_cgi mod_cml mod_compress mod_dirlisting mod_evasive mod_evhost \ # Tweak ssi.conf to add index.shtml as index-file.names for mod_indexfile.
mod_expire mod_extforward mod_fastcgi mod_flv_streaming mod_indexfile \ # Tweak modules.conf to also add index.lighttpd.html as index-file.names.
mod_magnet mod_mysql_vhost mod_proxy mod_redirect mod_rewrite \ # This ensures a default main page will still be available if the user later
mod_rrdtool mod_scgi mod_secdownload mod_setenv mod_simple_vhost \ # choses to disable SSI.
mod_ssi mod_staticfile mod_status mod_trigger_b4_dl mod_userdir \
mod_usertrack mod_webdav cp doc/config/lighttpd.conf $settingsDir/lighttpd
sed \
-e "/^var\.log_root/ \
s|\"/var\(/log/lighttpd\"\)|\"$localStateDir\1|" \
-e "/^var\.server_root/ \
s|\"/srv/www\"|\"$dataDir/lighttpd/www\"|" \
-e "/^var\.server_root/ \
a #var.server_root = \"/$relativeSharedStateDir/www\"" \
-e "/^var\.state_dir/ s|\"/var/run\"|\"$localStateDir\"|" \
-e "/^var\.home_dir/ \
s|\"/var/lib/lighttpd\"|\"$localStateDir/lib/lighttpd\"|" \
-e "/^var\.conf_dir/ \
s|\"/etc\(/lighttpd\"\)|\"/system/$relativeSettingsDir\1|" \
-e "/^var\.cache_dir/ \
s|\"/var\(/cache/lighttpd\"\)|\"$localStateDir\1|" \
-e "/^server\.use-ipv6 / s|\"enable\"|\"disable\"|" \
-e "s|^server\.username |#&|" \
-e "s|^server\.groupname |#&|" \
-e "s|^server\.max-fds |#&|" \
-e "s|^server\.max-connections |#&|" \
-e "s|^server\.network-backend |#&|" \
-e "/^server\.event-handler/ \
s|\"linux-sysepoll\"|\"select\"|" \
-e "/^server\.upload-dirs/ \
s|\"/var/tmp\"|\"$localStateDir/tmp\"|" \
-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
cp doc/config/modules.conf $settingsDir/lighttpd
sed \
-e "s|^#\(include \"conf\.d/ssi\.conf\"\)|\1|" \
-i $settingsDir/lighttpd/modules.conf
cp doc/config/conf.d/*.conf $settingsDir/lighttpd/conf.d
sed \
-e "/^ssi\.extension/ \
a index-file.names += ( \"index.shtml\" )" \
-i $settingsDir/lighttpd/conf.d/ssi.conf
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 \
$dataDir/lighttpd/www/htdocs/index.lighttpd.html
sed \
-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
# 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 \
-e "s|@SYSTEM@|<!--#exec cmd=\"/bin/uname -a\"-->|" \
-e "s|@GETARCH@|<!--#exec cmd=\"/bin/getarch\"-->|" \
-e "s|@HOSTNAME@|<!--#echo var=\"HTTP_HOST\"-->|" \
-e "s|@LIGHTTPD_VERSION@|<!--#echo var=\"SERVER_SOFTWARE\"-->|" \
-i $dataDir/lighttpd/www/htdocs/index.shtml
# Install headers in develop/headers/lighttpd/ for building third-party modules.
mkdir -p $developDir/headers/lighttpd
cp -p src/*.h $developDir/headers/lighttpd
# Remove those headers that won't ever be needed for building a module.
for i in \
configparser.h \
network.h \
proc_open.h \
request.h
do
rm -f $developDir/headers/lighttpd/$i
done
packageEntries devel $developDir packageEntries devel $developDir
} }

View File

@@ -1,6 +1,17 @@
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/configure.ac 2015-12-05 14:17:22.000000000 +0000
+++ lighttpd-1.4.39-haiku/configure.ac +++ lighttpd-1.4.39-haiku/configure.ac
@@ -690,7 +690,7 @@ AM_CONDITIONAL(CHECK_WITH_FASTCGI, test @@ -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) dnl check for extra compiler options (warning options)
if test "${GCC}" = "yes"; then if test "${GCC}" = "yes"; then
TRY_CFLAGS([-Wall -W -Wshadow -pedantic]) TRY_CFLAGS([-Wall -W -Wshadow -pedantic])
@@ -9,25 +20,3 @@
fi fi
AC_ARG_ENABLE(extra-warnings, AC_ARG_ENABLE(extra-warnings,
--- lighttpd-1.4.39/configure 2016-01-02 11:47:11.000000000 +0000
+++ lighttpd-1.4.39-haiku/configure
@@ -16726,8 +16726,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLA
ac_compiler_gnu=$ac_cv_c_compiler_gnu
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -std=gnu99" >&5
-$as_echo_n "checking if $CC supports -std=gnu99... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -std=gnu9x" >&5
+$as_echo_n "checking if $CC supports -std=gnu9x... " >&6; }
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -16735,7 +16735,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLA
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_try_cflags_saved_cflags="${CFLAGS}"
- CFLAGS="${CFLAGS} -std=gnu99"
+ CFLAGS="${CFLAGS} -std=gnu9x"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */