Skip to content

Commit

Permalink
Tidy up lighttpd formula
Browse files Browse the repository at this point in the history
Based on feedback in PR #917
Drop attr support
Building with libev is no longer a supported option
Use kqueue support as it's the optimum means
sendfile support is officially supported in 10.5 but is actually
there in 10.4 but guarded off, one of the parameters is a different
type though. Play it safe.
bzip2 encoding was non-standard so skip using it.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
  • Loading branch information
sevan authored and mistydemeo committed Aug 19, 2023
1 parent 505ae81 commit 42bcaf2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Library/Formula/lighttpd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Lighttpd < Formula
depends_on "openssl"
depends_on "xxhash"
depends_on "lua51" => :optional
depends_on "libev" => :optional

# default max. file descriptors; this option will be ignored if the server is not started as root
MAX_FDS = 512
Expand Down Expand Up @@ -40,13 +39,10 @@ def install
--sbindir=#{bin}
--with-openssl
--with-zlib
--with-bzip2
--with-attr
--with-xxhash
]

args << "--with-lua" if build.with? "lua51"
args << "--with-libev" if build.with? "libev"

system "./configure", *args
system "make", "install"
Expand All @@ -65,12 +61,12 @@ def install

s.sub!(/^server\.username\s*=\s*".+"$/, 'server.username = "_www"')
s.sub!(/^server\.groupname\s*=\s*".+"$/, 'server.groupname = "_www"')
s.sub!(/^server\.event-handler\s*=\s*"linux-sysepoll"$/, 'server.event-handler = "select"')
s.sub!(/^server\.network-backend\s*=\s*"sendfile"$/, 'server.network-backend = "writev"')
s.sub!(/^#server\.event-handler\s*=\s*"linux-sysepoll"$/, 'server.event-handler = "kqueue"')
s.sub!(/^#server\.network-backend\s*=\s*"sendfile"$/, 'server.network-backend = "writev"')

# "max-connections == max-fds/2",
# http://redmine.lighttpd.net/projects/1/wiki/Server_max-connectionsDetails
s.sub!(/^server\.max-connections = .+$/, "server.max-connections = " + (MAX_FDS / 2).to_s)
s.sub!(/^#server\.max-connections = .+$/, "server.max-connections = " + (MAX_FDS / 2).to_s)
end
end

Expand Down

0 comments on commit 42bcaf2

Please sign in to comment.