Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-php/PEAR-PEAR/
Date: Tue, 27 Jun 2017 13:13:29
Message-Id: 1498569186.dd82227d44c6ab625dbd5aca6fc872f5c2382faa.grknight@gentoo
1 commit: dd82227d44c6ab625dbd5aca6fc872f5c2382faa
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 27 13:13:06 2017 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 27 13:13:06 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd82227d
7
8 dev-php/PEAR-PEAR: Version bump to 1.10.5
9
10 Adds compatibility for PHP 7.2
11
12 Package-Manager: Portage-2.3.6, Repoman-2.3.2
13
14 dev-php/PEAR-PEAR/Manifest | 1 +
15 dev-php/PEAR-PEAR/PEAR-PEAR-1.10.5.ebuild | 177 ++++++++++++++++++++++++++++++
16 2 files changed, 178 insertions(+)
17
18 diff --git a/dev-php/PEAR-PEAR/Manifest b/dev-php/PEAR-PEAR/Manifest
19 index 99ffb461a13..dc9fd43a2d7 100644
20 --- a/dev-php/PEAR-PEAR/Manifest
21 +++ b/dev-php/PEAR-PEAR/Manifest
22 @@ -1,2 +1,3 @@
23 DIST PEAR-1.10.1.tgz 291167 SHA256 7eca0d8e4f6391d66d92abc4faebd5a9346e739b92573e20392db9e878a8d59f SHA512 df5f09a92d211a09dae147af474399171aed46e0536c091468b73b43ba4acdbdbf7b5cbdd17ef48b7d36d7b9dd23187dc6c75733731c267768d49c89698b0ef2 WHIRLPOOL ef067937d805a1e5c082c5945ffcbffd005757326f72572563154f2b5c573713050cc002af7727ebe053b3956fa1113c29bbbad6e74d8fb110704b07b7291929
24 DIST PEAR-1.10.3.tgz 291095 SHA256 c882979c48640b0b1a71cf2290dad3b3bbef1c33e4f1ec9af36a710e88e7921a SHA512 1ad531a6e0ac30719b05e58f0758393bc6cdb0e89b4f99f843e7318a40ef18e74767e8ed63346b0ece9d6e8e71c8ebe15b08eaeb6f0c4f3169814bb4bb524332 WHIRLPOOL 987d875a76ccbf26ea3fce0ca1b11d0885bcd98c73c1bdd43ce41f5f0cec4504f769aaa2b1bca3e501763ab21c3d6980a2eb02d26bfdfbd6f9a28f938ebbd4ea
25 +DIST PEAR-1.10.5.tgz 291151 SHA256 74c28725fed39617a6c2f310d5e1185b05982e3478196c2fedc64b4e747c2465 SHA512 c310fa8ec72ba201313dc03953ec1eba82daa137b27eac880fd5388dce72d38e6aa40737da43c3ad41db4df0d6717c7d77cf477d64b29245854ae95d2a94c364 WHIRLPOOL 8d2bf23cb28c4242b9c452f141b42d445e2fce343ed091bc834ba058fb0358a1b22228585c0074bde445a0de8807af27b57d503962e57c45cd1f00e2f982ad7e
26
27 diff --git a/dev-php/PEAR-PEAR/PEAR-PEAR-1.10.5.ebuild b/dev-php/PEAR-PEAR/PEAR-PEAR-1.10.5.ebuild
28 new file mode 100644
29 index 00000000000..f7468c933a1
30 --- /dev/null
31 +++ b/dev-php/PEAR-PEAR/PEAR-PEAR-1.10.5.ebuild
32 @@ -0,0 +1,177 @@
33 +# Copyright 1999-2017 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +MY_PN="${PN/PEAR-/}"
39 +MY_P="${MY_PN}-${PV}"
40 +
41 +DESCRIPTION="PEAR Base System"
42 +HOMEPAGE="http://pear.php.net/package/${MY_PN}"
43 +SRC_URI="http://pear.php.net/get/${MY_P}.tgz"
44 +LICENSE="MIT"
45 +KEYWORDS="~amd64 ~arm ~hppa"
46 +SLOT="0"
47 +IUSE=""
48 +
49 +DEPEND=""
50 +RDEPEND="dev-lang/php:*[cli,xml,zlib]
51 + >=dev-php/PEAR-Archive_Tar-1.4.0
52 + >=dev-php/PEAR-Console_Getopt-1.4.1
53 + dev-php/PEAR-Exception
54 + >=dev-php/PEAR-Structures_Graph-1.1.0
55 + >=dev-php/PEAR-XML_Util-1.3.0"
56 +
57 +S="${WORKDIR}/${MY_P}"
58 +
59 +PATCHES=( "${FILESDIR}/gentoo-libtool-mismatch-fix-v2.patch" )
60 +
61 +pkg_setup() {
62 + [[ -z "${PEAR_CACHEDIR}" ]] && PEAR_CACHEDIR="${EPREFIX}/var/cache/pear"
63 + [[ -z "${PEAR_DOWNLOADDIR}" ]] && PEAR_DOWNLOADDIR="${EPREFIX}/var/tmp/pear"
64 + [[ -z "${PEAR_TEMPDIR}" ]] && PEAR_TEMPDIR="${EPREFIX}/tmp"
65 +
66 + elog
67 + elog "cache_dir is set to: ${PEAR_CACHEDIR}"
68 + elog "download_dir is set to: ${PEAR_DOWNLOADDIR}"
69 + elog "temp_dir is set to: ${PEAR_TEMPDIR}"
70 + elog
71 + elog "If you want to change the above values, you need to set"
72 + elog "PEAR_CACHEDIR, PEAR_DOWNLOADDIR and PEAR_TEMPDIR variable(s)"
73 + elog "accordingly in /etc/portage/make.conf and re-emerge ${PN}."
74 + elog
75 +}
76 +
77 +src_prepare() {
78 + default
79 + # Exception.php is part of dev-php/PEAR-Exception.
80 + rm PEAR/Exception.php || die "failed to remove PEAR/Exception.php"
81 +}
82 +
83 +src_install() {
84 + insinto /usr/share/php
85 + doins -r PEAR/
86 + doins -r OS/
87 + doins PEAR.php System.php
88 + doins scripts/pearcmd.php
89 + doins scripts/peclcmd.php
90 +
91 + newbin scripts/pear.sh pear
92 + newbin scripts/peardev.sh peardev
93 + newbin scripts/pecl.sh pecl
94 +
95 + # adjust some scripts for current version
96 + [[ -z "${PEAR}" ]] && PEAR="${PV}"
97 + for i in pearcmd.php peclcmd.php ; do
98 + sed "s:@pear_version@:${PEAR}:g" -i "${D}/usr/share/php/${i}" \
99 + || die "failed to sed pear_version"
100 + done
101 +
102 + for i in pear peardev pecl ; do
103 + sed "s:@bin_dir@:${EPREFIX}/usr/bin:g" -i "${D}/usr/bin/${i}" \
104 + || die "failed to sed @bin_dir@ in ${i}"
105 + sed "s:@php_dir@:${EPREFIX}/usr/share/php:g" -i "${D}/usr/bin/${i}" \
106 + || die "failed to sed @php_dir@ in ${i}"
107 + done
108 +
109 + sed "s:-d output_buffering=1:-d output_buffering=1 -d memory_limit=32M:g" \
110 + -i "${D}/usr/bin/pear" \
111 + || die "failed to set PHP ini values in pear executable"
112 +
113 + sed "s:@package_version@:${PEAR}:g" \
114 + -i "${D}/usr/share/php/PEAR/Command/Package.php" \
115 + || die "failed to sed @package_version@"
116 +
117 + sed "s:@PEAR-VER@:${PEAR}:g" \
118 + -i "${D}/usr/share/php/PEAR/Dependency2.php" \
119 + || die "failed to sed @PEAR-VER@ in Dependency2.php"
120 +
121 + sed "s:@PEAR-VER@:${PEAR}:g" \
122 + -i "${D}/usr/share/php/PEAR/PackageFile/Parser/v1.php" \
123 + || die "failed to sed @PEAR-VER@ in v1.php"
124 +
125 + sed "s:@PEAR-VER@:${PEAR}:g" \
126 + -i "${D}/usr/share/php/PEAR/PackageFile/Parser/v2.php" \
127 + || die "failed to sed @PEAR-VER@ in v2.php"
128 +
129 + # finalize install
130 + insinto /etc
131 + newins "${FILESDIR}"/pear.conf-r2 pear.conf
132 +
133 + sed "s|s:PHPCLILEN:\"PHPCLI\"|s:${#PHPCLI}:\"${PHPCLI}\"|g" \
134 + -i "${D}/etc/pear.conf" \
135 + || die "failed to sed PHPCLILEN in pear.conf"
136 +
137 + sed "s|s:CACHEDIRLEN:\"CACHEDIR\"|s:${#PEAR_CACHEDIR}:\"${PEAR_CACHEDIR}\"|g" \
138 + -i "${D}/etc/pear.conf" \
139 + || die "failed to sed CACHEDIRLEN in pear.conf"
140 +
141 + sed "s|s:DOWNLOADDIRLEN:\"DOWNLOADDIR\"|s:${#PEAR_DOWNLOADDIR}:\"${PEAR_DOWNLOADDIR}\"|g" \
142 + -i "${D}/etc/pear.conf" \
143 + || die "failed to sed DOWNLOADDIRLEN in pear.conf"
144 +
145 + sed "s|s:TEMPDIRLEN:\"TEMPDIR\"|s:${#PEAR_TEMPDIR}:\"${PEAR_TEMPDIR}\"|g" \
146 + -i "${D}/etc/pear.conf" \
147 + || die "failed to sed TEMPDIRLEN in pear.conf"
148 +
149 + # Change the paths for eprefix!
150 + sed "s|s:19:\"/usr/share/php/docs\"|s:$(( ${#EPREFIX}+19 )):\"${EPREFIX}/usr/share/php/docs\"|g" \
151 + -i "${D}/etc/pear.conf" \
152 + || die "failed to sed the docs path (prefix) in pear.conf"
153 +
154 + sed "s|s:19:\"/usr/share/php/data\"|s:$(( ${#EPREFIX}+19 )):\"${EPREFIX}/usr/share/php/data\"|g" \
155 + -i "${D}/etc/pear.conf" \
156 + || die "failed to sed the data path (prefix) in pear.conf"
157 +
158 + sed "s|s:20:\"/usr/share/php/tests\"|s:$(( ${#EPREFIX}+20 )):\"${EPREFIX}/usr/share/php/tests\"|g" \
159 + -i "${D}/etc/pear.conf" \
160 + || die "failed to sed the tests path (prefix) in pear.conf"
161 +
162 + sed "s|s:14:\"/usr/share/php\"|s:$(( ${#EPREFIX}+14 )):\"${EPREFIX}/usr/share/php\"|g" \
163 + -i "${D}/etc/pear.conf" \
164 + || die "failed to sed the PHP include path (prefix) in pear.conf"
165 +
166 + sed "s|s:8:\"/usr/bin\"|s:$(( ${#EPREFIX}+8 )):\"${EPREFIX}/usr/bin\"|g" \
167 + -i "${D}/etc/pear.conf" \
168 + || die "failed to sed the bin path (prefix) in pear.conf"
169 +
170 + [[ "${PEAR_TEMPDIR}" != "/tmp" ]] && keepdir "${PEAR_TEMPDIR#${EPREFIX}}"
171 + keepdir "${PEAR_CACHEDIR#${EPREFIX}}"
172 + diropts -m1777
173 + keepdir "${PEAR_DOWNLOADDIR#${EPREFIX}}"
174 +
175 + insinto /usr/share/php/.packagexml
176 + newins "${WORKDIR}/package.xml" "${MY_P}.xml"
177 +}
178 +
179 +pkg_config() {
180 + # Update PEAR/PECL channels as needed, add new ones to the list if needed
181 + elog "Updating PEAR/PECL channels"
182 + local pearchans="pear.php.net pecl.php.net pear.symfony-project.com"
183 +
184 + for chan in ${pearchans} ; do
185 + # The first command may fail if, for example, the channels have
186 + # already been initialized.
187 + pear channel-discover ${chan}
188 + pear channel-update ${chan} || die "failed to update channels: ${chan}"
189 + done
190 +}
191 +
192 +pkg_postinst() {
193 + pear clear-cache || die "failed to clear PEAR cache"
194 +
195 + elog "Run 'emerge --config =${PF}' to automatically update the PEAR/PECL channels while online."
196 +
197 + # Register the package from the package.xml file
198 + # It is not critical to complete so only warn on failure
199 + if [[ -f "${EROOT}usr/share/php/.packagexml/${MY_P}.xml" ]] ; then
200 + "${EROOT}usr/bin/peardev" install -nrO --force \
201 + "${EROOT}usr/share/php/.packagexml/${MY_P}.xml" 2> /dev/null \
202 + || ewarn "Failed to insert package into local PEAR database"
203 + fi
204 +}
205 +
206 +pkg_prerm() {
207 + # Uninstall known dependency
208 + "${EROOT}usr/bin/peardev" uninstall -nrO "pear.php.net/PEAR"
209 +}