1 |
zmedico 11/01/05 02:05:37 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: portage-2.2.0_alpha13.ebuild |
5 |
portage-2.1.9.29.ebuild |
6 |
Log: |
7 |
*portage-2.2.0_alpha13 (05 Jan 2011) |
8 |
|
9 |
05 Jan 2011; Zac Medico <zmedico@g.o> +portage-2.2.0_alpha13.ebuild: |
10 |
2.2.0_alpha13 version bump. This includes all of the fixes in |
11 |
portage-2.1.9.29. Bug #210077 tracks all bugs fixed since portage-2.1.x. |
12 |
|
13 |
*portage-2.1.9.29 (05 Jan 2011) |
14 |
|
15 |
05 Jan 2011; Zac Medico <zmedico@g.o> +portage-2.1.9.29.ebuild: |
16 |
2.1.9.29 version bump. This fixes bug #350254 (prevent missed updates |
17 |
due to REQUIRED_USE) and bug 350488 (regression in || dep handling for |
18 |
masked installed packages). Bug #349307 tracks all bugs fixed since |
19 |
2.1.9.25. |
20 |
|
21 |
(Portage version: 2.2.0_alpha13/cvs/Linux i686) |
22 |
|
23 |
Revision Changes Path |
24 |
1.787 sys-apps/portage/ChangeLog |
25 |
|
26 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.787&view=markup |
27 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.787&content-type=text/plain |
28 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?r1=1.786&r2=1.787 |
29 |
|
30 |
Index: ChangeLog |
31 |
=================================================================== |
32 |
RCS file: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v |
33 |
retrieving revision 1.786 |
34 |
retrieving revision 1.787 |
35 |
diff -u -r1.786 -r1.787 |
36 |
--- ChangeLog 3 Jan 2011 01:03:26 -0000 1.786 |
37 |
+++ ChangeLog 5 Jan 2011 02:05:37 -0000 1.787 |
38 |
@@ -1,6 +1,20 @@ |
39 |
# ChangeLog for sys-apps/portage |
40 |
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 |
41 |
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.786 2011/01/03 01:03:26 zmedico Exp $ |
42 |
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.787 2011/01/05 02:05:37 zmedico Exp $ |
43 |
+ |
44 |
+*portage-2.2.0_alpha13 (05 Jan 2011) |
45 |
+ |
46 |
+ 05 Jan 2011; Zac Medico <zmedico@g.o> +portage-2.2.0_alpha13.ebuild: |
47 |
+ 2.2.0_alpha13 version bump. This includes all of the fixes in |
48 |
+ portage-2.1.9.29. Bug #210077 tracks all bugs fixed since portage-2.1.x. |
49 |
+ |
50 |
+*portage-2.1.9.29 (05 Jan 2011) |
51 |
+ |
52 |
+ 05 Jan 2011; Zac Medico <zmedico@g.o> +portage-2.1.9.29.ebuild: |
53 |
+ 2.1.9.29 version bump. This fixes bug #350254 (prevent missed updates |
54 |
+ due to REQUIRED_USE) and bug 350488 (regression in || dep handling for |
55 |
+ masked installed packages). Bug #349307 tracks all bugs fixed since |
56 |
+ 2.1.9.25. |
57 |
|
58 |
*portage-2.2.0_alpha12 (03 Jan 2011) |
59 |
|
60 |
|
61 |
|
62 |
|
63 |
1.1 sys-apps/portage/portage-2.2.0_alpha13.ebuild |
64 |
|
65 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha13.ebuild?rev=1.1&view=markup |
66 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha13.ebuild?rev=1.1&content-type=text/plain |
67 |
|
68 |
Index: portage-2.2.0_alpha13.ebuild |
69 |
=================================================================== |
70 |
# Copyright 1999-2011 Gentoo Foundation |
71 |
# Distributed under the terms of the GNU General Public License v2 |
72 |
# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha13.ebuild,v 1.1 2011/01/05 02:05:37 zmedico Exp $ |
73 |
|
74 |
# Require EAPI 2 since we now require at least python-2.6 (for python 3 |
75 |
# syntax support) which also requires EAPI 2. |
76 |
EAPI=2 |
77 |
inherit eutils multilib python |
78 |
|
79 |
DESCRIPTION="Portage is the package management and distribution system for Gentoo" |
80 |
HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml" |
81 |
LICENSE="GPL-2" |
82 |
KEYWORDS="~sparc-fbsd ~x86-fbsd" |
83 |
PROVIDE="virtual/portage" |
84 |
SLOT="0" |
85 |
IUSE="build doc epydoc +ipc linguas_pl python3 selinux" |
86 |
|
87 |
python_dep="python3? ( =dev-lang/python-3* ) |
88 |
!python3? ( |
89 |
build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 ) ) |
90 |
!build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 >=dev-lang/python-3 ) ) |
91 |
)" |
92 |
|
93 |
# The pysqlite blocker is for bug #282760. |
94 |
DEPEND="${python_dep} |
95 |
!build? ( >=sys-apps/sed-4.0.5 ) |
96 |
doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 ) |
97 |
epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )" |
98 |
# Require sandbox-2.2 for bug #288863. |
99 |
RDEPEND="${python_dep} |
100 |
!build? ( >=sys-apps/sed-4.0.5 |
101 |
>=app-shells/bash-3.2_p17 |
102 |
>=app-admin/eselect-1.2 ) |
103 |
elibc_FreeBSD? ( sys-freebsd/freebsd-bin ) |
104 |
elibc_glibc? ( >=sys-apps/sandbox-2.2 ) |
105 |
elibc_uclibc? ( >=sys-apps/sandbox-2.2 ) |
106 |
>=app-misc/pax-utils-0.1.17 |
107 |
selinux? ( sys-libs/libselinux ) |
108 |
!<app-shells/bash-3.2_p17" |
109 |
PDEPEND=" |
110 |
!build? ( |
111 |
>=net-misc/rsync-2.6.4 |
112 |
userland_GNU? ( >=sys-apps/coreutils-6.4 ) |
113 |
)" |
114 |
# coreutils-6.4 rdep is for date format in emerge-webrsync #164532 |
115 |
# rsync-2.6.4 rdep is for the --filter option #167668 |
116 |
|
117 |
SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives" |
118 |
|
119 |
prefix_src_archives() { |
120 |
local x y |
121 |
for x in ${@}; do |
122 |
for y in ${SRC_ARCHIVES}; do |
123 |
echo ${y}/${x} |
124 |
done |
125 |
done |
126 |
} |
127 |
|
128 |
PV_PL="2.1.2" |
129 |
PATCHVER_PL="" |
130 |
TARBALL_PV=2.2.0_alpha11 |
131 |
SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2 |
132 |
$(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2) |
133 |
linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2 |
134 |
$(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )" |
135 |
|
136 |
PATCHVER= |
137 |
[[ $TARBALL_PV = $PV ]] || PATCHVER=$PV |
138 |
if [ -n "${PATCHVER}" ]; then |
139 |
SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2 |
140 |
$(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)" |
141 |
fi |
142 |
|
143 |
S="${WORKDIR}"/${PN}-${TARBALL_PV} |
144 |
S_PL="${WORKDIR}"/${PN}-${PV_PL} |
145 |
|
146 |
compatible_python_is_selected() { |
147 |
[[ $(/usr/bin/python -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]] |
148 |
} |
149 |
|
150 |
pkg_setup() { |
151 |
if ! use python3 && ! compatible_python_is_selected ; then |
152 |
ewarn "Attempting to select a compatible default python interpreter" |
153 |
local x success=0 |
154 |
for x in /usr/bin/python2.* ; do |
155 |
x=${x#/usr/bin/python2.} |
156 |
if [[ $x -ge 6 ]] 2>/dev/null ; then |
157 |
eselect python set python2.$x |
158 |
if compatible_python_is_selected ; then |
159 |
elog "Default python interpreter is now set to python-2.$x" |
160 |
success=1 |
161 |
break |
162 |
fi |
163 |
fi |
164 |
done |
165 |
if [ $success != 1 ] ; then |
166 |
eerror "Unable to select a compatible default python interpreter!" |
167 |
die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)." |
168 |
fi |
169 |
fi |
170 |
|
171 |
if use python3; then |
172 |
python_set_active_version 3 |
173 |
fi |
174 |
} |
175 |
|
176 |
src_prepare() { |
177 |
if [ -n "${PATCHVER}" ] ; then |
178 |
if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then |
179 |
rm "$S/bin/ebuild-helpers/portageq" \ |
180 |
|| die "failed to remove portageq helper symlink" |
181 |
fi |
182 |
epatch "${WORKDIR}/${PN}-${PATCHVER}.patch" |
183 |
fi |
184 |
einfo "Setting portage.VERSION to ${PVR} ..." |
185 |
sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \ |
186 |
die "Failed to patch portage.VERSION" |
187 |
sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \ |
188 |
die "Failed to patch VERSION in doc/fragment/version" |
189 |
sed -e "1s/VERSION/${PVR}/" -i man/* || \ |
190 |
die "Failed to patch VERSION in man page headers" |
191 |
|
192 |
if ! use ipc ; then |
193 |
einfo "Disabling ipc..." |
194 |
sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \ |
195 |
-i pym/_emerge/AbstractEbuildProcess.py || \ |
196 |
die "failed to patch AbstractEbuildProcess.py" |
197 |
fi |
198 |
|
199 |
if use python3; then |
200 |
einfo "Converting shebangs for python3..." |
201 |
python_convert_shebangs -r 3 . |
202 |
fi |
203 |
} |
204 |
|
205 |
src_compile() { |
206 |
if use doc; then |
207 |
cd "${S}"/doc |
208 |
touch fragment/date |
209 |
make xhtml xhtml-nochunks || die "failed to make docs" |
210 |
fi |
211 |
|
212 |
if use epydoc; then |
213 |
einfo "Generating api docs" |
214 |
mkdir "${WORKDIR}"/api |
215 |
local my_modules epydoc_opts="" |
216 |
my_modules="$(find "${S}/pym" -name "*.py" \ |
217 |
| sed -e 's:/__init__.py$::' -e 's:\.py$::' -e "s:^${S}/pym/::" \ |
218 |
-e 's:/:.:g' | sort)" || die "error listing modules" |
219 |
# workaround for bug 282760 |
220 |
> "$S/pym/pysqlite2.py" |
221 |
PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \ |
222 |
epydoc -o "${WORKDIR}"/api \ |
223 |
-qqqqq --no-frames --show-imports $epydoc_opts \ |
224 |
--name "${PN}" --url "${HOMEPAGE}" \ |
225 |
${my_modules} || die "epydoc failed" |
226 |
rm "$S/pym/pysqlite2.py" |
227 |
fi |
228 |
} |
229 |
|
230 |
src_test() { |
231 |
# make files executable, in case they were created by patch |
232 |
find bin -type f | xargs chmod +x |
233 |
PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \ |
234 |
./pym/portage/tests/runTests || die "test(s) failed" |
235 |
} |
236 |
|
237 |
src_install() { |
238 |
local libdir=$(get_libdir) |
239 |
local portage_base="/usr/${libdir}/portage" |
240 |
local portage_share_config=/usr/share/portage/config |
241 |
|
242 |
cd "${S}"/cnf |
243 |
insinto /etc |
244 |
doins etc-update.conf dispatch-conf.conf || die |
245 |
|
246 |
insinto "$portage_share_config/sets" |
247 |
doins "$S"/cnf/sets/*.conf || die |
248 |
insinto "$portage_share_config" |
249 |
doins "$S/cnf/make.globals" || die |
250 |
if [ -f "make.conf.${ARCH}".diff ]; then |
251 |
patch make.conf "make.conf.${ARCH}".diff || \ |
252 |
die "Failed to patch make.conf.example" |
253 |
newins make.conf make.conf.example || die |
254 |
else |
255 |
eerror "" |
256 |
eerror "Portage does not have an arch-specific configuration for this arch." |
257 |
eerror "Please notify the arch maintainer about this issue. Using generic." |
258 |
eerror "" |
259 |
newins make.conf make.conf.example || die |
260 |
fi |
261 |
|
262 |
dosym ..${portage_share_config}/make.globals /etc/make.globals |
263 |
|
264 |
insinto /etc/logrotate.d |
265 |
doins "${S}"/cnf/logrotate.d/elog-save-summary || die |
266 |
|
267 |
# BSD and OSX need a sed wrapper so that find/xargs work properly |
268 |
if use userland_GNU; then |
269 |
rm "${S}"/bin/ebuild-helpers/sed || die "Failed to remove sed wrapper" |
270 |
fi |
271 |
|
272 |
local x symlinks |
273 |
|
274 |
cd "$S" || die "cd failed" |
275 |
for x in $(find bin -type d) ; do |
276 |
exeinto $portage_base/$x || die "exeinto failed" |
277 |
cd "$S"/$x || die "cd failed" |
278 |
doexe $(find . -mindepth 1 -maxdepth 1 -type f ! -type l) || \ |
279 |
die "doexe failed" |
280 |
symlinks=$(find . -mindepth 1 -maxdepth 1 -type l) |
281 |
if [ -n "$symlinks" ] ; then |
282 |
cp -P $symlinks "$D$portage_base/$x" || die "cp failed" |
283 |
fi |
284 |
done |
285 |
|
286 |
cd "$S" || die "cd failed" |
287 |
for x in $(find pym/* -type d) ; do |
288 |
insinto $portage_base/$x || die "insinto failed" |
289 |
cd "$S"/$x || die "cd failed" |
290 |
# __pycache__ directories contain no py files |
291 |
[[ "*.py" != $(echo *.py) ]] || continue |
292 |
doins *.py || die "doins failed" |
293 |
symlinks=$(find . -mindepth 1 -maxdepth 1 -type l) |
294 |
if [ -n "$symlinks" ] ; then |
295 |
cp -P $symlinks "$D$portage_base/$x" || die "cp failed" |
296 |
fi |
297 |
done |
298 |
|
299 |
# Symlinks to directories cause up/downgrade issues and the use of these |
300 |
# modules outside of portage is probably negligible. |
301 |
for x in "${D}${portage_base}/pym/"{cache,elog_modules} ; do |
302 |
[ ! -L "${x}" ] && continue |
303 |
die "symlink to directory will cause upgrade/downgrade issues: '${x}'" |
304 |
done |
305 |
|
306 |
exeinto ${portage_base}/pym/portage/tests |
307 |
doexe "${S}"/pym/portage/tests/runTests |
308 |
|
309 |
doman "${S}"/man/*.[0-9] |
310 |
if use linguas_pl; then |
311 |
doman -i18n=pl "${S_PL}"/man/pl/*.[0-9] |
312 |
doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9] |
313 |
fi |
314 |
|
315 |
dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} |
316 |
use doc && dohtml -r "${S}"/doc/* |
317 |
use epydoc && dohtml -r "${WORKDIR}"/api |
318 |
|
319 |
dodir /usr/bin |
320 |
for x in ebuild egencache emerge portageq quickpkg repoman ; do |
321 |
dosym ../${libdir}/portage/bin/${x} /usr/bin/${x} |
322 |
done |
323 |
|
324 |
dodir /usr/sbin |
325 |
local my_syms="archive-conf |
326 |
dispatch-conf |
327 |
emaint |
328 |
emerge-webrsync |
329 |
env-update |
330 |
etc-update |
331 |
fixpackages |
332 |
regenworld" |
333 |
local x |
334 |
for x in ${my_syms}; do |
335 |
dosym ../${libdir}/portage/bin/${x} /usr/sbin/${x} |
336 |
done |
337 |
dosym env-update /usr/sbin/update-env |
338 |
dosym etc-update /usr/sbin/update-etc |
339 |
|
340 |
dodir /etc/portage |
341 |
keepdir /etc/portage |
342 |
} |
343 |
|
344 |
pkg_preinst() { |
345 |
if ! use build && ! has_version dev-python/pycrypto && \ |
346 |
! has_version '>=dev-lang/python-2.6[ssl]' ; then |
347 |
ewarn "If you are an ebuild developer and you plan to commit ebuilds" |
348 |
ewarn "with this system then please install dev-python/pycrypto or" |
349 |
ewarn "enable the ssl USE flag for >=dev-lang/python-2.6 in order" |
350 |
ewarn "to enable RMD160 hash support." |
351 |
ewarn "See bug #198398 for more information." |
352 |
fi |
353 |
if [ -f "${ROOT}/etc/make.globals" ]; then |
354 |
rm "${ROOT}/etc/make.globals" |
355 |
fi |
356 |
|
357 |
has_version "<${CATEGORY}/${PN}-2.2_alpha" |
358 |
MINOR_UPGRADE=$? |
359 |
|
360 |
has_version "<=${CATEGORY}/${PN}-2.2_pre5" |
361 |
WORLD_MIGRATION_UPGRADE=$? |
362 |
|
363 |
# If portage-2.1.6 is installed and the preserved_libs_registry exists, |
364 |
# assume that the NEEDED.ELF.2 files have already been generated. |
365 |
has_version "<=${CATEGORY}/${PN}-2.2_pre7" && \ |
366 |
! ( [ -e "$ROOT"var/lib/portage/preserved_libs_registry ] && \ |
367 |
has_version ">=${CATEGORY}/${PN}-2.1.6_rc" ) |
368 |
NEEDED_REBUILD_UPGRADE=$? |
369 |
|
370 |
[[ -n $PORTDIR_OVERLAY ]] && has_version "<${CATEGORY}/${PN}-2.1.6.12" |
371 |
REPO_LAYOUT_CONF_WARN=$? |
372 |
} |
373 |
|
374 |
pkg_postinst() { |
375 |
# Compile all source files recursively. Any orphans |
376 |
# will be identified and removed in postrm. |
377 |
python_mod_optimize /usr/$(get_libdir)/portage/pym |
378 |
|
379 |
if [ $WORLD_MIGRATION_UPGRADE = 0 ] ; then |
380 |
einfo "moving set references from the worldfile into world_sets" |
381 |
cd "${ROOT}/var/lib/portage/" |
382 |
grep "^@" world >> world_sets |
383 |
sed -i -e '/^@/d' world |
384 |
fi |
385 |
|
386 |
if [ $NEEDED_REBUILD_UPGRADE = 0 ] ; then |
387 |
einfo "rebuilding NEEDED.ELF.2 files" |
388 |
for cpv in "${ROOT}/var/db/pkg"/*/*; do |
389 |
if [ -f "${cpv}/NEEDED" ]; then |
390 |
rm -f "${cpv}/NEEDED.ELF.2" |
391 |
while read line; do |
392 |
filename=${line% *} |
393 |
needed=${line#* } |
394 |
needed=${needed//+/++} |
395 |
needed=${needed//#/##} |
396 |
needed=${needed//%/%%} |
397 |
newline=$(scanelf -BF "%a;%F;%S;%r;${needed}" $filename) |
398 |
newline=${newline// - } |
399 |
echo "${newline:3}" >> "${cpv}/NEEDED.ELF.2" |
400 |
done < "${cpv}/NEEDED" |
401 |
fi |
402 |
done |
403 |
fi |
404 |
|
405 |
if [ $REPO_LAYOUT_CONF_WARN = 0 ] ; then |
406 |
ewarn |
407 |
echo "If you want overlay eclasses to override eclasses from" \ |
408 |
"other repos then see the portage(5) man page" \ |
409 |
"for information about the new layout.conf and repos.conf" \ |
410 |
"configuration files." \ |
411 |
| fmt -w 75 | while read -r ; do ewarn "$REPLY" ; done |
412 |
ewarn |
413 |
fi |
414 |
|
415 |
einfo |
416 |
einfo "For help with using portage please consult the Gentoo Handbook" |
417 |
einfo "at http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3" |
418 |
einfo |
419 |
|
420 |
if [ $MINOR_UPGRADE = 0 ] ; then |
421 |
elog "If you're upgrading from a pre-2.2 version of portage you might" |
422 |
elog "want to remerge world (emerge -e world) to take full advantage" |
423 |
elog "of some of the new features in 2.2." |
424 |
elog "This is not required however for portage to function properly." |
425 |
elog |
426 |
fi |
427 |
|
428 |
if [ -z "${PV/*_alpha*}" ]; then |
429 |
elog "If you always want to use the latest development version of portage" |
430 |
elog "please read http://www.gentoo.org/proj/en/portage/doc/testing.xml" |
431 |
elog |
432 |
fi |
433 |
} |
434 |
|
435 |
pkg_postrm() { |
436 |
python_mod_cleanup /usr/$(get_libdir)/portage/pym |
437 |
} |
438 |
|
439 |
|
440 |
|
441 |
1.1 sys-apps/portage/portage-2.1.9.29.ebuild |
442 |
|
443 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.1.9.29.ebuild?rev=1.1&view=markup |
444 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.1.9.29.ebuild?rev=1.1&content-type=text/plain |
445 |
|
446 |
Index: portage-2.1.9.29.ebuild |
447 |
=================================================================== |
448 |
# Copyright 1999-2011 Gentoo Foundation |
449 |
# Distributed under the terms of the GNU General Public License v2 |
450 |
# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.1.9.29.ebuild,v 1.1 2011/01/05 02:05:37 zmedico Exp $ |
451 |
|
452 |
# Require EAPI 2 since we now require at least python-2.6 (for python 3 |
453 |
# syntax support) which also requires EAPI 2. |
454 |
EAPI=2 |
455 |
inherit eutils multilib python |
456 |
|
457 |
DESCRIPTION="Portage is the package management and distribution system for Gentoo" |
458 |
HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml" |
459 |
LICENSE="GPL-2" |
460 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" |
461 |
PROVIDE="virtual/portage" |
462 |
SLOT="0" |
463 |
IUSE="build doc epydoc +ipc linguas_pl python3 selinux" |
464 |
|
465 |
python_dep="python3? ( =dev-lang/python-3* ) |
466 |
!python3? ( |
467 |
build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 ) ) |
468 |
!build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 >=dev-lang/python-3 ) ) |
469 |
)" |
470 |
|
471 |
# The pysqlite blocker is for bug #282760. |
472 |
DEPEND="${python_dep} |
473 |
!build? ( >=sys-apps/sed-4.0.5 ) |
474 |
doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 ) |
475 |
epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )" |
476 |
|
477 |
RDEPEND="${python_dep} |
478 |
!build? ( >=sys-apps/sed-4.0.5 |
479 |
>=app-shells/bash-3.2_p17 |
480 |
>=app-admin/eselect-1.2 ) |
481 |
elibc_FreeBSD? ( sys-freebsd/freebsd-bin ) |
482 |
elibc_glibc? ( >=sys-apps/sandbox-1.6 ) |
483 |
elibc_uclibc? ( >=sys-apps/sandbox-1.6 ) |
484 |
>=app-misc/pax-utils-0.1.17 |
485 |
selinux? ( sys-libs/libselinux ) |
486 |
!<app-shells/bash-3.2_p17" |
487 |
PDEPEND=" |
488 |
!build? ( |
489 |
>=net-misc/rsync-2.6.4 |
490 |
userland_GNU? ( >=sys-apps/coreutils-6.4 ) |
491 |
)" |
492 |
# coreutils-6.4 rdep is for date format in emerge-webrsync #164532 |
493 |
# rsync-2.6.4 rdep is for the --filter option #167668 |
494 |
|
495 |
SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives" |
496 |
|
497 |
prefix_src_archives() { |
498 |
local x y |
499 |
for x in ${@}; do |
500 |
for y in ${SRC_ARCHIVES}; do |
501 |
echo ${y}/${x} |
502 |
done |
503 |
done |
504 |
} |
505 |
|
506 |
PV_PL="2.1.2" |
507 |
PATCHVER_PL="" |
508 |
TARBALL_PV=$PV |
509 |
SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2 |
510 |
$(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2) |
511 |
linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2 |
512 |
$(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )" |
513 |
|
514 |
PATCHVER= |
515 |
[[ $TARBALL_PV = $PV ]] || PATCHVER=$PV |
516 |
if [ -n "${PATCHVER}" ]; then |
517 |
SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2 |
518 |
$(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)" |
519 |
fi |
520 |
|
521 |
S="${WORKDIR}"/${PN}-${TARBALL_PV} |
522 |
S_PL="${WORKDIR}"/${PN}-${PV_PL} |
523 |
|
524 |
compatible_python_is_selected() { |
525 |
[[ $(/usr/bin/python -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]] |
526 |
} |
527 |
|
528 |
pkg_setup() { |
529 |
if ! use python3 && ! compatible_python_is_selected ; then |
530 |
ewarn "Attempting to select a compatible default python interpreter" |
531 |
local x success=0 |
532 |
for x in /usr/bin/python2.* ; do |
533 |
x=${x#/usr/bin/python2.} |
534 |
if [[ $x -ge 6 ]] 2>/dev/null ; then |
535 |
eselect python set python2.$x |
536 |
if compatible_python_is_selected ; then |
537 |
elog "Default python interpreter is now set to python-2.$x" |
538 |
success=1 |
539 |
break |
540 |
fi |
541 |
fi |
542 |
done |
543 |
if [ $success != 1 ] ; then |
544 |
eerror "Unable to select a compatible default python interpreter!" |
545 |
die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)." |
546 |
fi |
547 |
fi |
548 |
|
549 |
if use python3; then |
550 |
python_set_active_version 3 |
551 |
fi |
552 |
} |
553 |
|
554 |
src_prepare() { |
555 |
if [ -n "${PATCHVER}" ] ; then |
556 |
if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then |
557 |
rm "$S/bin/ebuild-helpers/portageq" \ |
558 |
|| die "failed to remove portageq helper symlink" |
559 |
fi |
560 |
epatch "${WORKDIR}/${PN}-${PATCHVER}.patch" |
561 |
fi |
562 |
einfo "Setting portage.VERSION to ${PVR} ..." |
563 |
sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \ |
564 |
die "Failed to patch portage.VERSION" |
565 |
sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \ |
566 |
die "Failed to patch VERSION in doc/fragment/version" |
567 |
sed -e "1s/VERSION/${PVR}/" -i man/* || \ |
568 |
die "Failed to patch VERSION in man page headers" |
569 |
|
570 |
if ! use ipc ; then |
571 |
einfo "Disabling ipc..." |
572 |
sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \ |
573 |
-i pym/_emerge/AbstractEbuildProcess.py || \ |
574 |
die "failed to patch AbstractEbuildProcess.py" |
575 |
fi |
576 |
|
577 |
if use python3; then |
578 |
einfo "Converting shebangs for python3..." |
579 |
python_convert_shebangs -r 3 . |
580 |
fi |
581 |
} |
582 |
|
583 |
src_compile() { |
584 |
if use doc; then |
585 |
cd "${S}"/doc |
586 |
touch fragment/date |
587 |
make xhtml xhtml-nochunks || die "failed to make docs" |
588 |
fi |
589 |
|
590 |
if use epydoc; then |
591 |
einfo "Generating api docs" |
592 |
mkdir "${WORKDIR}"/api |
593 |
local my_modules epydoc_opts="" |
594 |
my_modules="$(find "${S}/pym" -name "*.py" \ |
595 |
| sed -e 's:/__init__.py$::' -e 's:\.py$::' -e "s:^${S}/pym/::" \ |
596 |
-e 's:/:.:g' | sort)" || die "error listing modules" |
597 |
# workaround for bug 282760 |
598 |
> "$S/pym/pysqlite2.py" |
599 |
PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \ |
600 |
epydoc -o "${WORKDIR}"/api \ |
601 |
-qqqqq --no-frames --show-imports $epydoc_opts \ |
602 |
--name "${PN}" --url "${HOMEPAGE}" \ |
603 |
${my_modules} || die "epydoc failed" |
604 |
rm "$S/pym/pysqlite2.py" |
605 |
fi |
606 |
} |
607 |
|
608 |
src_test() { |
609 |
# make files executable, in case they were created by patch |
610 |
find bin -type f | xargs chmod +x |
611 |
PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \ |
612 |
./pym/portage/tests/runTests || die "test(s) failed" |
613 |
} |
614 |
|
615 |
src_install() { |
616 |
local libdir=$(get_libdir) |
617 |
local portage_base="/usr/${libdir}/portage" |
618 |
local portage_share_config=/usr/share/portage/config |
619 |
|
620 |
cd "${S}"/cnf |
621 |
insinto /etc |
622 |
doins etc-update.conf dispatch-conf.conf || die |
623 |
|
624 |
insinto "$portage_share_config" |
625 |
doins "$S/cnf/make.globals" || die |
626 |
if [ -f "make.conf.${ARCH}".diff ]; then |
627 |
patch make.conf "make.conf.${ARCH}".diff || \ |
628 |
die "Failed to patch make.conf.example" |
629 |
newins make.conf make.conf.example || die |
630 |
else |
631 |
eerror "" |
632 |
eerror "Portage does not have an arch-specific configuration for this arch." |
633 |
eerror "Please notify the arch maintainer about this issue. Using generic." |
634 |
eerror "" |
635 |
newins make.conf make.conf.example || die |
636 |
fi |
637 |
|
638 |
dosym ..${portage_share_config}/make.globals /etc/make.globals |
639 |
|
640 |
insinto /etc/logrotate.d |
641 |
doins "${S}"/cnf/logrotate.d/elog-save-summary || die |
642 |
|
643 |
# BSD and OSX need a sed wrapper so that find/xargs work properly |
644 |
if use userland_GNU; then |
645 |
rm "${S}"/bin/ebuild-helpers/sed || die "Failed to remove sed wrapper" |
646 |
fi |
647 |
|
648 |
local x symlinks |
649 |
|
650 |
cd "$S" || die "cd failed" |
651 |
for x in $(find bin -type d) ; do |
652 |
exeinto $portage_base/$x || die "exeinto failed" |
653 |
cd "$S"/$x || die "cd failed" |
654 |
doexe $(find . -mindepth 1 -maxdepth 1 -type f ! -type l) || \ |
655 |
die "doexe failed" |
656 |
symlinks=$(find . -mindepth 1 -maxdepth 1 -type l) |
657 |
if [ -n "$symlinks" ] ; then |
658 |
cp -P $symlinks "$D$portage_base/$x" || die "cp failed" |
659 |
fi |
660 |
done |
661 |
|
662 |
cd "$S" || die "cd failed" |
663 |
for x in $(find pym/* -type d) ; do |
664 |
insinto $portage_base/$x || die "insinto failed" |
665 |
cd "$S"/$x || die "cd failed" |
666 |
# __pycache__ directories contain no py files |
667 |
[[ "*.py" != $(echo *.py) ]] || continue |
668 |
doins *.py || die "doins failed" |
669 |
symlinks=$(find . -mindepth 1 -maxdepth 1 -type l) |
670 |
if [ -n "$symlinks" ] ; then |
671 |
cp -P $symlinks "$D$portage_base/$x" || die "cp failed" |
672 |
fi |
673 |
done |
674 |
|
675 |
# Symlinks to directories cause up/downgrade issues and the use of these |
676 |
# modules outside of portage is probably negligible. |
677 |
for x in "${D}${portage_base}/pym/"{cache,elog_modules} ; do |
678 |
[ ! -L "${x}" ] && continue |
679 |
die "symlink to directory will cause upgrade/downgrade issues: '${x}'" |
680 |
done |
681 |
|
682 |
exeinto ${portage_base}/pym/portage/tests |
683 |
doexe "${S}"/pym/portage/tests/runTests |
684 |
|
685 |
doman "${S}"/man/*.[0-9] |
686 |
if use linguas_pl; then |
687 |
doman -i18n=pl "${S_PL}"/man/pl/*.[0-9] |
688 |
doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9] |
689 |
fi |
690 |
|
691 |
dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} |
692 |
use doc && dohtml -r "${S}"/doc/* |
693 |
use epydoc && dohtml -r "${WORKDIR}"/api |
694 |
|
695 |
dodir /usr/bin |
696 |
for x in ebuild egencache emerge portageq quickpkg repoman ; do |
697 |
dosym ../${libdir}/portage/bin/${x} /usr/bin/${x} |
698 |
done |
699 |
|
700 |
dodir /usr/sbin |
701 |
local my_syms="archive-conf |
702 |
dispatch-conf |
703 |
emaint |
704 |
emerge-webrsync |
705 |
env-update |
706 |
etc-update |
707 |
fixpackages |
708 |
regenworld" |
709 |
local x |
710 |
for x in ${my_syms}; do |
711 |
dosym ../${libdir}/portage/bin/${x} /usr/sbin/${x} |
712 |
done |
713 |
dosym env-update /usr/sbin/update-env |
714 |
dosym etc-update /usr/sbin/update-etc |
715 |
|
716 |
dodir /etc/portage |
717 |
keepdir /etc/portage |
718 |
} |
719 |
|
720 |
pkg_preinst() { |
721 |
if ! use build && ! has_version dev-python/pycrypto && \ |
722 |
! has_version '>=dev-lang/python-2.6[ssl]' ; then |
723 |
ewarn "If you are an ebuild developer and you plan to commit ebuilds" |
724 |
ewarn "with this system then please install dev-python/pycrypto or" |
725 |
ewarn "enable the ssl USE flag for >=dev-lang/python-2.6 in order" |
726 |
ewarn "to enable RMD160 hash support." |
727 |
ewarn "See bug #198398 for more information." |
728 |
fi |
729 |
if [ -f "${ROOT}/etc/make.globals" ]; then |
730 |
rm "${ROOT}/etc/make.globals" |
731 |
fi |
732 |
|
733 |
[[ -n $PORTDIR_OVERLAY ]] && has_version "<${CATEGORY}/${PN}-2.1.6.12" |
734 |
REPO_LAYOUT_CONF_WARN=$? |
735 |
} |
736 |
|
737 |
pkg_postinst() { |
738 |
# Compile all source files recursively. Any orphans |
739 |
# will be identified and removed in postrm. |
740 |
python_mod_optimize /usr/$(get_libdir)/portage/pym |
741 |
|
742 |
if [ $REPO_LAYOUT_CONF_WARN = 0 ] ; then |
743 |
ewarn |
744 |
echo "If you want overlay eclasses to override eclasses from" \ |
745 |
"other repos then see the portage(5) man page" \ |
746 |
"for information about the new layout.conf and repos.conf" \ |
747 |
"configuration files." \ |
748 |
| fmt -w 75 | while read -r ; do ewarn "$REPLY" ; done |
749 |
ewarn |
750 |
fi |
751 |
|
752 |
einfo |
753 |
einfo "For help with using portage please consult the Gentoo Handbook" |
754 |
einfo "at http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3" |
755 |
einfo |
756 |
} |
757 |
|
758 |
pkg_postrm() { |
759 |
python_mod_cleanup /usr/$(get_libdir)/portage/pym |
760 |
} |