diff options
Diffstat (limited to 'www-servers')
6 files changed, 552 insertions, 29 deletions
diff --git a/www-servers/lighttpd/Manifest b/www-servers/lighttpd/Manifest index 3c4f73ef..5e74492a 100644 --- a/www-servers/lighttpd/Manifest +++ b/www-servers/lighttpd/Manifest @@ -4,14 +4,19 @@ AUX 1.4.19-r2/05_all_lighttpd-1.4.19-force_lowercase_filenames_in_mod_userdir.di AUX 1.4.19-r2/07_all_lighttpd-1.4.19-closing_foreign_ssl_connections-dos-taketwo.diff 2948 RMD160 7cc3d41c227d7eb12204d353eec208fb9456a2b8 SHA1 0475987b269c229400b7e4527fdb98827114ae04 SHA256 3f2edba70fd5fd06e19657c14dc7b314cdec7c54bef96587ee5b50662c26c025 AUX 1.4.19-r2/10_all_lighttpd-1.4.18-dirlisting-sort.diff 3482 RMD160 def2d4cb50973a0a4c62a68e2455ea97273ec514 SHA1 54281eb0405bb73edf9a11e606f1099b94df7bb5 SHA256 5c5cc0976d99b73bc949b10ffd6343d0a9de7aa0a4a03bf92fe071a5c3f67e80 AUX 1.4.19-r2/11_all_lighttpd-1.4.18-dirlisting-brezhoneg-on-sort.diff 2960 RMD160 ef621718a87b32790514b639c2f5c7fd2d5e1ca9 SHA1 cf1e9eb509d150387708b76086adfc32c72d9078 SHA256 2620e3ae8bae994c3e9adfff062338f5c9482272c8ba5737216b48619c5cc743 +AUX 1.4.20/03_all_lighttpd-1.4.11-errorlog-pipe.diff 4931 RMD160 7653167b0cd3fde6cb7d3d6fe4ae30a8d2e56ebe SHA1 bd0ff91b5caf447f78bcad66a444fbe3719897fb SHA256 2b1a253dda1dbc688ac072608656121f8c2d346a64be1080c65f2ca1d81f8e2d +AUX 1.4.20/10_all_lighttpd-1.4.18-dirlisting-sort.diff 3482 RMD160 def2d4cb50973a0a4c62a68e2455ea97273ec514 SHA1 54281eb0405bb73edf9a11e606f1099b94df7bb5 SHA256 5c5cc0976d99b73bc949b10ffd6343d0a9de7aa0a4a03bf92fe071a5c3f67e80 +AUX 1.4.20/11_all_lighttpd-1.4.18-dirlisting-brezhoneg-on-sort.diff 2960 RMD160 ef621718a87b32790514b639c2f5c7fd2d5e1ca9 SHA1 cf1e9eb509d150387708b76086adfc32c72d9078 SHA256 2620e3ae8bae994c3e9adfff062338f5c9482272c8ba5737216b48619c5cc743 AUX conf/lighttpd.conf 8182 RMD160 450cf40f4ec517331f8932618a3c492cb566e4f3 SHA1 16922786a79807fa3233d1af105a99582d3486a5 SHA256 c0f6951e00d4e8c928f1799a84976ab8bb536bd59a104c13ca9d1d3661d8cebd AUX conf/mime-types.conf 3291 RMD160 157c9a6f7d00e52c7d4118edcce8d1eb1e0a3c20 SHA1 3eec39060014e1498d3254919b10a64ca1e6ff00 SHA256 575231104d51fa1882c47021ab0aa00d615401059a6748d64453cb39aafba537 AUX conf/mod_cgi.conf 869 RMD160 1d447bad36822657d014990128891cbdb6169468 SHA1 30066f52e469339cc8a5df8864b4cc2d9c558c3d SHA256 322656b4cfd22ca9f1f8ab160e0b932f1646622422fd49c6fc82ab416223eecf AUX conf/mod_fastcgi.conf-1.4.13-r2 687 RMD160 f165f27a08f35c4792bd332be3a04370b69152e3 SHA1 ebb469944098a91772424a825fdd5a0464cef158 SHA256 d1adc1358b5d9e85353caa2e706bfa231d145dd59c075cdcb3f818b3cb5d722e AUX lighttpd.confd 315 RMD160 c2d9c166a1209b853b400b5d21627f5d3f2d5216 SHA1 a09597a0d38d0b4d36a8f16f5d6fd5c4b7462b26 SHA256 94f69a173dc26610a43532474230537b9bc31ec846fb9f94cb72765f125edf87 -AUX lighttpd.initd-1.4.13-r3 1442 RMD160 17ce31a67f06f22b351ba6abfd868925eb5ad85f SHA1 58678d19bb60fd4e52a55381d9277ca472cbe805 SHA256 a4865824084d952050a1edc93bdffcbca33532d69268e13e96bb86c1a9a4bae6 +AUX lighttpd.initd-1.4.13-r3 1162 RMD160 9a1afa2777428a27857e9e587c1e94457b95c6eb SHA1 e1208f1906cf089e8bac00d0271b4691e9922f60 SHA256 8bbe703055f65742158ceeed7725a914d2fa4059e720b9983fa5e647626111aa AUX lighttpd.logrotate 487 RMD160 2edb8b4abf75031af0a3b4182efb5b589dfa0d3c SHA1 24e1b048d7be5520ca5ef8ce31b55df13cc8d72b SHA256 503ee1cd454e2c0f9a212ef60dc8321893eda06ccf721ecbe94d189a09e0bc6c AUX spawn-fcgi.confd 1076 RMD160 9468249fdedc39fa762a569622bae93f8b3481f9 SHA1 81bad945fc016275873e01e5f69838f73b275a3a SHA256 bfa452a849165f921a2febf0b06879db18c4c921f156b1452d06bb821063f768 AUX spawn-fcgi.initd 1398 RMD160 3fd0fa41d100629e85960034237abc0866ec3d38 SHA1 9c07c9fd59ec73d5f37df109b188b8a7d691f949 SHA256 ae10c764e2bde9bfc483c57ca94a63d87c24cba00b4c06917885c533d2d245b1 DIST lighttpd-1.4.19.tar.bz2 610347 RMD160 8731ba3efc95659a16dbb11b7298e3b539ab3c75 SHA1 fd4450e7faae55ebe0905114722995b0c57397cc SHA256 a239323239c3735a04290f7c063a14ed2c4560a88c15181c253fcd68c6c2f1d7 +DIST lighttpd-1.4.20.tar.bz2 618018 RMD160 0fcc71d6063574da86b610c9bdc16b7e44f9d2e7 SHA1 e5944a40579e0f37c6a0eeb0ad751344b2d6006c SHA256 3cda2ce779f24948062f765f2630b5865e483f5fab7149681a2a25422fd61176 EBUILD lighttpd-1.4.19-r2.ebuild 5839 RMD160 0947b4c115cc5ecbc0ec67aa4b077b70c1714d09 SHA1 9ccbbb41364d162b09e52134cbc47c72f731ffdc SHA256 373f9b64c41abce5d09af55a16218ab34ac44bedc4cc6019d034d20865db4ac4 +EBUILD lighttpd-1.4.20.ebuild 5840 RMD160 437f59972b4993672d97baa750983e26dfb9698d SHA1 a1aac672f758e34fd8ab36873d29748ea75ef339 SHA256 e70d76f86dabc8eaf9dd654386e46726749221b73bdcdf1ac4122d9419edbe4b diff --git a/www-servers/lighttpd/files/1.4.20/03_all_lighttpd-1.4.11-errorlog-pipe.diff b/www-servers/lighttpd/files/1.4.20/03_all_lighttpd-1.4.11-errorlog-pipe.diff new file mode 100644 index 00000000..5133fea9 --- /dev/null +++ b/www-servers/lighttpd/files/1.4.20/03_all_lighttpd-1.4.11-errorlog-pipe.diff @@ -0,0 +1,175 @@ +Initial patch from http://trac.lighttpd.net/trac/ticket/296 +Updated to apply against 1.4.20 by hoffie +Upstream will only accept it once it has been changed to make the pipe logging more generic + +diff -r 447bac6969ef src/base.h +--- a/src/base.h Tue Aug 19 18:04:17 2008 +0200 ++++ b/src/base.h Tue Aug 19 19:45:00 2008 +0200 +@@ -530,7 +530,7 @@ + + /* the errorlog */ + int errorlog_fd; +- enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG } errorlog_mode; ++ enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode; + buffer *errorlog_buf; + + fdevents *ev, *ev_ins; +diff -r 447bac6969ef src/log.c +--- a/src/log.c Tue Aug 19 18:04:17 2008 +0200 ++++ b/src/log.c Tue Aug 19 19:45:00 2008 +0200 +@@ -57,10 +57,11 @@ + /** + * open the errorlog + * +- * we have 3 possibilities: ++ * we have 4 possibilities: + * - stderr (default) + * - syslog + * - logfile ++ * - pipe + * + * if the open failed, report to the user and die + * +@@ -79,21 +80,80 @@ + srv->errorlog_mode = ERRORLOG_SYSLOG; + } else if (!buffer_is_empty(srv->srvconf.errorlog_file)) { + const char *logfile = srv->srvconf.errorlog_file->ptr; ++ if (logfile[0] == '|') { ++#ifdef HAVE_FORK ++ /* create write pipe and spawn process */ + +- if (-1 == (srv->errorlog_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) { +- log_error_write(srv, __FILE__, __LINE__, "SSSS", ++ int to_log_fds[2]; ++ int fd; ++ pid_t pid; ++ ++ if (pipe(to_log_fds)) { ++ log_error_write(srv, __FILE__, __LINE__, "ss", ++ "pipe failed: ", strerror(errno)); ++ return -1; ++ } ++ ++ /* fork, execve */ ++ switch (pid = fork()) { ++ case 0: ++ /* child */ ++ ++ close(STDIN_FILENO); ++ dup2(to_log_fds[0], STDIN_FILENO); ++ close(to_log_fds[0]); ++ /* not needed */ ++ close(to_log_fds[1]); ++ ++ /* we don't need the client socket */ ++ for (fd = 3; fd < 256; fd++) { ++ close(fd); ++ } ++ ++ /* exec the log-process (skip the | ) ++ * ++ */ ++ ++ execl("/bin/sh", "sh", "-c", logfile + 1, NULL); ++ ++ log_error_write(srv, __FILE__, __LINE__, "sss", ++ "spawning log-process failed: ", ++ strerror(errno), logfile + 1); ++ ++ exit(-1); ++ break; ++ case -1: ++ /* error */ ++ log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed:", strerror(errno)); ++ break; ++ default: ++ close(to_log_fds[0]); ++ ++ srv->errorlog_fd = to_log_fds[1]; ++ ++ break; ++ } ++ srv->errorlog_mode = ERRORLOG_PIPE; ++#else ++ log_error_write(srv, __FILE__, __LINE__, "SSS", ++ "opening errorlog '", logfile,"' impossible"); ++ return -1; ++#endif ++ } else { ++ if (-1 == (srv->errorlog_fd = open(logfile, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) { ++ log_error_write(srv, __FILE__, __LINE__, "SSSS", + "opening errorlog '", logfile, + "' failed: ", strerror(errno)); + +- return -1; ++ return -1; ++ } ++ srv->errorlog_mode = ERRORLOG_FILE; + } + #ifdef FD_CLOEXEC + /* close fd on exec (cgi) */ + fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC); + #endif +- srv->errorlog_mode = ERRORLOG_FILE; + } +- + log_error_write(srv, __FILE__, __LINE__, "s", "server started"); + + #ifdef HAVE_VALGRIND_VALGRIND_H +@@ -122,7 +182,7 @@ + */ + + int log_error_cycle(server *srv) { +- /* only cycle if we are not in syslog-mode */ ++ /* only cycle if the error log is a file */ + + if (srv->errorlog_mode == ERRORLOG_FILE) { + const char *logfile = srv->srvconf.errorlog_file->ptr; +@@ -154,6 +214,7 @@ + + int log_error_close(server *srv) { + switch(srv->errorlog_mode) { ++ case ERRORLOG_PIPE: /* fall through */ + case ERRORLOG_FILE: + close(srv->errorlog_fd); + break; +@@ -173,6 +234,7 @@ + va_list ap; + + switch(srv->errorlog_mode) { ++ case ERRORLOG_PIPE: + case ERRORLOG_FILE: + case ERRORLOG_STDERR: + /* cache the generated timestamp */ +@@ -257,6 +319,7 @@ + va_end(ap); + + switch(srv->errorlog_mode) { ++ case ERRORLOG_PIPE: /* fall through */ + case ERRORLOG_FILE: + buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n")); + write(srv->errorlog_fd, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1); +diff -r 447bac6969ef src/mod_cgi.c +--- a/src/mod_cgi.c Tue Aug 19 18:04:17 2008 +0200 ++++ b/src/mod_cgi.c Tue Aug 19 19:45:00 2008 +0200 +@@ -781,7 +781,7 @@ + * + * we feed the stderr of the CGI to our errorlog, if possible + */ +- if (srv->errorlog_mode == ERRORLOG_FILE) { ++ if ((srv->errorlog_mode == ERRORLOG_FILE) || (srv->errorlog_mode == ERRORLOG_PIPE)) { + close(STDERR_FILENO); + dup2(srv->errorlog_fd, STDERR_FILENO); + } +diff -r 447bac6969ef src/mod_rrdtool.c +--- a/src/mod_rrdtool.c Tue Aug 19 18:04:17 2008 +0200 ++++ b/src/mod_rrdtool.c Tue Aug 19 19:45:00 2008 +0200 +@@ -134,7 +134,7 @@ + + close(STDERR_FILENO); + +- if (srv->errorlog_mode == ERRORLOG_FILE) { ++ if ((srv->errorlog_mode == ERRORLOG_FILE) || (srv->errorlog_mode == ERRORLOG_PIPE)) { + dup2(srv->errorlog_fd, STDERR_FILENO); + close(srv->errorlog_fd); + } diff --git a/www-servers/lighttpd/files/1.4.20/10_all_lighttpd-1.4.18-dirlisting-sort.diff b/www-servers/lighttpd/files/1.4.20/10_all_lighttpd-1.4.18-dirlisting-sort.diff new file mode 100644 index 00000000..f4bb6a5d --- /dev/null +++ b/www-servers/lighttpd/files/1.4.20/10_all_lighttpd-1.4.18-dirlisting-sort.diff @@ -0,0 +1,91 @@ +--- src/mod_dirlisting.c.old 2007-10-01 14:57:24.000000000 +0200 ++++ src/mod_dirlisting.c 2007-10-01 15:36:12.000000000 +0200 +@@ -503,6 +503,73 @@ + "}\n" + "</style>\n" + ); ++ ++ BUFFER_APPEND_STRING_CONST(out, ++ "<script type=\"text/javascript\">\n" ++ "// <!--\n" ++ "var sort_column;\n" ++ "var prev_span = null;\n"); ++ ++ BUFFER_APPEND_STRING_CONST(out, ++ "function get_inner_text(el) {\n" ++ " if((typeof el == 'string')||(typeof el == 'undefined'))\n" ++ " return el;\n" ++ " if(el.innerText)\n" ++ " return el.innerText;\n" ++ " else {\n" ++ " var str = \"\";\n" ++ " var cs = el.childNodes;\n" ++ " var l = cs.length;\n" ++ " for (i=0;i<l;i++) {\n" ++ " if (cs[i].nodeType==1) str += get_inner_text(cs[i]);\n" ++ " else if (cs[i].nodeType==3) str += cs[i].nodeValue;\n" ++ " }\n" ++ " }\n" ++ " return str;\n" ++ "}\n"); ++ ++ BUFFER_APPEND_STRING_CONST(out, ++ "function sortfn(a,b) {\n" ++ " var at = get_inner_text(a.cells[sort_column]);\n" ++ " var bt = get_inner_text(b.cells[sort_column]);\n" ++ " if (a.cells[sort_column].className == 'int') {\n" ++ " return parseInt(at)-parseInt(bt);\n" ++ " } else {\n" ++ " aa = at.toLowerCase();\n" ++ " bb = bt.toLowerCase();\n" ++ " if (aa==bb) return 0;\n" ++ " else if (aa<bb) return -1;\n" ++ " else return 1;\n" ++ " }\n" ++ "}\n"); ++ ++ BUFFER_APPEND_STRING_CONST(out, ++ "function resort(lnk) {\n" ++ " var span = lnk.childNodes[1];\n" ++ " var table = lnk.parentNode.parentNode.parentNode.parentNode;\n" ++ " var rows = new Array();\n" ++ " for (j=1;j<table.rows.length;j++)\n" ++ " rows[j-1] = table.rows[j];\n" ++ " sort_column = lnk.parentNode.cellIndex;\n" ++ " rows.sort(sortfn);\n"); ++ ++ BUFFER_APPEND_STRING_CONST(out, ++ " if (prev_span != null) prev_span.innerHTML = '';\n" ++ " if (span.getAttribute('sortdir')=='down') {\n" ++ " span.innerHTML = '↑';\n" ++ " span.setAttribute('sortdir','up');\n" ++ " rows.reverse();\n" ++ " } else {\n" ++ " span.innerHTML = '↓';\n" ++ " span.setAttribute('sortdir','down');\n" ++ " }\n" ++ " for (i=0;i<rows.length;i++)\n" ++ " table.tBodies[0].appendChild(rows[i]);\n" ++ " prev_span = span;\n" ++ "}\n" ++ "// -->\n" ++ "</script>\n"); ++ + } + + BUFFER_APPEND_STRING_CONST(out, "</head>\n<body>\n"); +@@ -532,10 +599,10 @@ + "<table summary=\"Directory Listing\" cellpadding=\"0\" cellspacing=\"0\">\n" + "<thead>" + "<tr>" +- "<th class=\"n\">Name</th>" +- "<th class=\"m\">Last Modified</th>" +- "<th class=\"s\">Size</th>" +- "<th class=\"t\">Type</th>" ++ "<th class=\"n\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Name <span class=\"sortarrow\"></span></a></th>" ++ "<th class=\"m\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Last Modified <span class=\"sortarrow\"></span></a></th>" ++ "<th class=\"s\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Size <span class=\"sortarrow\"></span></a></th>" ++ "<th class=\"t\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Type <span class=\"sortarrow\"></span></a></th>" + "</tr>" + "</thead>\n" + "<tbody>\n" diff --git a/www-servers/lighttpd/files/1.4.20/11_all_lighttpd-1.4.18-dirlisting-brezhoneg-on-sort.diff b/www-servers/lighttpd/files/1.4.20/11_all_lighttpd-1.4.18-dirlisting-brezhoneg-on-sort.diff new file mode 100644 index 00000000..aa81da57 --- /dev/null +++ b/www-servers/lighttpd/files/1.4.20/11_all_lighttpd-1.4.18-dirlisting-brezhoneg-on-sort.diff @@ -0,0 +1,54 @@ +--- src/mod_dirlisting.c.ori 2007-11-06 19:22:03.456537443 +0100 ++++ src/mod_dirlisting.c 2007-11-06 19:22:56.430836948 +0100 +@@ -458,7 +458,7 @@ + "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n" + "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n" + "<head>\n" +- "<title>Index of " ++ "<title>Taolenn verr " + ); + buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_MINIMAL_XML); + BUFFER_APPEND_STRING_CONST(out, "</title>\n"); +@@ -591,7 +591,7 @@ + stream_close(&s); + } + +- BUFFER_APPEND_STRING_CONST(out, "<h2>Index of "); ++ BUFFER_APPEND_STRING_CONST(out, "<h2>Taolenn verr "); + buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_MINIMAL_XML); + BUFFER_APPEND_STRING_CONST(out, + "</h2>\n" +@@ -599,18 +599,18 @@ + "<table summary=\"Directory Listing\" cellpadding=\"0\" cellspacing=\"0\">\n" + "<thead>" + "<tr>" +- "<th class=\"n\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Name <span class=\"sortarrow\"></span></a></th>" +- "<th class=\"m\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Last Modified <span class=\"sortarrow\"></span></a></th>" +- "<th class=\"s\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Size <span class=\"sortarrow\"></span></a></th>" +- "<th class=\"t\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Type <span class=\"sortarrow\"></span></a></th>" ++ "<th class=\"n\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Anv <span class=\"sortarrow\"></span></a></th>" ++ "<th class=\"m\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Kemm da ziwezhañ <span class=\"sortarrow\"></span></a></th>" ++ "<th class=\"s\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Brasentez <span class=\"sortarrow\"></span></a></th>" ++ "<th class=\"t\"><a href=\"#\" class=\"sortheader\" onclick=\"resort(this);return false;\">Benaos <span class=\"sortarrow\"></span></a></th>" + "</tr>" + "</thead>\n" + "<tbody>\n" + "<tr>" +- "<td class=\"n\"><a href=\"../\">Parent Directory</a>/</td>" ++ "<td class=\"n\"><a href=\"../\">Dreist</a>/</td>" + "<td class=\"m\"> </td>" + "<td class=\"s\">- </td>" +- "<td class=\"t\">Directory</td>" ++ "<td class=\"t\">Roll Skridoù</td>" + "</tr>\n" + ); + } +@@ -835,7 +835,7 @@ + buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_MINIMAL_XML); + BUFFER_APPEND_STRING_CONST(out, "</a>/</td><td class=\"m\">"); + buffer_append_string_len(out, datebuf, sizeof(datebuf) - 1); +- BUFFER_APPEND_STRING_CONST(out, "</td><td class=\"s\">- </td><td class=\"t\">Directory</td></tr>\n"); ++ BUFFER_APPEND_STRING_CONST(out, "</td><td class=\"s\">- </td><td class=\"t\">Roll Skridoù</td></tr>\n"); + + free(tmp); + } diff --git a/www-servers/lighttpd/files/lighttpd.initd-1.4.13-r3 b/www-servers/lighttpd/files/lighttpd.initd-1.4.13-r3 index 80aaacc5..1ce30659 100644 --- a/www-servers/lighttpd/files/lighttpd.initd-1.4.13-r3 +++ b/www-servers/lighttpd/files/lighttpd.initd-1.4.13-r3 @@ -1,9 +1,9 @@ #!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd-1.4.13-r3,v 1.2 2007/10/12 20:54:46 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd,v 1.12 2007/10/12 20:54:46 swegener Exp $ -opts="reload graceful" +opts="depend checkconfig start stop reload" depend() { need net @@ -13,7 +13,7 @@ depend() { } checkconfig() { - if [ ! -f "${LIGHTTPD_CONF}" ] ; then + if [[ ! -f ${LIGHTTPD_CONF} ]] ; then ewarn "${LIGHTTPD_CONF} does not exist." return 1 fi @@ -25,43 +25,31 @@ start() { checkconfig || return 1 ebegin "Starting lighttpd" - start-stop-daemon --start --quiet --exec /usr/sbin/lighttpd \ - --pidfile "${LIGHTTPD_PID}" -- -f "${LIGHTTPD_CONF}" + start-stop-daemon --start --quiet \ + --background --pidfile ${LIGHTTPD_PID} \ + --exec /usr/sbin/lighttpd -- -f ${LIGHTTPD_CONF} eend $? } stop() { local rv=0 ebegin "Stopping lighttpd" - start-stop-daemon --stop --quiet --pidfile "${LIGHTTPD_PID}" - eend $? + if start-stop-daemon --stop --quiet --pidfile ${LIGHTTPD_PID} \ + --signal 2 ; then + rm -f ${LIGHTTPD_PID} + else + rv=1 + fi + eend $rv } reload() { - if ! service_started "${SVCNAME}" ; then - eerror "${SVCNAME} isn't running" + if [ ! -f ${LIGHTTPD_PID} ]; then + eerror "lighttpd isn't running" return 1 fi checkconfig || return 1 - ebegin "Re-opening lighttpd log files" - start-stop-daemon --stop --oknodo --quiet --pidfile "${LIGHTTPD_PID}" \ - --signal HUP + kill -HUP `cat ${LIGHTTPD_PID}` &>/dev/null eend $? } - -graceful() { - if ! service_started "${SVCNAME}" ; then - eerror "${SVCNAME} isn't running" - return 1 - fi - checkconfig || return 1 - - ebegin "Gracefully stopping lighttpd" - start-stop-daemon --stop --oknodo --quiet --pidfile "${LIGHTTPD_PID}" \ - --signal INT - if eend $? ; then - rm -f "${LIGHTTPD_PID}" - start - fi -} diff --git a/www-servers/lighttpd/lighttpd-1.4.20.ebuild b/www-servers/lighttpd/lighttpd-1.4.20.ebuild new file mode 100644 index 00000000..d56f961a --- /dev/null +++ b/www-servers/lighttpd/lighttpd-1.4.20.ebuild @@ -0,0 +1,210 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/lighttpd-1.4.20.ebuild,v 1.6 2008/10/01 10:17:07 corsair Exp $ + +WANT_AUTOCONF=latest +WANT_AUTOMAKE=latest +inherit eutils autotools depend.php + +DESCRIPTION="Lightweight high-performance web server" +HOMEPAGE="http://www.lighttpd.net/" +SRC_URI="http://www.lighttpd.net/download/${P}.tar.bz2" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ~ppc ppc64 ~sh sparc ~sparc-fbsd x86 ~x86-fbsd" +IUSE="bzip2 doc fam fastcgi gdbm ipv6 ldap lua minimal memcache mysql pcre php rrdtool ssl test webdav xattr" + +RDEPEND=">=sys-libs/zlib-1.1 + bzip2? ( app-arch/bzip2 ) + fam? ( virtual/fam ) + gdbm? ( sys-libs/gdbm ) + ldap? ( >=net-nds/openldap-2.1.26 ) + lua? ( >=dev-lang/lua-5.1 ) + memcache? ( dev-libs/libmemcache ) + mysql? ( >=virtual/mysql-4.0 ) + pcre? ( >=dev-libs/libpcre-3.1 ) + php? ( virtual/httpd-php ) + rrdtool? ( net-analyzer/rrdtool ) + ssl? ( >=dev-libs/openssl-0.9.7 ) + webdav? ( + dev-libs/libxml2 + >=dev-db/sqlite-3 + sys-fs/e2fsprogs + ) + xattr? ( kernel_linux? ( sys-apps/attr ) )" + +DEPEND="${RDEPEND} + doc? ( dev-python/docutils ) + test? ( + virtual/perl-Test-Harness + dev-libs/fcgi + )" + +# update certain parts of lighttpd.conf based on conditionals +update_config() { + local config="/etc/lighttpd/lighttpd.conf" + + # enable php/mod_fastcgi settings + use php && \ + dosed 's|#.*\(include.*fastcgi.*$\)|\1|' ${config} + + # enable stat() caching + use fam && \ + dosed 's|#\(.*stat-cache.*$\)|\1|' ${config} +} + +# remove non-essential stuff (for USE=minimal) +remove_non_essential() { + local libdir="${D}/usr/$(get_libdir)/${PN}" + + # text docs + use doc || rm -fr "${D}"/usr/share/doc/${PF}/txt + + # non-essential modules + rm -f \ + ${libdir}/mod_{compress,evhost,expire,proxy,scgi,secdownload,simple_vhost,status,setenv,trigger*,usertrack}.* + + # allow users to keep some based on USE flags + use pcre || rm -f ${libdir}/mod_{ssi,re{direct,write}}.* + use webdav || rm -f ${libdir}/mod_webdav.* + use mysql || rm -f ${libdir}/mod_mysql_vhost.* + use lua || rm -f ${libdir}/mod_{cml,magnet}.* + use rrdtool || rm -f ${libdir}/mod_rrdtool.* + + if ! use fastcgi ; then + rm -f ${libdir}/mod_fastcgi.* "${D}"/usr/bin/spawn-fcgi \ + "${D}"/usr/share/man/man1/spawn-fcgi.* + fi +} + +pkg_setup() { + if ! use pcre ; then + ewarn "It is highly recommended that you build ${PN}" + ewarn "with perl regular expressions support via USE=pcre." + ewarn "Otherwise you lose support for some core options such" + ewarn "as conditionals and modules such as mod_re{write,direct}" + ewarn "and mod_ssi." + ebeep 5 + fi + + use php && require_php_with_use cgi + + enewgroup lighttpd + enewuser lighttpd -1 -1 /var/www/localhost/htdocs lighttpd +} + +src_unpack() { + unpack ${A} + cd "${S}" + + EPATCH_SUFFIX="diff" EPATCH_OPTS="-l" epatch "${FILESDIR}"/"${PVR}" || die "Patching failed!" + + eautoreconf || die + + # dev-python/docutils installs rst2html.py not rst2html + sed -i -e 's|\(rst2html\)|\1.py|g' doc/Makefile.in || \ + die "sed doc/Makefile.in failed" + + # fix typo + sed -i -e 's|\(output_content\)_\(type\)|\1\2|' doc/cml.txt || \ + die "sed doc/cml.txt failed" +} + +src_compile() { + econf --libdir=/usr/$(get_libdir)/${PN} \ + --enable-lfs \ + $(use_enable ipv6) \ + $(use_with bzip2) \ + $(use_with fam) \ + $(use_with gdbm) \ + $(use_with lua) \ + $(use_with ldap) \ + $(use_with memcache) \ + $(use_with mysql) \ + $(use_with pcre) \ + $(use_with ssl openssl) \ + $(use_with webdav webdav-props) \ + $(use_with webdav webdav-locks) \ + $(use_with xattr attr) \ + || die "econf failed" + + emake || die "emake failed" + + if use doc ; then + einfo "Building HTML documentation" + cd doc + emake html || die "failed to build HTML documentation" + fi +} + +src_install() { + make DESTDIR="${D}" install || die "make install failed" + + # init script stuff + newinitd "${FILESDIR}"/lighttpd.initd-1.4.13-r3 lighttpd || die + newconfd "${FILESDIR}"/lighttpd.confd lighttpd || die + use fam && has_version app-admin/fam && \ + sed -i 's/after famd/need famd/g' "${D}"/etc/init.d/lighttpd + + if use php || use fastcgi ; then + newinitd "${FILESDIR}"/spawn-fcgi.initd spawn-fcgi || die + newconfd "${FILESDIR}"/spawn-fcgi.confd spawn-fcgi || die + fi + + # configs + insinto /etc/lighttpd + doins "${FILESDIR}"/conf/lighttpd.conf + doins "${FILESDIR}"/conf/mime-types.conf + doins "${FILESDIR}"/conf/mod_cgi.conf + newins "${FILESDIR}"/conf/mod_fastcgi.conf-1.4.13-r2 mod_fastcgi.conf + # Secure directory for fastcgi sockets + keepdir /var/run/lighttpd/ + fperms 0750 /var/run/lighttpd/ + fowners lighttpd:lighttpd /var/run/lighttpd/ + + # update lighttpd.conf directives based on conditionals + update_config + + # docs + dodoc AUTHORS README NEWS ChangeLog doc/*.sh + newdoc doc/lighttpd.conf lighttpd.conf.distrib + + use doc && dohtml -r doc/* + + docinto txt + dodoc doc/*.txt + + # logrotate + insinto /etc/logrotate.d + newins "${FILESDIR}"/lighttpd.logrotate lighttpd || die + + keepdir /var/l{ib,og}/lighttpd /var/www/localhost/htdocs + fowners lighttpd:lighttpd /var/l{ib,og}/lighttpd + fperms 0750 /var/l{ib,og}/lighttpd + + use minimal && remove_non_essential +} + +pkg_postinst () { + echo + if [[ -f ${ROOT}etc/conf.d/spawn-fcgi.conf ]] ; then + einfo "spawn-fcgi is now included with lighttpd" + einfo "spawn-fcgi's init script configuration is now located" + einfo "at /etc/conf.d/spawn-fcgi." + echo + fi + + if [[ -f ${ROOT}etc/lighttpd.conf ]] ; then + ewarn "As of lighttpd-1.4.1, Gentoo has a customized configuration," + ewarn "which is now located in /etc/lighttpd. Please migrate your" + ewarn "existing configuration." + ebeep 5 + fi + + if use fam ; then + einfo "Remember to re-emerge lighttpd should you switch from" + einfo "app-admin/famd to app-admin/gamin or vice versa." + fi + echo +} |