/[gentoo-x86]/sys-apps/portage/portage-2.2.0_alpha74.ebuild
Gentoo

Contents of /sys-apps/portage/portage-2.2.0_alpha74.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri Nov 11 19:06:30 2011 UTC (3 years ago) by zmedico
Branch: MAIN
2.2.0_alpha74 version bump. This includes the --quiet-build change that's in
portage-2.1.10.34. Bug #210077 tracks all bugs fixed since portage-2.1.x.

(Portage version: 2.2.0_alpha74/cvs/Linux i686)

1 zmedico 1.1 # Copyright 1999-2011 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha73.ebuild,v 1.1 2011/11/10 06:07:09 zmedico Exp $
4    
5     # Require EAPI 2 since we now require at least python-2.6 (for python 3
6     # syntax support) which also requires EAPI 2.
7     EAPI=2
8     inherit eutils multilib python
9    
10     DESCRIPTION="Portage is the package management and distribution system for Gentoo"
11     HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml"
12     LICENSE="GPL-2"
13     KEYWORDS="~sparc-fbsd ~x86-fbsd"
14     SLOT="0"
15     IUSE="build doc epydoc +ipc linguas_pl python2 python3 selinux"
16    
17     # Import of the io module in python-2.6 raises ImportError for the
18     # thread module if threading is disabled.
19     python_dep="python3? ( =dev-lang/python-3* )
20     !python2? ( !python3? (
21     build? ( || ( dev-lang/python:2.7 dev-lang/python:2.6[threads] ) )
22     !build? ( || ( dev-lang/python:2.7 dev-lang/python:2.6[threads] >=dev-lang/python-3 ) )
23     ) )
24     python2? ( !python3? ( || ( dev-lang/python:2.7 dev-lang/python:2.6[threads] ) ) )"
25    
26     # The pysqlite blocker is for bug #282760.
27     DEPEND="${python_dep}
28     !build? ( >=sys-apps/sed-4.0.5 )
29     doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
30     epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
31     # Require sandbox-2.2 for bug #288863.
32     RDEPEND="${python_dep}
33     !build? ( >=sys-apps/sed-4.0.5
34     >=app-shells/bash-3.2_p17
35     >=app-admin/eselect-1.2 )
36     elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
37     elibc_glibc? ( >=sys-apps/sandbox-2.2 )
38     elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
39     >=app-misc/pax-utils-0.1.17
40     selinux? ( || ( >=sys-libs/libselinux-2.0.94[python] <sys-libs/libselinux-2.0.94 ) )
41     !<app-shells/bash-3.2_p17
42     !<app-admin/logrotate-3.8.0"
43     PDEPEND="
44     !build? (
45     >=net-misc/rsync-2.6.4
46     userland_GNU? ( >=sys-apps/coreutils-6.4 )
47     )"
48     # coreutils-6.4 rdep is for date format in emerge-webrsync #164532
49     # NOTE: FEATURES=install-sources requires debugedit and rsync
50    
51     SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives"
52    
53     prefix_src_archives() {
54     local x y
55     for x in ${@}; do
56     for y in ${SRC_ARCHIVES}; do
57     echo ${y}/${x}
58     done
59     done
60     }
61    
62     PV_PL="2.1.2"
63     PATCHVER_PL=""
64     TARBALL_PV=2.2.0_alpha74
65     SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
66     $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)
67     linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2
68     $(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )"
69    
70     PATCHVER=
71     [[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
72     if [ -n "${PATCHVER}" ]; then
73     SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
74     $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
75     fi
76    
77     S="${WORKDIR}"/${PN}-${TARBALL_PV}
78     S_PL="${WORKDIR}"/${PN}-${PV_PL}
79    
80     compatible_python_is_selected() {
81     [[ $(/usr/bin/python -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
82     }
83    
84     pkg_setup() {
85     # Bug #359731 - Die early if get_libdir fails.
86     [[ -z $(get_libdir) ]] && \
87     die "get_libdir returned an empty string"
88    
89     if use python2 && use python3 ; then
90     ewarn "Both python2 and python3 USE flags are enabled, but only one"
91     ewarn "can be in the shebangs. Using python3."
92     fi
93     if ! use python2 && ! use python3 && ! compatible_python_is_selected ; then
94     ewarn "Attempting to select a compatible default python interpreter"
95     local x success=0
96     for x in /usr/bin/python2.* ; do
97     x=${x#/usr/bin/python2.}
98     if [[ $x -ge 6 ]] 2>/dev/null ; then
99     eselect python set python2.$x
100     if compatible_python_is_selected ; then
101     elog "Default python interpreter is now set to python-2.$x"
102     success=1
103     break
104     fi
105     fi
106     done
107     if [ $success != 1 ] ; then
108     eerror "Unable to select a compatible default python interpreter!"
109     die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
110     fi
111     fi
112    
113     if use python3; then
114     python_set_active_version 3
115     elif use python2; then
116     python_set_active_version 2
117     fi
118     }
119    
120     src_prepare() {
121     if [ -n "${PATCHVER}" ] ; then
122     if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
123     rm "$S/bin/ebuild-helpers/portageq" \
124     || die "failed to remove portageq helper symlink"
125     fi
126     epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
127     fi
128     einfo "Setting portage.VERSION to ${PVR} ..."
129     sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \
130     die "Failed to patch portage.VERSION"
131     sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \
132     die "Failed to patch VERSION in doc/fragment/version"
133     sed -e "1s/VERSION/${PVR}/" -i man/* || \
134     die "Failed to patch VERSION in man page headers"
135    
136     if ! use ipc ; then
137     einfo "Disabling ipc..."
138     sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
139     -i pym/_emerge/AbstractEbuildProcess.py || \
140     die "failed to patch AbstractEbuildProcess.py"
141     fi
142    
143     if use python3; then
144     einfo "Converting shebangs for python3..."
145     python_convert_shebangs -r 3 .
146     elif use python2; then
147     einfo "Converting shebangs for python2..."
148     python_convert_shebangs -r 2 .
149     fi
150     }
151    
152     src_compile() {
153     if use doc; then
154     cd "${S}"/doc
155     touch fragment/date
156     make xhtml xhtml-nochunks || die "failed to make docs"
157     fi
158    
159     if use epydoc; then
160     einfo "Generating api docs"
161     mkdir "${WORKDIR}"/api
162     local my_modules epydoc_opts=""
163     my_modules="$(find "${S}/pym" -name "*.py" \
164     | sed -e 's:/__init__.py$::' -e 's:\.py$::' -e "s:^${S}/pym/::" \
165     -e 's:/:.:g' | sort)" || die "error listing modules"
166     # workaround for bug 282760
167     > "$S/pym/pysqlite2.py"
168     PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \
169     epydoc -o "${WORKDIR}"/api \
170     -qqqqq --no-frames --show-imports $epydoc_opts \
171     --name "${PN}" --url "${HOMEPAGE}" \
172     ${my_modules} || die "epydoc failed"
173     rm "$S/pym/pysqlite2.py"
174     fi
175     }
176    
177     src_test() {
178     # make files executable, in case they were created by patch
179     find bin -type f | xargs chmod +x
180     ./pym/portage/tests/runTests || die "test(s) failed"
181     }
182    
183     src_install() {
184     local libdir=$(get_libdir)
185     local portage_base="/usr/${libdir}/portage"
186     local portage_share_config=/usr/share/portage/config
187    
188     cd "${S}"/cnf
189     insinto /etc
190     doins etc-update.conf dispatch-conf.conf || die
191    
192     insinto "$portage_share_config/sets"
193     doins "$S"/cnf/sets/*.conf || die
194     insinto "$portage_share_config"
195     doins "$S/cnf/make.globals" || die
196     if [ -f "make.conf.${ARCH}".diff ]; then
197     patch make.conf "make.conf.${ARCH}".diff || \
198     die "Failed to patch make.conf.example"
199     newins make.conf make.conf.example || die
200     else
201     eerror ""
202     eerror "Portage does not have an arch-specific configuration for this arch."
203     eerror "Please notify the arch maintainer about this issue. Using generic."
204     eerror ""
205     newins make.conf make.conf.example || die
206     fi
207    
208     dosym ..${portage_share_config}/make.globals /etc/make.globals
209    
210     insinto /etc/logrotate.d
211     doins "${S}"/cnf/logrotate.d/elog-save-summary || die
212    
213     # BSD and OSX need a sed wrapper so that find/xargs work properly
214     if use userland_GNU; then
215     rm "${S}"/bin/ebuild-helpers/sed || die "Failed to remove sed wrapper"
216     fi
217    
218     local x symlinks files
219    
220     cd "$S" || die "cd failed"
221     for x in $(find bin -type d) ; do
222     exeinto $portage_base/$x || die "exeinto failed"
223     cd "$S"/$x || die "cd failed"
224     files=$(find . -mindepth 1 -maxdepth 1 -type f ! -type l)
225     if [ -n "$files" ] ; then
226     doexe $files || die "doexe failed"
227     fi
228     symlinks=$(find . -mindepth 1 -maxdepth 1 -type l)
229     if [ -n "$symlinks" ] ; then
230     cp -P $symlinks "$D$portage_base/$x" || die "cp failed"
231     fi
232     done
233    
234     cd "$S" || die "cd failed"
235     for x in $(find pym/* -type d ! -path "pym/portage/tests*") ; do
236     insinto $portage_base/$x || die "insinto failed"
237     cd "$S"/$x || die "cd failed"
238     # __pycache__ directories contain no py files
239     [[ "*.py" != $(echo *.py) ]] || continue
240     doins *.py || die "doins failed"
241     symlinks=$(find . -mindepth 1 -maxdepth 1 -type l)
242     if [ -n "$symlinks" ] ; then
243     cp -P $symlinks "$D$portage_base/$x" || die "cp failed"
244     fi
245     done
246    
247     # We install some minimal tests for use as a preinst sanity check.
248     # These tests must be able to run without a full source tree and
249     # without relying on a previous portage instance being installed.
250     cd "$S" || die "cd failed"
251     exeinto $portage_base/pym/portage/tests || die
252     doexe pym/portage/tests/runTests || die
253     insinto $portage_base/pym/portage/tests || die
254     doins pym/portage/tests/*.py || die
255     insinto $portage_base/pym/portage/tests/lint || die
256     doins pym/portage/tests/lint/*.py || die
257     doins pym/portage/tests/lint/__test__ || die
258    
259     # Symlinks to directories cause up/downgrade issues and the use of these
260     # modules outside of portage is probably negligible.
261     for x in "${D}${portage_base}/pym/"{cache,elog_modules} ; do
262     [ ! -L "${x}" ] && continue
263     die "symlink to directory will cause upgrade/downgrade issues: '${x}'"
264     done
265    
266     doman "${S}"/man/*.[0-9]
267     if use linguas_pl; then
268     doman -i18n=pl "${S_PL}"/man/pl/*.[0-9]
269     doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9]
270     fi
271    
272     dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES}
273     use doc && dohtml -r "${S}"/doc/*
274     use epydoc && dohtml -r "${WORKDIR}"/api
275    
276     dodir /usr/bin
277     for x in ebuild egencache emerge portageq quickpkg repoman ; do
278     dosym ../${libdir}/portage/bin/${x} /usr/bin/${x}
279     done
280    
281     dodir /usr/sbin
282     local my_syms="archive-conf
283     dispatch-conf
284     emaint
285     emerge-webrsync
286     env-update
287     etc-update
288     fixpackages
289     regenworld"
290     local x
291     for x in ${my_syms}; do
292     dosym ../${libdir}/portage/bin/${x} /usr/sbin/${x}
293     done
294     dosym env-update /usr/sbin/update-env
295     dosym etc-update /usr/sbin/update-etc
296    
297     dodir /etc/portage
298     keepdir /etc/portage
299     }
300    
301     pkg_preinst() {
302     if [[ $ROOT == / ]] ; then
303     # Run some minimal tests as a sanity check.
304     local test_runner=$(find "$D" -name runTests)
305     if [[ -n $test_runner && -x $test_runner ]] ; then
306     einfo "Running preinst sanity tests..."
307     "$test_runner" || die "preinst sanity tests failed"
308     fi
309     fi
310    
311     if ! use build && ! has_version dev-python/pycrypto && \
312     ! has_version '>=dev-lang/python-2.6[ssl]' ; then
313     ewarn "If you are an ebuild developer and you plan to commit ebuilds"
314     ewarn "with this system then please install dev-python/pycrypto or"
315     ewarn "enable the ssl USE flag for >=dev-lang/python-2.6 in order"
316     ewarn "to enable RMD160 hash support."
317     ewarn "See bug #198398 for more information."
318     fi
319     if [ -f "${ROOT}/etc/make.globals" ]; then
320     rm "${ROOT}/etc/make.globals"
321     fi
322    
323     has_version "<${CATEGORY}/${PN}-2.2_alpha" \
324     && MINOR_UPGRADE=true || MINOR_UPGRADE=false
325    
326     has_version "<=${CATEGORY}/${PN}-2.2_pre5" \
327     && WORLD_MIGRATION_UPGRADE=true || WORLD_MIGRATION_UPGRADE=false
328    
329     # If portage-2.1.6 is installed and the preserved_libs_registry exists,
330     # assume that the NEEDED.ELF.2 files have already been generated.
331     has_version "<=${CATEGORY}/${PN}-2.2_pre7" && \
332     ! ( [ -e "${EROOT}"var/lib/portage/preserved_libs_registry ] && \
333     has_version ">=${CATEGORY}/${PN}-2.1.6_rc" ) \
334     && NEEDED_REBUILD_UPGRADE=true || NEEDED_REBUILD_UPGRADE=false
335    
336     [[ -n $PORTDIR_OVERLAY ]] && has_version "<${CATEGORY}/${PN}-2.1.6.12" \
337     && REPO_LAYOUT_CONF_WARN=true || REPO_LAYOUT_CONF_WARN=false
338     }
339    
340     pkg_postinst() {
341     # Compile all source files recursively. Any orphans
342     # will be identified and removed in postrm.
343     python_mod_optimize /usr/$(get_libdir)/portage/pym
344    
345     if $WORLD_MIGRATION_UPGRADE ; then
346     einfo "moving set references from the worldfile into world_sets"
347     cd "${ROOT}/var/lib/portage/"
348     grep "^@" world >> world_sets
349     sed -i -e '/^@/d' world
350     fi
351    
352     if $NEEDED_REBUILD_UPGRADE ; then
353     einfo "rebuilding NEEDED.ELF.2 files"
354     for cpv in "${ROOT}/var/db/pkg"/*/*; do
355     if [ -f "${cpv}/NEEDED" ]; then
356     rm -f "${cpv}/NEEDED.ELF.2"
357     while read line; do
358     filename=${line% *}
359     needed=${line#* }
360     needed=${needed//+/++}
361     needed=${needed//#/##}
362     needed=${needed//%/%%}
363     newline=$(scanelf -BF "%a;%F;%S;%r;${needed}" $filename)
364     newline=${newline// - }
365     echo "${newline:3}" >> "${cpv}/NEEDED.ELF.2"
366     done < "${cpv}/NEEDED"
367     fi
368     done
369     fi
370    
371     if $REPO_LAYOUT_CONF_WARN ; then
372     ewarn
373     echo "If you want overlay eclasses to override eclasses from" \
374     "other repos then see the portage(5) man page" \
375     "for information about the new layout.conf and repos.conf" \
376     "configuration files." \
377     | fmt -w 75 | while read -r ; do ewarn "$REPLY" ; done
378     ewarn
379     fi
380    
381     einfo
382     einfo "For help with using portage please consult the Gentoo Handbook"
383     einfo "at http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3"
384     einfo
385    
386     if $MINOR_UPGRADE ; then
387     elog "If you're upgrading from a pre-2.2 version of portage you might"
388     elog "want to remerge world (emerge -e world) to take full advantage"
389     elog "of some of the new features in 2.2."
390     elog "This is not required however for portage to function properly."
391     elog
392     fi
393    
394     if [ -z "${PV/*_alpha*}" ]; then
395     elog "If you always want to use the latest development version of portage"
396     elog "please read http://www.gentoo.org/proj/en/portage/doc/testing.xml"
397     elog
398     fi
399     }
400    
401     pkg_postrm() {
402     python_mod_cleanup /usr/$(get_libdir)/portage/pym
403     }

  ViewVC Help
Powered by ViewVC 1.1.20