/[gentoo-alt]/trunk/sys-apps/portage/portage-2.0.51_rc2.ebuild
Gentoo

Contents of /trunk/sys-apps/portage/portage-2.0.51_rc2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 43 - (show annotations) (download)
Sat Sep 25 16:03:46 2004 UTC (9 years, 11 months ago) by ka0ttic
File size: 10899 byte(s)
Version bump.

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header$
4
5 IUSE="build multilib selinux"
6
7 inherit eutils
8
9 # If the old /lib/sandbox.so is in /etc/ld.so.preload, it can
10 # cause everything to segfault !!
11 export SANDBOX_DISABLED="1"
12
13 S=${WORKDIR}/${PF}
14 SLOT="0"
15 DESCRIPTION="Portage ports system"
16 SRC_URI="http://gentoo.twobit.net/portage/${PF}.tar.bz2 mirror://gentoo/${PF}.tar.bz2"
17 HOMEPAGE="http://www.gentoo.org"
18
19 # Contact carpaski with a reason before you modify any of these.
20 KEYWORDS=" alpha amd64 arm hppa ia64 macos mips ppc ppc64 s390 sparc x86"
21 #KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~macos ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
22
23 LICENSE="GPL-2"
24 RDEPEND="!build? ( >=sys-apps/sed-4.0.5 dev-python/python-fchksum >=dev-lang/python-2.2.1 sys-apps/debianutils >=app-shells/bash-2.05a ) selinux? ( dev-python/python-selinux )"
25
26 python_version() {
27 local tmpstr="$(/usr/bin/python -V 2>&1 )"
28 export PYVER_ALL="${tmpstr#Python }"
29
30 export PYVER_MAJOR=$(echo ${PYVER_ALL} | cut -d. -f1)
31 export PYVER_MINOR=$(echo ${PYVER_ALL} | cut -d. -f2)
32 export PYVER_MICRO=$(echo ${PYVER_ALL} | cut -d. -f3-)
33 export PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
34 }
35
36 check_multilib() {
37 use !multilib && return
38 echo 'main() {}' > ./check-multilib.c
39 /usr/bin/gcc -m32 -o ./check-multilib ./check-multilib.c > /dev/null 2>&1
40 if [ "$?" == 0 ]; then
41 einfo "Found valid multilib environment."
42 einfo "Building with multilib support."
43 export MULTILIB="1"
44 else
45 ewarn "No valid multilib environment found!"
46 ewarn "Building without multilib support. If"
47 ewarn "you want to have multilib support,"
48 ewarn "emerge gcc with \"multilib\" in your"
49 ewarn "useflags."
50 sleep 5
51 fi
52 }
53
54 src_unpack() {
55 unpack ${A}
56 cd ${S}
57
58 use x86-fbsd && {
59 cd ${S}/src
60 epatch ${FILESDIR}/sandbox-1.1-fbsd.diff
61 }
62 }
63
64 src_compile() {
65 cd ${S}/src; ${CC:-gcc} ${CFLAGS} tbz2tool.c -o tbz2tool
66 cd ${S}/src/sandbox-1.1
67 case ${ARCH} in
68 "x86")
69 make CFLAGS="-march=i386 -O1 -pipe" || die
70 ;;
71 "amd64")
72 check_multilib
73 make CFLAGS="-O2 -pipe" HAVE_64BIT_ARCH="${MULTILIB}" || die
74 ;;
75 "macos")
76 ewarn "NOT BUILDING SANDBOX ON $ARCH"
77 ;;
78 "x86-fbsd")
79 $(which make) || die
80 ;;
81 *)
82 make || die
83 ;;
84 esac
85 cd ${S}/bin
86 }
87
88 src_install() {
89 #config files
90 cd ${S}/cnf
91 insinto /etc
92 if [ -f "make.globals.${ARCH}" ]; then
93 newins make.globals.${ARCH} make.globals
94 newins make.conf.${ARCH} make.conf.example
95 else
96 eerror ""
97 eerror "Portage does not have an arch-specific configuration for this arch."
98 eerror "Please notify the arch maintainer about this issue. Using generic."
99 eerror ""
100 sleep 3
101 doins make.globals
102 newins make.conf make.conf.example
103 fi
104
105 doins etc-update.conf dispatch-conf.conf
106
107 #python modules
108 if [ -x "$(type -p python2.2)" ] || [ -x /usr/bin/python2.2 ]; then
109 cd ${S}/src/python-missingos
110 chmod +x setup.py
111 if [ -x "$(type -p python2.3)" ]; then
112 ./setup.py install --root ${D} || eerror "Failed to install missingos module -- python2.2 broken?"
113 else
114 ./setup.py install --root ${D} || die "Failed to install missingos module"
115 fi
116 fi
117
118
119 dodir /usr/lib/portage/pym
120 cd ${S}/pym
121 insinto /usr/lib/portage/pym
122 doins *.py
123
124 #binaries, libraries and scripts
125 dodir /usr/lib/portage/bin
126 cd ${S}/bin
127 exeinto /usr/lib/portage/bin
128 doexe *
129 dosym emake /usr/lib/portage/bin/pmake
130 doexe ${S}/src/tbz2tool
131
132 case "$ARCH" in
133 macos)
134 ewarn "Not installing sandbox on $ARCH"
135 ;;
136 x86-fbsd)
137 cd ${S}/src/sandbox-1.1
138 $(which make) DESTDIR=${D} install || die "Failed to compile sandbox"
139 ;;
140 *)
141 #install sandbox
142 cd ${S}/src/sandbox-1.1
143 make DESTDIR=${D} HAVE_64BIT_ARCH="${MULTILIB}" \
144 install || die "Failed to compile sandbox"
145 ;;
146 esac
147
148 #symlinks
149 dodir /usr/bin /usr/sbin
150 dosym ../lib/portage/bin/emerge /usr/bin/emerge
151 dosym ../lib/portage/bin/pkgmerge /usr/sbin/pkgmerge
152 dosym ../lib/portage/bin/ebuild /usr/sbin/ebuild
153 dosym ../lib/portage/bin/ebuild.sh /usr/sbin/ebuild.sh
154
155 dosym ../lib/portage/bin/etc-update /usr/sbin/etc-update
156 dosym ../lib/portage/bin/dispatch-conf /usr/sbin/dispatch-conf
157 dosym ../lib/portage/bin/archive-conf /usr/sbin/archive-conf
158 dosym ../lib/portage/bin/fixpackages /usr/sbin/fixpackages
159
160 dosym ../lib/portage/bin/env-update /usr/sbin/env-update
161 dosym ../lib/portage/bin/xpak /usr/bin/xpak
162 dosym ../lib/portage/bin/repoman /usr/bin/repoman
163 dosym ../lib/portage/bin/tbz2tool /usr/bin/tbz2tool
164 dosym ../lib/portage/bin/portageq /usr/bin/portageq
165
166 dosym ../lib/portage/bin/g-cpan.pl /usr/bin/g-cpan.pl
167 dosym ../lib/portage/bin/quickpkg /usr/bin/quickpkg
168 dosym ../lib/portage/bin/regenworld /usr/sbin/regenworld
169 dosym ../lib/portage/bin/emerge-webrsync /usr/sbin/emerge-webrsync
170
171 dosym newins /usr/lib/portage/bin/donewins
172
173 # man pages
174 doman ${S}/man/*.[0-9]
175
176 # temp dir creation
177 dodir /var/tmp
178 chmod 1777 ${D}/var/tmp
179 touch ${D}/var/tmp/.keep
180
181 #documentation
182 dodoc ${S}/ChangeLog
183 }
184
185
186 pkg_preinst() {
187 if has livecvsportage $FEATURES; then
188 if [ "$ROOT" == "/" ]; then
189 rm -Rf "${IMAGE}"/usr/lib/portage/pym/*
190
191 mv "${IMAGE}"/usr/lib/portage/bin/{sandbox,tbz2tool} ${T}
192 rm -Rf "${IMAGE}"/usr/lib/portage/bin/*
193 mv "${T}"/{sandbox,tbz2tool} "${IMAGE}"/usr/lib/portage/bin/
194 fi
195 fi
196 }
197
198 pkg_postinst() {
199 local x
200
201 [ -f "${ROOT}etc/make.conf" ] || touch ${ROOT}etc/make.conf
202
203 #disable global sandbox if it's active (it's been deprecated)
204 if [ -f /etc/ld.so.preload ] ; then
205 cp /etc/ld.so.preload ${T}
206 grep -v libsandbox ${T}/ld.so.preload > /etc/ld.so.preload
207 fi
208
209 #remove possible previous sandbox files that could cause conflicts
210 if [ -d /usr/lib/sandbox ]; then
211 rm -f ${ROOT}/usr/lib/portage/bin/ebuild.sh.orig
212 rm -f ${ROOT}/usr/lib/portage/pym/portage.py.orig
213 rm -f ${ROOT}/usr/bin/sandbox
214 rm -rf ${ROOT}/usr/lib/sandbox
215 fi
216
217 #yank old cache files
218 if [ -d /var/cache/edb ]
219 then
220 rm -f /var/cache/edb/xcache.p
221 rm -f /var/cache/edb/mtimes
222 fi
223
224 install -o root -g portage -m 0755 -d "${ROOT}/etc/portage"
225 install -o root -g portage -m 2775 -d "${ROOT}/etc/portage/sets"
226 # u+rwx,g+srwx --- This is a secure directory for temp files.
227
228 install -o root -g portage -m 2770 -d "${ROOT}/var/lib/portage"
229 einfo "Checking ${ROOT}/var/lib/portage for bad/illegal files:"
230 find "${ROOT}/var/lib/portage" ! -group $(id -g portage) -o -perm -002 -print0 | ${XARGS} -0n 500 rm -Rvf
231
232 OLDWORLD="${ROOT}/var/cache/edb/world"
233 NEWWORLD="${ROOT}/var/lib/portage/world"
234
235 if [ ! -f "${NEWWORLD}" ]; then
236 cp "${OLDWORLD}" "${NEWWORLD}" && \
237 rm -f "${OLDWORLD}" && \
238 ln ../../lib/portage/world "${NEWWORLD}"
239 fi
240
241 if [ ! -f "/etc/portage/package.mask" ]; then
242 if [ -f "/etc/portage/profiles/package.mask" ]; then
243 ln /etc/portage/profiles/package.mask /etc/portage/package.mask
244 einfo "/etc/portage/profiles/package.mask is now /etc/portage/package.mask"
245 einfo "a hardlink has been created to the new location if it exists in profiles"
246 einfo "already."
247 echo
248 fi
249 fi
250 echo
251
252 einfo "Feature additions are noted in help and make.conf descriptions."
253 echo
254 einfo "Update configs using 'etc-update' please. Maintaining current configs"
255 einfo "for portage and other system packages is fairly important for the"
256 einfo "continued health of your system."
257 echo
258 ewarn "NOTICE: There have been changes in the location of some internal files"
259 ewarn " to better match the FHS. The changes do not directly affect users"
260 ewarn " but please be advised that changing between versions of portage"
261 ewarn " with and without these changes may introduce some inconsistencies"
262 ewarn " in package data regarding 'world' and 'virtuals' (provides)."
263 echo
264 einfo " /var/cache/edb/world has moved to /var/lib/portage/world"
265 echo
266 einfo " /var/cache/edb/virtuals has been deprecated and is now calculated"
267 einfo " on demand. Strictly _USER_ modifications to virtuals may go into"
268 einfo " /etc/portage/profile/virtuals and will not be modified by portage."
269 echo
270
271 if [ -z "$PORTAGE_TEST" ]; then
272 for TICKER in 1 2 3 4 5 6 7 8 9 10; do
273 echo -ne "\a" ; sleep 0.$(( $RANDOM % 9 + 1)) &>/dev/null ; sleep 0,$(( $RANDOM % 9 + 1)) &>/dev/null
274 done
275 sleep 5
276
277 # Kill the existing counter and generate a new one.
278 echo -n "Recalculating the counter... "
279 mv /var/cache/edb/counter /var/cache/edb/counter.old
280 python -c 'import sys; sys.path = ["/usr/lib/portage/pym"]+sys.path; import portage; portage.db["/"]["vartree"].dbapi.counter_tick("/")' &>/dev/null
281 if [ -f /var/cache/edb/counter ] ; then
282 echo "Counter updated successfully."
283 rm -f /var/cache/edb/counter.old
284 else
285 echo "FAILED to update counter."
286 ls -l /var/cache/edb/counter.old
287 echo "!!! This is a problem."
288 mv /var/cache/edb/counter.old /var/cache/edb/counter
289 fi
290 fi # PORTAGE_TESTING
291
292 if [ ! -d "${ROOT}var/cache/edb/dep" ]
293 then
294 install -d -m2755 ${ROOT}var/cache/edb
295 install -d -m2775 -o root -g portage ${ROOT}var/cache/edb/dep
296 fi
297
298 # Old place of install
299 rm -f ${ROOT}usr/lib/python2.2/site-packages/portage.py[co]
300 rm -f ${ROOT}usr/lib/python2.2/site-packages/xpak.py[co]
301 rm -f ${ROOT}usr/lib/python2.2/site-packages/output.py[co]
302 rm -f ${ROOT}usr/lib/python2.2/site-packages/cvstree.py[co]
303 rm -f ${ROOT}usr/lib/python2.2/site-packages/getbinpkg.py[co]
304 rm -f ${ROOT}usr/lib/python2.2/site-packages/emergehelp.py[co]
305 rm -f ${ROOT}usr/lib/python2.2/site-packages/dispatch_conf.py[co]
306
307 # New old place of install
308 rm -f ${ROOT}usr/lib/portage/pym/*.py[co]
309
310 # we gotta re-compile these modules and deal with systems with clock skew (stale compiled files)
311 einfo "Compiling python modules..."
312 python -c 'import compileall; compile_path()' &> /dev/null
313 python -c "import compileall; compile_dir('${ROOT}usr/lib/portage/pym')" &> /dev/null
314
315 if has ccache $FEATURES && has userpriv $FEATURES; then
316 chown -R portage:portage /var/tmp/ccache &> /dev/null
317 chmod -R g+rws /var/tmp/ccache &>/dev/null
318 fi
319
320 if [ -d "${ROOT}usr/portage/distfiles" ]; then
321 chown -R root:portage "${ROOT}usr/portage/distfiles"
322
323 find "${ROOT}usr/portage/distfiles" -type f -maxdepth 1 -print0 | \
324 ${XARGS} -0 -n 500 chmod 0644 &> /dev/null
325
326 chmod 2775 "${ROOT}usr/portage/distfiles"
327 chmod 2775 "${ROOT}usr/portage/distfiles/cvs-src"
328 fi
329 if [ -d "${ROOT}/${PORTDIR}/distfiles" ]; then
330 chown -R root:portage "${ROOT}/${PORTDIR}/distfiles"
331
332 find "${ROOT}/${PORTDIR}/distfiles" -type f -maxdepth 1 -print0 | \
333 ${XARGS} -0 -n 500 chmod 0644 &> /dev/null
334
335 chmod 2775 "${ROOT}/${PORTDIR}/distfiles"
336 chmod 2775 "${ROOT}/${PORTDIR}/distfiles/cvs-src"
337 fi
338
339 chown -R root:portage ${ROOT}var/cache/edb
340 find ${ROOT}var/cache/edb -type f -print0 | ${XARGS} -0 -n 500 chmod 664
341
342 for X in ${ROOT}etc/._cfg????_make.globals; do
343 # Overwrite the globals file automatically.
344 [ -e "${X}" ] && mv -f "${X}" "${ROOT}etc/make.globals"
345 done
346 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20