From e1cfce87f489df1be5af0d32937e60f646893270 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Sat, 30 Sep 2017 16:56:21 +0100 Subject: dev-php/libphutil: Version bump Package-Manager: Portage-2.3.8, 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-20170811.ebuild | 134 --------------------- dev-php/libphutil/libphutil-20170929.ebuild | 134 +++++++++++++++++++++ 5 files changed, 180 insertions(+), 180 deletions(-) delete mode 100644 dev-php/libphutil/files/20170811-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch create mode 100644 dev-php/libphutil/files/20170929-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch delete mode 100644 dev-php/libphutil/libphutil-20170811.ebuild create mode 100644 dev-php/libphutil/libphutil-20170929.ebuild (limited to 'dev-php') diff --git a/dev-php/libphutil/files/20170811-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch b/dev-php/libphutil/files/20170811-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch deleted file mode 100644 index 34fd3a41..00000000 --- a/dev-php/libphutil/files/20170811-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 13f6c98557be1907e42a4e01fd94c4d931497069 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/20170929-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch b/dev-php/libphutil/files/20170929-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch new file mode 100644 index 00000000..ee992395 --- /dev/null +++ b/dev-php/libphutil/files/20170929-Remove-the-usage-of-local-SSL-certificates-and-use-s.patch @@ -0,0 +1,45 @@ +From 2a57159a1930c9ea7742c4dcd066f957a95c46bb 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 264bca1c..e7440bf3 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 bb55a1e4a402dc1fe2607e876ef8a57c4f266ea0 Mon Sep 17 00:00:00 2001 +From c4f5dc8d843a32550f0e6e9ceb2a08bb68f7e888 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-20170811.ebuild b/dev-php/libphutil/libphutil-20170811.ebuild deleted file mode 100644 index 689c58b5..00000000 --- a/dev-php/libphutil/libphutil-20170811.ebuild +++ /dev/null @@ -1,134 +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="https://github.com/phacility/libphutil.git" -EGIT_BRANCH="stable" -EGIT_COMMIT="ee5ebf668ad4fd4c0bae3fbbe6616a5826020aa9" - -LICENSE="Apache-2.0" -SLOT="stable" -KEYWORDS="~amd64 ~x86" -IUSE="ssl test" - -DEPEND="!${CATEGORY}/${PN}:0 - virtual/awk:0 - test? ( - sys-devel/bison:0 - >=sys-devel/flex-2.5.35:0 - =www-client/arcanist-20170805:stable - 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" - - eapply "${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-20170929.ebuild b/dev-php/libphutil/libphutil-20170929.ebuild new file mode 100644 index 00000000..0629a72d --- /dev/null +++ b/dev-php/libphutil/libphutil-20170929.ebuild @@ -0,0 +1,134 @@ +# 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="https://github.com/phacility/libphutil.git" +EGIT_BRANCH="stable" +EGIT_COMMIT="0ce8ef68ca88534af5e5843fcbf07e381d06476b" + +LICENSE="Apache-2.0" +SLOT="stable" +KEYWORDS="~amd64 ~x86" +IUSE="ssl test" + +DEPEND="!${CATEGORY}/${PN}:0 + virtual/awk:0 + test? ( + sys-devel/bison:0 + >=sys-devel/flex-2.5.35:0 + =www-client/arcanist-20170922:stable + 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" + + eapply "${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