/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.110 Revision 1.111
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.110 2004/10/02 17:47:48 iggy Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.111 2004/10/04 05:40:01 eradicator Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
1459 1459
1460# set's ARCH back to what portage expects 1460# set's ARCH back to what portage expects
1461set_arch_to_portage() { 1461set_arch_to_portage() {
1462 export ARCH="${EUTILS_ECLASS_PORTAGE_ARCH}" 1462 export ARCH="${EUTILS_ECLASS_PORTAGE_ARCH}"
1463} 1463}
1464
1465# Jeremy Huddleston <eradicator@gentoo.org>:
1466# preserve_old_lib /path/to/libblah.so.0
1467# preserve_old_lib_notify /path/to/libblah.so.0
1468#
1469# These functions are useful when a lib in your package changes --soname. Such
1470# an example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0
1471# would break packages that link against it. Most people get around this
1472# by using the portage SLOT mechanism, but that is not always a relevant
1473# solution, so instead you can add the following to your ebuilds:
1474#
1475# src_install() {
1476# ...
1477# preserve_old_lib /usr/$(get_libdir)/libogg.so.0
1478# ...
1479# }
1480#
1481# pkg_postinst() {
1482# ...
1483# preserve_old_lib_notify /usr/$(get_libdir)/libogg.so.0
1484# ...
1485# }
1486
1487preserve_old_lib() {
1488 LIB=$1
1489
1490 if [ -n "${LIB}" -a -f "${ROOT}${LIB}" ]; then
1491 SONAME=`basename ${LIB}`
1492 DIRNAME=`dirname ${LIB}`
1493
1494 dodir ${DIRNAME}
1495 cp ${ROOT}${LIB} ${D}${DIRNAME}
1496 touch ${D}${LIB}
1497 fi
1498}
1499
1500preserve_old_lib_notify() {
1501 LIB=$1
1502
1503 if [ -n "${LIB}" -a -f "${ROOT}${LIB}" ]; then
1504 SONAME=`basename ${LIB}`
1505
1506 einfo "An old version of an installed library was detected on your system."
1507 einfo "In order to avoid breaking packages that link against is, this older version"
1508 einfo "is not being removed. In order to make full use of this newer version,"
1509 einfo "you will need to execute the following command:"
1510 einfo " revdep-rebuild --soname ${SONAME}"
1511 einfo
1512 einfo "After doing that, you can safely remove ${LIB}"
1513 fi
1514}

Legend:
Removed from v.1.110  
changed lines
  Added in v.1.111

  ViewVC Help
Powered by ViewVC 1.1.20