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

Contents of /sys-apps/portage/portage-2.1.6.7_p1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Tue Mar 25 17:24:02 2014 UTC (5 months, 3 weeks ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +3 -3 lines
Mark arm64/m68k/s390/sh stable.

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key D2E96200)

1 # Copyright 1999-2014 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.1.6.7_p1.ebuild,v 1.10 2013/07/01 02:24:59 zmedico Exp $
4
5 inherit eutils multilib
6
7 DESCRIPTION="Portage is the package management and distribution system for Gentoo"
8 HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml"
9 LICENSE="GPL-2"
10 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
11 SLOT="0"
12 IUSE="build doc epydoc less linguas_pl"
13
14 python_dep=">=dev-lang/python-2.4 <dev-lang/python-3"
15
16 DEPEND="${python_dep}
17 >=sys-apps/sed-4.0.5 sys-devel/patch
18 doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
19 epydoc? ( >=dev-python/epydoc-2.0 )"
20 # the debugedit blocker is for bug #289967
21 RDEPEND="${python_dep}
22 !build? ( >=sys-apps/sed-4.0.5
23 >=app-shells/bash-3.2_p17
24 >=app-admin/eselect-1.2 )
25 elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
26 elibc_glibc? ( >=sys-apps/sandbox-1.2.17 !mips? ( >=sys-apps/sandbox-1.2.18.1-r2 ) )
27 elibc_uclibc? ( >=sys-apps/sandbox-1.2.17 !mips? ( >=sys-apps/sandbox-1.2.18.1-r2 ) )
28 >=app-misc/pax-utils-0.1.17
29 !>=dev-util/debugedit-4.4.6-r2"
30 PDEPEND="
31 !build? (
32 less? ( sys-apps/less )
33 >=net-misc/rsync-2.6.4
34 userland_GNU? ( >=sys-apps/coreutils-6.4 )
35 )"
36 # coreutils-6.4 rdep is for date format in emerge-webrsync #164532
37 # NOTE: FEATURES=installsources requires debugedit and rsync
38
39 SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives"
40
41 prefix_src_archives() {
42 local x y
43 for x in ${@}; do
44 for y in ${SRC_ARCHIVES}; do
45 echo ${y}/${x}
46 done
47 done
48 }
49
50 PV_PL="2.1.2"
51 PATCHVER_PL=""
52 TARBALL_PV=2.1.6
53 SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
54 $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)
55 linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2
56 $(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )"
57
58 for PATCHVER in 2.1.6.7 ${PV} ; do
59 SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
60 $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
61 done
62
63 S="${WORKDIR}"/${PN}-${TARBALL_PV}
64 S_PL="${WORKDIR}"/${PN}-${PV_PL}
65
66 pkg_setup() {
67 # Bug #359731 - Die early if get_libdir fails.
68 [[ -z $(get_libdir) ]] && \
69 die "get_libdir returned an empty string"
70 }
71
72 src_unpack() {
73 unpack ${A}
74 cd "${S}"
75 for PATCHVER in 2.1.6.7 ${PV} ; do
76 epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
77 done
78 einfo "Setting portage.VERSION to ${PVR} ..."
79 sed -i "s/^VERSION=.*/VERSION=\"${PVR}\"/" pym/portage/__init__.py || \
80 die "Failed to patch portage.VERSION"
81 }
82
83 src_compile() {
84
85 if use doc; then
86 cd "${S}"/doc
87 touch fragment/date
88 # Workaround for bug #272063, remove in 2.1.6.14.
89 sed 's:^XMLTO_FLAGS =:XMLTO_FLAGS = --skip-validation:' -i Makefile
90 make xhtml xhtml-nochunks || die "failed to make docs"
91 fi
92
93 if use epydoc; then
94 einfo "Generating api docs"
95 mkdir "${WORKDIR}"/api
96 local my_modules epydoc_opts=""
97 # A name collision between the portage.dbapi class and the
98 # module with the same name triggers an epydoc crash unless
99 # portage.dbapi is excluded from introspection.
100 ROOT=/ has_version '>=dev-python/epydoc-3_pre0' && \
101 epydoc_opts='--exclude-introspect portage\.dbapi'
102 my_modules="$(find "${S}/pym" -name "*.py" \
103 | sed -e 's:/__init__.py$::' -e 's:\.py$::' -e "s:^${S}/pym/::" \
104 -e 's:/:.:g' | sort)" || die "error listing modules"
105 # workaround for bug 282760
106 > "$S/pym/pysqlite2.py"
107 PYTHONPATH="${S}/pym:${PYTHONPATH}" epydoc -o "${WORKDIR}"/api \
108 -qqqqq --no-frames --show-imports $epydoc_opts \
109 --name "${PN}" --url "${HOMEPAGE}" \
110 ${my_modules} || die "epydoc failed"
111 rm "$S/pym/pysqlite2.py"
112 fi
113 }
114
115 src_test() {
116 ./pym/portage/tests/runTests || \
117 die "test(s) failed"
118 }
119
120 src_install() {
121 local libdir=$(get_libdir)
122 local portage_base="/usr/${libdir}/portage"
123 local portage_share_config=/usr/share/portage/config
124
125 cd "${S}"/cnf
126 insinto /etc
127 doins etc-update.conf dispatch-conf.conf
128
129 dodir "${portage_share_config}"
130 insinto "${portage_share_config}"
131 doins "${S}/cnf/"make.globals
132 if [ -f "make.conf.${ARCH}".diff ]; then
133 patch make.conf "make.conf.${ARCH}".diff || \
134 die "Failed to patch make.conf.example"
135 newins make.conf make.conf.example
136 else
137 eerror ""
138 eerror "Portage does not have an arch-specific configuration for this arch."
139 eerror "Please notify the arch maintainer about this issue. Using generic."
140 eerror ""
141 newins make.conf make.conf.example
142 fi
143
144 dosym ..${portage_share_config}/make.globals /etc/make.globals
145
146 insinto /etc/logrotate.d
147 doins "${S}"/cnf/logrotate.d/elog-save-summary
148
149 dodir ${portage_base}/bin
150 exeinto ${portage_base}/bin
151
152 # BSD and OSX need a sed wrapper so that find/xargs work properly
153 if use userland_GNU; then
154 rm "${S}"/bin/sed || die "Failed to remove sed wrapper"
155 fi
156
157 cd "${S}"/bin
158 doexe *
159 dosym newins ${portage_base}/bin/donewins
160
161 local symlinks
162 for mydir in $(find "${S}"/pym -type d | sed -e "s:^${S}/::") ; do
163 dodir ${portage_base}/${mydir}
164 insinto ${portage_base}/${mydir}
165 cd "${S}"/${mydir}
166 doins *.py
167 symlinks=$(find . -mindepth 1 -maxdepth 1 -type l)
168 [ -n "${symlinks}" ] && cp -P ${symlinks} "${D}${portage_base}/${mydir}"
169 done
170
171 # Symlinks to directories cause up/downgrade issues and the use of these
172 # modules outside of portage is probably negligible.
173 for x in "${D}${portage_base}/pym/"{cache,elog_modules} ; do
174 [ ! -L "${x}" ] && continue
175 die "symlink to directory will cause upgrade/downgrade issues: '${x}'"
176 done
177
178 exeinto ${portage_base}/pym/portage/tests
179 doexe "${S}"/pym/portage/tests/runTests
180
181 doman "${S}"/man/*.[0-9]
182 if use linguas_pl; then
183 doman -i18n=pl "${S_PL}"/man/pl/*.[0-9]
184 doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9]
185 fi
186
187 dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES}
188 use doc && dohtml -r "${S}"/doc/*
189 use epydoc && dohtml -r "${WORKDIR}"/api
190
191 dodir /usr/bin
192 for x in ebuild emerge portageq repoman xpak; do
193 dosym ../${libdir}/portage/bin/${x} /usr/bin/${x}
194 done
195
196 dodir /usr/sbin
197 local x
198 for x in archive-conf dispatch-conf emaint emerge-webrsync env-update \
199 etc-update fixpackages quickpkg regenworld ; do
200 dosym ../${libdir}/portage/bin/${x} /usr/sbin/${x}
201 done
202 dosym env-update /usr/sbin/update-env
203 dosym etc-update /usr/sbin/update-etc
204
205 dodir /etc/portage
206 keepdir /etc/portage
207
208 /usr/bin/python -m compileall -q -f -d "${portage_base}/pym" "${D%/}${portage_base}/pym" || die
209 /usr/bin/python -O -m compileall -q -f -d "${portage_base}/pym" "${D%/}${portage_base}/pym" || die
210 }
211
212 pkg_preinst() {
213 if [ -f "${ROOT}/etc/make.globals" ]; then
214 rm "${ROOT}/etc/make.globals"
215 fi
216 has_version ">=${CATEGORY}/${PN}-2.2_pre"
217 DOWNGRADE_FROM_2_2=$?
218 has_version "<${CATEGORY}/${PN}-2.1.6_pre"
219 UPGRADE_FROM_2_1=$?
220 }
221
222 pkg_postinst() {
223 local warning_shown=0
224 if [ $DOWNGRADE_FROM_2_2 = 0 ] ; then
225 ewarn
226 echo "Since you have downgraded from portage-2.2, do not forget to" \
227 "use revdep-rebuild when appropriate, since the @preserved-rebuild" \
228 "package set is only supported with portage-2.2." | fmt -w 70 | \
229 while read ; do ewarn "$REPLY" ; done
230 warning_shown=1
231 fi
232 if [ $UPGRADE_FROM_2_1 = 0 ] ; then
233 ewarn
234 echo "In portage-2.1.6, the default behavior has changed for" \
235 "\`emerge world\` and \`emerge system\` commands. These commands" \
236 "will reinstall all packages from the given set unless an option" \
237 "such as --noreplace, --update, or --newuse is specified." \
238 | fmt -w 70 | while read ; do ewarn "$REPLY" ; done
239 ewarn
240 echo "File collision protection is now enabled by default via" \
241 "make.globals with FEATURES=protect-owned. If you want to" \
242 "disable collision protection completely (not recommended), then" \
243 "you need to ensure that neither protect-owned nor collision-protect" \
244 "are enabled." | fmt -w 70 | while read ; do ewarn "$REPLY" ; done
245 ewarn
246 echo "If you have overridden FETCHCOMMAND or RESUMECOMMAND variables," \
247 "for compatibility with EAPI 2, you must ensure that these variables" \
248 "are written such that the downloaded file will be placed at" \
249 "\"\${DISTDIR}/\${FILE}\". Refer to make.conf(5) for" \
250 "information about FETCHCOMMAND and RESUMECOMMAND." | \
251 fmt -w 70 | while read ; do ewarn "$REPLY" ; done
252 warning_shown=1
253 fi
254 if [ $warning_shown = 1 ] ; then
255 ewarn # for symmetry
256 fi
257 }

  ViewVC Help
Powered by ViewVC 1.1.20