From 849b2a31cc65f9418260972f016092cc616952e3 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Mon, 22 May 2017 23:21:03 +0100 Subject: dev-php/libphutil: Version bump Package-Manager: Portage-2.3.5, Repoman-2.3.1 --- ...usage-of-local-SSL-certificates-and-use-s.patch | 45 ------- ...usage-of-local-SSL-certificates-and-use-s.patch | 45 +++++++ ...usage-of-local-SSL-certificates-and-use-s.patch | 2 +- dev-php/libphutil/libphutil-20170318.ebuild | 133 --------------------- dev-php/libphutil/libphutil-20170429.ebuild | 133 +++++++++++++++++++++ 5 files changed, 179 insertions(+), 179 deletions(-) delete mode 100644 dev-php/libphutil/files/20170318-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch create mode 100644 dev-php/libphutil/files/20170429-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch delete mode 100644 dev-php/libphutil/libphutil-20170318.ebuild create mode 100644 dev-php/libphutil/libphutil-20170429.ebuild (limited to 'dev-php') diff --git a/dev-php/libphutil/files/20170318-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch b/dev-php/libphutil/files/20170318-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch deleted file mode 100644 index ac54c949..00000000 --- a/dev-php/libphutil/files/20170318-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 3e50411f075a10013b53e94d83dbc13c85ca60fa Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Tue, 13 Aug 2013 16:07:58 +0200 -Subject: [PATCH] Remove the usage of local SSL certificates and use system - provided by ca-certificates. - ---- - src/future/http/HTTPSFuture.php | 11 ++--------- - 1 file changed, 2 insertions(+), 9 deletions(-) - -diff --git a/src/future/http/HTTPSFuture.php b/src/future/http/HTTPSFuture.php -index 255e7f6878cd..7870de405aed 100644 ---- a/src/future/http/HTTPSFuture.php -+++ b/src/future/http/HTTPSFuture.php -@@ -310,28 +310,21 @@ final class HTTPSFuture extends BaseHTTPFuture { - // `setCABundle()` or similar. - // - Then, check if a global bundle is set explicitly for all requests, - // via `setGlobalCABundle()` or similar. -- // - Then, if a local custom.pem exists, use that, because it probably -- // means that the user wants to override everything (also because the -- // user might not have access to change the box's php.ini to add -- // curl.cainfo). - // - Otherwise, try using curl.cainfo. If it's set explicitly, it's - // probably reasonable to try using it before we fall back to what - // libphutil ships with. -- // - Lastly, try the default that libphutil ships with. If it doesn't -+ // - Lastly, try the default from ca-certificates. If it doesn't - // work, give up and yell at the user. - - if (!$this->getCABundle()) { -- $caroot = dirname(phutil_get_library_root('phutil')).'/resources/ssl/'; - $ini_val = ini_get('curl.cainfo'); - if (self::getGlobalCABundle()) { - $this->setCABundleFromPath(self::getGlobalCABundle()); -- } else if (Filesystem::pathExists($caroot.'custom.pem')) { -- $this->setCABundleFromPath($caroot.'custom.pem'); - } else if ($ini_val) { - // TODO: We can probably do a pathExists() here, even. - $this->setCABundleFromPath($ini_val); - } else { -- $this->setCABundleFromPath($caroot.'default.pem'); -+ $this->setCABundleFromPath('/etc/ssl/certs/ca-certificates.crt'); - } - } - diff --git a/dev-php/libphutil/files/20170429-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch b/dev-php/libphutil/files/20170429-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch new file mode 100644 index 00000000..5e3a1bb9 --- /dev/null +++ b/dev-php/libphutil/files/20170429-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch @@ -0,0 +1,45 @@ +From f220f8358ab4e18f5ce99d43e241e1d9f93ce97a Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Tue, 13 Aug 2013 16:07:58 +0200 +Subject: [PATCH] Remove the usage of local SSL certificates and use system + provided by ca-certificates. + +--- + src/future/http/HTTPSFuture.php | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/src/future/http/HTTPSFuture.php b/src/future/http/HTTPSFuture.php +index 255e7f6878cd..7870de405aed 100644 +--- a/src/future/http/HTTPSFuture.php ++++ b/src/future/http/HTTPSFuture.php +@@ -310,28 +310,21 @@ final class HTTPSFuture extends BaseHTTPFuture { + // `setCABundle()` or similar. + // - Then, check if a global bundle is set explicitly for all requests, + // via `setGlobalCABundle()` or similar. +- // - Then, if a local custom.pem exists, use that, because it probably +- // means that the user wants to override everything (also because the +- // user might not have access to change the box's php.ini to add +- // curl.cainfo). + // - Otherwise, try using curl.cainfo. If it's set explicitly, it's + // probably reasonable to try using it before we fall back to what + // libphutil ships with. +- // - Lastly, try the default that libphutil ships with. If it doesn't ++ // - Lastly, try the default from ca-certificates. If it doesn't + // work, give up and yell at the user. + + if (!$this->getCABundle()) { +- $caroot = dirname(phutil_get_library_root('phutil')).'/resources/ssl/'; + $ini_val = ini_get('curl.cainfo'); + if (self::getGlobalCABundle()) { + $this->setCABundleFromPath(self::getGlobalCABundle()); +- } else if (Filesystem::pathExists($caroot.'custom.pem')) { +- $this->setCABundleFromPath($caroot.'custom.pem'); + } else if ($ini_val) { + // TODO: We can probably do a pathExists() here, even. + $this->setCABundleFromPath($ini_val); + } else { +- $this->setCABundleFromPath($caroot.'default.pem'); ++ $this->setCABundleFromPath('/etc/ssl/certs/ca-certificates.crt'); + } + } + diff --git a/dev-php/libphutil/files/9999-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch b/dev-php/libphutil/files/9999-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch index 6fabc506..a5e82710 100644 --- a/dev-php/libphutil/files/9999-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch +++ b/dev-php/libphutil/files/9999-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch @@ -1,4 +1,4 @@ -From dc843fd77115268cf1aa9bbf91b85dd5789514f0 Mon Sep 17 00:00:00 2001 +From 48e85242e4e0dff592f6c5b46e916793bf2ed520 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Tue, 13 Aug 2013 16:07:58 +0200 Subject: [PATCH] Remove the usage of local SSL certificates and use system diff --git a/dev-php/libphutil/libphutil-20170318.ebuild b/dev-php/libphutil/libphutil-20170318.ebuild deleted file mode 100644 index 38699b76..00000000 --- a/dev-php/libphutil/libphutil-20170318.ebuild +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 -inherit eutils toolchain-funcs git-r3 - -DESCRIPTION="Collection of utility classes and functions for PHP used by phabricator" -HOMEPAGE="https://www.phacility.com" -EGIT_REPO_URI="git://github.com/phacility/libphutil.git" -EGIT_BRANCH="stable" -EGIT_COMMIT="24ede7a5dbfd38079c87fc61de64012551965837" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="ssl test" - -DEPEND="virtual/awk:0 - test? ( - sys-devel/bison:0 - >=sys-devel/flex-2.5.35:0 - =www-client/arcanist-20170224:0 - dev-lang/php[cli] - )" -RDEPEND="|| ( - dev-lang/php:5.6[curl,iconv,json,mysql,mysqli,pcntl,ssl?,unicode] - dev-lang/php:7.1[curl,iconv,json,mysql,mysqli,pcntl,ssl?,unicode] - ) - !!dev-lang/php:7.0" - -src_prepare() { - default - - git log --format='%H %ct' -n 1 > "${S}/GIT_COMMIT_INFO" - git remote add origin "${EGIT_REPO_URI}" - git remote -v > "${S}/GIT_REMOTE_INFO" - - epatch "${FILESDIR}/${PV}-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch" - - if use test ; then - tc-export AR CXX - fi - - find "${S}" -type f -name .gitignore -print0 \ - | xargs -0 --no-run-if-empty -- \ - rm - - rm -r resources/ssl - rm -r scripts/daemon/torture - rm scripts/build_xhpast.php - rm src/parser/xhpast/bin/xhpast.exe - - # Replace 'env' shebang to files it point to - find "${S}" -type f \ - | sort \ - | xargs -n 1 --no-run-if-empty -- \ - awk 'NR == 1 && /^#!\/usr\/bin\/env/ {print FILENAME}' \ - | while read ; do - set -- $(sed -ne '1 s:^#!\([^ ]*\) ::p;q' ${REPLY}) - cmd="$1" ; shift ; args="$@" - - case "${cmd}" in - bash|php) ;; - *) continue ;; - esac - - path="$(type -p ${cmd})" || continue - [[ -z "${path}" ]] && continue - - einfo "Replace ${REPLY/#${S}\/} shebang to #!${path} ${args}" - sed -i \ - -e "1 s:^#!.*:#!${path} ${args}:" \ - "${REPLY}" - eend $? - done -} - -src_compile() { - if use test ; then - cd support/xhpast - - # Avoid sandbox violation for dev-lang/php[snmp] - # php -f generate_nodes.php' - # - # * ACCESS DENIED: open_wr: /var/lib/net-snmp/mib_indexes/0 - # abs_path: /var/lib/net-snmp/mib_indexes/0 - # res_path: /var/lib/net-snmp/mib_indexes/0 - # /usr/lib64/libsandbox.so(+0xd9d1)[0x7f226c8899d1] - # /usr/lib64/libsandbox.so(+0xdaf8)[0x7f226c889af8] - # /usr/lib64/libsandbox.so(+0x59cf)[0x7f226c8819cf] - # /usr/lib64/libsandbox.so(fopen+0x7c)[0x7f226c8843ec] - # /usr/lib64/libnetsnmp.so.30(netsnmp_mibindex_new+0x48)[0x7f22695f55e8] - # /usr/lib64/libnetsnmp.so.30(add_mibdir+0x9c)[0x7f226960a00c] - # /usr/lib64/libnetsnmp.so.30(netsnmp_init_mib+0xca)[0x7f22695f4bea] - # /usr/lib64/libnetsnmp.so.30(init_snmp+0x32d)[0x7f226961c2dd] - # php(zm_startup_snmp+0x51)[0x7f226cf81e11] - # php(zend_startup_module_ex+0x11a)[0x7f226d0bccea] - # /proc/15834/cmdline: php -f generate_nodes.php - # - # See snmp_config(5) - export SNMP_PERSISTENT_DIR="${T}" - - emake - emake install - fi -} - -src_test() { - arc unit --everything --no-coverage || die "arc unit failed" -} - -src_install() { - insinto "/usr/share/${PN}" - doins GIT_COMMIT_INFO GIT_REMOTE_INFO - - insinto "/usr/share/php/${PN}" - doins -r externals resources scripts src - - if use test ; then - fperms 755 "/usr/share/php/${PN}/src/parser/xhpast/bin/xhpast" - dosym "/usr/share/php/${PN}/src/parser/xhpast/bin/xhpast" /usr/bin/xhpast - fi - - # Make executable all shebanged files - find "${ED}" -type f \ - | xargs -n 1 --no-run-if-empty -- \ - awk 'NR == 1 && /^#!/ {print FILENAME}' \ - | sed -e "s:${ED}:/:" \ - | xargs --no-run-if-empty -- \ - fperms 755 - - dodoc NOTICE README.md -} diff --git a/dev-php/libphutil/libphutil-20170429.ebuild b/dev-php/libphutil/libphutil-20170429.ebuild new file mode 100644 index 00000000..0f4996c8 --- /dev/null +++ b/dev-php/libphutil/libphutil-20170429.ebuild @@ -0,0 +1,133 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit eutils toolchain-funcs git-r3 + +DESCRIPTION="Collection of utility classes and functions for PHP used by phabricator" +HOMEPAGE="https://www.phacility.com" +EGIT_REPO_URI="git://github.com/phacility/libphutil.git" +EGIT_BRANCH="stable" +EGIT_COMMIT="d02cc05931b02c684d4c729510090591ca45f951" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="ssl test" + +DEPEND="virtual/awk:0 + test? ( + sys-devel/bison:0 + >=sys-devel/flex-2.5.35:0 + =www-client/arcanist-20170519:0 + dev-lang/php[cli] + )" +RDEPEND="|| ( + dev-lang/php:5.6[curl,iconv,json,mysql,mysqli,pcntl,ssl?,unicode] + dev-lang/php:7.1[curl,iconv,json,mysql,mysqli,pcntl,ssl?,unicode] + ) + !!dev-lang/php:7.0" + +src_prepare() { + default + + git log --format='%H %ct' -n 1 > "${S}/GIT_COMMIT_INFO" + git remote add origin "${EGIT_REPO_URI}" + git remote -v > "${S}/GIT_REMOTE_INFO" + + epatch "${FILESDIR}/${PV}-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch" + + if use test ; then + tc-export AR CXX + fi + + find "${S}" -type f -name .gitignore -print0 \ + | xargs -0 --no-run-if-empty -- \ + rm + + rm -r resources/ssl + rm -r scripts/daemon/torture + rm scripts/build_xhpast.php + rm src/parser/xhpast/bin/xhpast.exe + + # Replace 'env' shebang to files it point to + find "${S}" -type f \ + | sort \ + | xargs -n 1 --no-run-if-empty -- \ + awk 'NR == 1 && /^#!\/usr\/bin\/env/ {print FILENAME}' \ + | while read ; do + set -- $(sed -ne '1 s:^#!\([^ ]*\) ::p;q' ${REPLY}) + cmd="$1" ; shift ; args="$@" + + case "${cmd}" in + bash|php) ;; + *) continue ;; + esac + + path="$(type -p ${cmd})" || continue + [[ -z "${path}" ]] && continue + + einfo "Replace ${REPLY/#${S}\/} shebang to #!${path} ${args}" + sed -i \ + -e "1 s:^#!.*:#!${path} ${args}:" \ + "${REPLY}" + eend $? + done +} + +src_compile() { + if use test ; then + cd support/xhpast + + # Avoid sandbox violation for dev-lang/php[snmp] + # php -f generate_nodes.php' + # + # * ACCESS DENIED: open_wr: /var/lib/net-snmp/mib_indexes/0 + # abs_path: /var/lib/net-snmp/mib_indexes/0 + # res_path: /var/lib/net-snmp/mib_indexes/0 + # /usr/lib64/libsandbox.so(+0xd9d1)[0x7f226c8899d1] + # /usr/lib64/libsandbox.so(+0xdaf8)[0x7f226c889af8] + # /usr/lib64/libsandbox.so(+0x59cf)[0x7f226c8819cf] + # /usr/lib64/libsandbox.so(fopen+0x7c)[0x7f226c8843ec] + # /usr/lib64/libnetsnmp.so.30(netsnmp_mibindex_new+0x48)[0x7f22695f55e8] + # /usr/lib64/libnetsnmp.so.30(add_mibdir+0x9c)[0x7f226960a00c] + # /usr/lib64/libnetsnmp.so.30(netsnmp_init_mib+0xca)[0x7f22695f4bea] + # /usr/lib64/libnetsnmp.so.30(init_snmp+0x32d)[0x7f226961c2dd] + # php(zm_startup_snmp+0x51)[0x7f226cf81e11] + # php(zend_startup_module_ex+0x11a)[0x7f226d0bccea] + # /proc/15834/cmdline: php -f generate_nodes.php + # + # See snmp_config(5) + export SNMP_PERSISTENT_DIR="${T}" + + emake + emake install + fi +} + +src_test() { + arc unit --everything --no-coverage || die "arc unit failed" +} + +src_install() { + insinto "/usr/share/${PN}" + doins GIT_COMMIT_INFO GIT_REMOTE_INFO + + insinto "/usr/share/php/${PN}" + doins -r externals resources scripts src + + if use test ; then + fperms 755 "/usr/share/php/${PN}/src/parser/xhpast/bin/xhpast" + dosym "/usr/share/php/${PN}/src/parser/xhpast/bin/xhpast" /usr/bin/xhpast + fi + + # Make executable all shebanged files + find "${ED}" -type f \ + | xargs -n 1 --no-run-if-empty -- \ + awk 'NR == 1 && /^#!/ {print FILENAME}' \ + | sed -e "s:${ED}:/:" \ + | xargs --no-run-if-empty -- \ + fperms 755 + + dodoc NOTICE README.md +} -- cgit v1.2.3