summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Wulf C. Krueger <philantrop@exherbo.org> 2012-02-05 13:18:13 +0100
committerAvatar Wulf C. Krueger <philantrop@exherbo.org> 2012-02-05 13:18:13 +0100
commit01e9fe853745a179f3a5a49e1dbeb9f4cd3089dc (patch)
tree52b814840a5a44687a1e5da1dfbb4d0b3217ebec
parentc27b0b0e8e1f5712506956d45df56e689bbf5a66 (diff)
downloadphp-01e9fe853745a179f3a5a49e1dbeb9f4cd3089dc.tar.gz
php-01e9fe853745a179f3a5a49e1dbeb9f4cd3089dc.tar.xz
Initial exheres for dev-php/suhosin-0.9.33.
-rw-r--r--packages/dev-php/suhosin/suhosin-0.9.33.exheres-069
1 files changed, 69 insertions, 0 deletions
diff --git a/packages/dev-php/suhosin/suhosin-0.9.33.exheres-0 b/packages/dev-php/suhosin/suhosin-0.9.33.exheres-0
new file mode 100644
index 0000000..a3db9de
--- /dev/null
+++ b/packages/dev-php/suhosin/suhosin-0.9.33.exheres-0
@@ -0,0 +1,69 @@
+# Copyright 2012 Wulf C. Krueger <philantrop@exherbo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+SUMMARY="Suhosin is an advanced protection system for PHP installations"
+DESCRIPTION="
+Suhosin was designed to protect servers and users from known and unknown flaws
+in PHP applications and the PHP core. Suhosin comes in two independent parts,
+that can be used separately or in combination. The first part is a small patch
+against the PHP core, that implements a few low-level protections against buffer
+overflows or format string vulnerabilities and the second part is a powerful PHP
+extension that implements all the other protections.
+"
+HOMEPAGE="http://www.hardened-php.net/${PN}/"
+DOWNLOADS="http://download.${PN}.org/${PNV}.tgz"
+
+BUGS_TO="philantrop@exherbo.org"
+UPSTREAM_CHANGELOG="${HOMEPAGE}/changelog.html [[ lang = en ]]"
+LICENCES="PHP-3"
+SLOT="0"
+PLATFORMS="~amd64"
+MYOPTIONS=""
+
+# The tests are potentially interactive.
+RESTRICT="test"
+
+DEPENDENCIES="
+ build+run:
+ dev-lang/php
+ run:
+ suggestion:
+ dev-lang/php[suhosin] [[ description = [ Adds the core PHP suhosin patch as well ] ]]
+"
+
+src_configure() {
+ phpize
+
+ default
+}
+
+src_test() {
+ export TEST_PHP_EXECUTABLE=/usr/bin/php
+
+ emake -j1 test
+}
+
+src_install() {
+ # Let install write to PHP exstension directory.
+ esandbox allow $(php-config --extension-dir)
+
+ # Provide a updated php.ini which loads the new extension - based on the current php.ini.
+ edo mkdir -p "${IMAGE}"/etc/php
+ edo cp /etc/php/php.ini "${IMAGE}"/etc/php/php.ini
+ hasLines=$(grep -c "extension = ${PN}.so" "${IMAGE}"/etc/php/php.ini)
+ if [[ $hasLines -eq 0 ]] ; then
+ # Find linenumber extension_dir and use the next line.
+ linenum=$(edo grep -n "extension_dir" "${IMAGE}"/etc/php/php.ini | head -1 | awk -F: '{ print $1}')
+ linenum=$((linenum+1))
+ # Insert extension in php.ini.
+ edo sed -i "${linenum}i\extension = ${PN}.so" "${IMAGE}"/etc/php/php.ini
+ fi
+
+ default
+}
+
+pkg_postinst() {
+ # Make sure the extension is executable.
+ edo chmod +x $(php-config --extension-dir)/${PN}.so
+}
+