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