Skip to contentSkip to conversation

matrix-lighttpd: Fix PATH environment variable

PATCH New Franklin S. Cooper Jr 1 participant 1 message Oct 6, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 matrix-lighttpd: Fix PATH environment variable

* Alot of Matrix applications were failing due to an incomplete list of paths listed in the PATH environment variable when a shell script is executed by PHP.
* Add and configure mod_setenv module to explicitly set the PATH variable to properly include all the necessary paths.
* Add proper license file. Grabbed COPYING file from lighttpd v1.4.30

---
Version 2 changes:
Update PR syntax
Grabbed the license file COPYING from lighttpd and use that for the checksum.

 .../recipes-core/matrix/matrix-lighttpd-config.bb  |   11 +++++--
 .../matrix/matrix-lighttpd-config/COPYING          |   31 ++++++++++++++++++++
 .../matrix-lighttpd-config/lighttpd.conf.matrix    |    5 ++-
 3 files changed, 43 insertions(+), 4 deletions(-)
 create mode 100644 meta-arago-extras/recipes-core/matrix/matrix-lighttpd-config/COPYING
meta-arago-extras/recipes-core/matrix/matrix-lighttpd-config.bb +8 -3
index 8ecfa55..f47b0e0 100644
@@ -1,21 +1,26 @@
 DESCRIPTION = "Lighttpd config for Matrix"
 
 LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://../lighttpd.conf.matrix;md5=bf036dce30a4114d5942c1f8d0152191"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e4dac5c6ab169aa212feb5028853a579"
 
 inherit allarch
 
-PR = "1"
+PR = "r2"
 
 SRC_URI = "file://lighttpd.conf.matrix"
 
+# Grabbed COPYING file from lighttpd_1.4.30
+SRC_URI += "file://COPYING"
+
+S = "${WORKDIR}"
+
 do_install() {
 	install -d ${D}${sysconfdir}
 	install -m 0644 ${WORKDIR}/lighttpd.conf.matrix ${D}${sysconfdir}/lighttpd.conf.matrix
 }
 
 FILES_${PN} = "${sysconfdir}/lighttpd.conf.matrix"
-RDEPENDS_${PN} = "lighttpd"
+RDEPENDS_${PN} = "lighttpd lighttpd-module-setenv"
 
 pkg_postinst_${PN} () {
 if [ -f $D${sysconfdir}/lighttpd.conf ] ; then
meta-arago-extras/recipes-core/matrix/matrix-lighttpd-config/COPYING new file +31 -0
new file mode 100644
index 0000000..1333e45
@@ -0,0 +1,31 @@
+
+
+Copyright (c) 2004, Jan Kneschke, incremental
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+- Neither the name of the 'incremental' nor the names of its contributors may
+  be used to endorse or promote products derived from this software without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
meta-arago-extras/recipes-core/matrix/matrix-lighttpd-config/lighttpd.conf.matrix +4 -1
index d2e9217..82a9fb8 100755
@@ -20,7 +20,7 @@ server.modules              = (
 #                               "mod_trigger_b4_dl",
 #                               "mod_auth",
 #                               "mod_status",
-#                               "mod_setenv",
+                                "mod_setenv",
                                 "mod_expire",
 #                               "mod_fastcgi",
 #                               "mod_proxy",
@@ -296,6 +296,9 @@ $HTTP["url"] =~ "\.(jpg|gif|png)$" { expire.url = ( "" => "access 3 years" ) }
 #### setenv
 #setenv.add-request-header  = ( "TRAV_ENV" => "mysql://user@host/db" )
 #setenv.add-response-header = ( "X-Secret-Message" => "42" )
+setenv.add-environment = (
+    "PATH" => "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:."
+)
 
 ## for mod_trigger_b4_dl
 # trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db"
Signature · 1 line
1.7.0.4