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

Contents of /sys-apps/portage/portage-2.1.10.65.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations) (download)
Sat Jul 7 05:38:27 2012 UTC (10 months, 1 week ago) by zmedico
Branch: MAIN
Changes since 1.9: +5 -3 lines
Make python[ssl] dep conditional on !build.

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

1 zmedico 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 zmedico 1.10 # $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.1.10.65.ebuild,v 1.9 2012/07/06 17:54:12 zmedico Exp $
4 zmedico 1.1
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 armin76 1.8 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
14 zmedico 1.1 SLOT="0"
15 zmedico 1.2 IUSE="build doc epydoc +ipc linguas_pl pypy1_9 python2 python3 selinux xattr"
16 zmedico 1.1
17     # Import of the io module in python-2.6 raises ImportError for the
18     # thread module if threading is disabled.
19 zmedico 1.9 python_dep_ssl="python3? ( =dev-lang/python-3*[ssl] )
20 zmedico 1.2 !pypy1_9? ( !python2? ( !python3? (
21 zmedico 1.9 || ( >=dev-lang/python-2.7[ssl] dev-lang/python:2.6[threads,ssl] )
22 zmedico 1.1 ) ) )
23 zmedico 1.9 pypy1_9? ( !python2? ( !python3? ( dev-python/pypy:1.9[bzip2,ssl] ) ) )
24     python2? ( !python3? ( || ( dev-lang/python:2.7[ssl] dev-lang/python:2.6[ssl,threads] ) ) )"
25     python_dep="${python_dep_ssl//\[ssl\]}"
26     python_dep="${python_dep//,ssl}"
27     python_dep="${python_dep//ssl,}"
28 zmedico 1.1
29     # The pysqlite blocker is for bug #282760.
30     DEPEND="${python_dep}
31     !build? ( >=sys-apps/sed-4.0.5 )
32     doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
33     epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
34     # Require sandbox-2.2 for bug #288863.
35     # For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
36     # quite slow, so it's not considered in the dependencies as an alternative to
37     # to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
38     # for now, don't pull in xattr deps for other kernels.
39 zmedico 1.9 # For whirlpool hash, require python[ssl] or python-mhash (bug #425046).
40 zmedico 1.10 RDEPEND="${python_dep}
41 zmedico 1.1 !build? ( >=sys-apps/sed-4.0.5
42     >=app-shells/bash-3.2_p17
43 zmedico 1.10 >=app-admin/eselect-1.2
44     || ( ${python_dep_ssl} dev-python/python-mhash )
45     )
46 zmedico 1.1 elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
47     elibc_glibc? ( >=sys-apps/sandbox-2.2 )
48     elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
49     >=app-misc/pax-utils-0.1.17
50     xattr? ( kernel_linux? ( || ( >=dev-lang/python-3.3_pre20110902 dev-python/pyxattr ) ) )
51     selinux? ( || ( >=sys-libs/libselinux-2.0.94[python] <sys-libs/libselinux-2.0.94 ) )
52     !<app-shells/bash-3.2_p17
53     !<app-admin/logrotate-3.8.0"
54     PDEPEND="
55     !build? (
56     >=net-misc/rsync-2.6.4
57     userland_GNU? ( >=sys-apps/coreutils-6.4 )
58     )"
59     # coreutils-6.4 rdep is for date format in emerge-webrsync #164532
60     # NOTE: FEATURES=install-sources requires debugedit and rsync
61    
62     SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives"
63    
64     prefix_src_archives() {
65     local x y
66     for x in ${@}; do
67     for y in ${SRC_ARCHIVES}; do
68     echo ${y}/${x}
69     done
70     done
71     }
72    
73     PV_PL="2.1.2"
74     PATCHVER_PL=""
75     TARBALL_PV=$PV
76     SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
77     $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)
78     linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2
79     $(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )"
80    
81     PATCHVER=
82     [[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
83     if [ -n "${PATCHVER}" ]; then
84     SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
85     $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
86     fi
87    
88     S="${WORKDIR}"/${PN}-${TARBALL_PV}
89     S_PL="${WORKDIR}"/${PN}-${PV_PL}
90    
91     compatible_python_is_selected() {
92     [[ $(/usr/bin/python -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
93     }
94    
95     current_python_has_xattr() {
96     [[ $(/usr/bin/python -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x3030000 and "yes" or "no")') = yes ]] || \
97     /usr/bin/python -c 'import xattr' 2>/dev/null
98     }
99    
100     pkg_setup() {
101     # Bug #359731 - Die early if get_libdir fails.
102     [[ -z $(get_libdir) ]] && \
103     die "get_libdir returned an empty string"
104    
105     if use python2 && use python3 ; then
106     ewarn "Both python2 and python3 USE flags are enabled, but only one"
107     ewarn "can be in the shebangs. Using python3."
108     fi
109 zmedico 1.2 if use pypy1_9 && use python3 ; then
110     ewarn "Both pypy1_9 and python3 USE flags are enabled, but only one"
111 zmedico 1.1 ewarn "can be in the shebangs. Using python3."
112     fi
113 zmedico 1.2 if use pypy1_9 && use python2 ; then
114     ewarn "Both pypy1_9 and python2 USE flags are enabled, but only one"
115 zmedico 1.1 ewarn "can be in the shebangs. Using python2"
116     fi
117 zmedico 1.2 if ! use pypy1_9 && ! use python2 && ! use python3 && \
118 zmedico 1.1 ! compatible_python_is_selected ; then
119     ewarn "Attempting to select a compatible default python interpreter"
120     local x success=0
121     for x in /usr/bin/python2.* ; do
122     x=${x#/usr/bin/python2.}
123     if [[ $x -ge 6 ]] 2>/dev/null ; then
124     eselect python set python2.$x
125     if compatible_python_is_selected ; then
126     elog "Default python interpreter is now set to python-2.$x"
127     success=1
128     break
129     fi
130     fi
131     done
132     if [ $success != 1 ] ; then
133     eerror "Unable to select a compatible default python interpreter!"
134     die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
135     fi
136     fi
137    
138     if use python3; then
139     python_set_active_version 3
140     elif use python2; then
141     python_set_active_version 2
142 zmedico 1.2 elif use pypy1_9; then
143     python_set_active_version 2.7-pypy-1.9
144 zmedico 1.1 fi
145     }
146    
147     src_prepare() {
148     if [ -n "${PATCHVER}" ] ; then
149     if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
150     rm "$S/bin/ebuild-helpers/portageq" \
151     || die "failed to remove portageq helper symlink"
152     fi
153     epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
154     fi
155     einfo "Setting portage.VERSION to ${PVR} ..."
156     sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \
157     die "Failed to patch portage.VERSION"
158     sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \
159     die "Failed to patch VERSION in doc/fragment/version"
160     sed -e "1s/VERSION/${PVR}/" -i man/* || \
161     die "Failed to patch VERSION in man page headers"
162    
163     if ! use ipc ; then
164     einfo "Disabling ipc..."
165     sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
166     -i pym/_emerge/AbstractEbuildProcess.py || \
167     die "failed to patch AbstractEbuildProcess.py"
168     fi
169    
170     if use xattr && use kernel_linux ; then
171     einfo "Adding FEATURES=xattr to make.globals ..."
172     echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
173     || die "failed to append to make.globals"
174     fi
175    
176     if use python3; then
177     einfo "Converting shebangs for python3..."
178     python_convert_shebangs -r 3 .
179     elif use python2; then
180     einfo "Converting shebangs for python2..."
181     python_convert_shebangs -r 2 .
182 zmedico 1.2 elif use pypy1_9; then
183     einfo "Converting shebangs for pypy-c1.9..."
184     python_convert_shebangs -r 2.7-pypy-1.9 .
185 zmedico 1.1 fi
186    
187     cd "${S}/cnf" || die
188     if [ -f "make.conf.${ARCH}".diff ]; then
189     patch make.conf "make.conf.${ARCH}".diff || \
190     die "Failed to patch make.conf.example"
191     else
192     eerror ""
193     eerror "Portage does not have an arch-specific configuration for this arch."
194     eerror "Please notify the arch maintainer about this issue. Using generic."
195     eerror ""
196     fi
197    
198     # BSD and OSX need a sed wrapper so that find/xargs work properly
199     if use userland_GNU; then
200     rm -f "${S}"/bin/ebuild-helpers/sed || \
201     die "Failed to remove sed wrapper"
202     fi
203     }
204    
205     src_compile() {
206     if use doc; then
207     emake docbook || die
208     fi
209    
210     if use epydoc; then
211     einfo "Generating api docs"
212     emake epydoc || die
213     fi
214     }
215    
216     src_test() {
217     emake test || die
218     }
219    
220     src_install() {
221     emake DESTDIR="${D}" \
222     sysconfdir="/etc" \
223     prefix="/usr" \
224     libdir="/usr/$(get_libdir)" \
225     install || die
226    
227     # Use dodoc for compression, since the Makefile doesn't do that.
228     dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} || die
229    
230     if use linguas_pl; then
231     doman -i18n=pl "${S_PL}"/man/pl/*.[0-9] || die
232     doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9] || die
233     fi
234     }
235    
236     pkg_preinst() {
237     if [[ $ROOT == / ]] ; then
238     # Run some minimal tests as a sanity check.
239     local test_runner=$(find "$D" -name runTests)
240     if [[ -n $test_runner && -x $test_runner ]] ; then
241     einfo "Running preinst sanity tests..."
242     "$test_runner" || die "preinst sanity tests failed"
243     fi
244     fi
245    
246     if use xattr && ! current_python_has_xattr ; then
247     ewarn "For optimal performance in xattr handling, install"
248     ewarn "dev-python/pyxattr, or install >=dev-lang/python-3.3 and"
249     ewarn "enable USE=python3 for $CATEGORY/$PN."
250     fi
251    
252     if ! use build && ! has_version dev-python/pycrypto && \
253     ! has_version '>=dev-lang/python-2.6[ssl]' ; then
254     ewarn "If you are an ebuild developer and you plan to commit ebuilds"
255     ewarn "with this system then please install dev-python/pycrypto or"
256     ewarn "enable the ssl USE flag for >=dev-lang/python-2.6 in order"
257     ewarn "to enable RMD160 hash support."
258     ewarn "See bug #198398 for more information."
259     fi
260     if [ -f "${ROOT}/etc/make.globals" ]; then
261     rm "${ROOT}/etc/make.globals"
262     fi
263    
264     if [[ -d ${ROOT}var/log/portage && \
265     $(ls -ld "${ROOT}var/log/portage") != *" portage portage "* ]] && \
266     has_version '<sys-apps/portage-2.1.10.11' ; then
267     # Initialize permissions for bug #378451 and bug #377177, since older
268     # portage does not create /var/log/portage with the desired default
269     # permissions.
270     einfo "Applying portage group permission to ${ROOT}var/log/portage for bug #378451"
271     chown portage:portage "${ROOT}var/log/portage"
272     chmod g+ws "${ROOT}var/log/portage"
273     fi
274    
275     [[ -n $PORTDIR_OVERLAY ]] && has_version "<${CATEGORY}/${PN}-2.1.6.12" \
276     && REPO_LAYOUT_CONF_WARN=true || REPO_LAYOUT_CONF_WARN=false
277    
278     if has_version '<sys-apps/portage-2.1.10.61' ; then
279     ewarn "FEATURES=config-protect-if-modified is now enabled by default."
280     ewarn "This causes the CONFIG_PROTECT behavior to be skipped for"
281     ewarn "files that have not been modified since they were installed."
282     fi
283     }
284    
285     pkg_postinst() {
286     # Compile all source files recursively. Any orphans
287     # will be identified and removed in postrm.
288     python_mod_optimize /usr/$(get_libdir)/portage/pym
289    
290     if $REPO_LAYOUT_CONF_WARN ; then
291     ewarn
292     echo "If you want overlay eclasses to override eclasses from" \
293     "other repos then see the portage(5) man page" \
294     "for information about the new layout.conf and repos.conf" \
295     "configuration files." \
296     | fmt -w 75 | while read -r ; do ewarn "$REPLY" ; done
297     ewarn
298     fi
299     }
300    
301     pkg_postrm() {
302     python_mod_cleanup /usr/$(get_libdir)/portage/pym
303     }

  ViewVC Help
Powered by ViewVC 1.1.13