| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2006 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/rpm.eclass,v 1.15 2006/06/27 06:49:09 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/rpm.eclass,v 1.16 2009/03/12 04:29:09 vapier Exp $ |
| 4 | |
4 | |
| 5 | # Author : Alastair Tse <liquidx@gentoo.org> (21 Jun 2003) |
5 | # Author : Alastair Tse <liquidx@gentoo.org> (21 Jun 2003) |
| 6 | # |
6 | # |
| 7 | # Convienence class for extracting RPMs |
7 | # Convienence class for extracting RPMs |
| 8 | # |
8 | # |
| … | |
… | |
| 26 | # in your ebuild and it will install and use rpm2cpio instead. If you wish |
26 | # in your ebuild and it will install and use rpm2cpio instead. If you wish |
| 27 | # to force your ebuild to use rpmoffset in the presence of rpm2cpio, define: |
27 | # to force your ebuild to use rpmoffset in the presence of rpm2cpio, define: |
| 28 | # |
28 | # |
| 29 | # USE_RPMOFFSET_ONLY="1" |
29 | # USE_RPMOFFSET_ONLY="1" |
| 30 | |
30 | |
|
|
31 | inherit eutils |
| 31 | |
32 | |
| 32 | USE_RPMOFFSET_ONLY=${USE_RPMOFFSET_ONLY-""} |
33 | USE_RPMOFFSET_ONLY=${USE_RPMOFFSET_ONLY-""} |
| 33 | |
34 | |
| 34 | DEPEND=">=app-arch/rpm2targz-9.0-r1" |
35 | DEPEND=">=app-arch/rpm2targz-9.0-r1" |
| 35 | |
36 | |
| … | |
… | |
| 91 | ;; |
92 | ;; |
| 92 | esac |
93 | esac |
| 93 | done |
94 | done |
| 94 | } |
95 | } |
| 95 | |
96 | |
|
|
97 | # @FUNCTION: rpm_spec_epatch |
|
|
98 | # @USAGE: [spec] |
|
|
99 | # @DESCRIPTION: |
|
|
100 | # Read the specified spec (defaults to ${PN}.spec) and attempt to apply |
|
|
101 | # all the patches listed in it. If the spec does funky things like moving |
|
|
102 | # files around, well this won't handle that. |
|
|
103 | rpm_spec_epatch() { |
|
|
104 | local p spec=${1:-${PN}.spec} |
|
|
105 | local dir=${spec%/*} |
|
|
106 | grep '^%patch' "${spec}" | \ |
|
|
107 | while read line ; do |
|
|
108 | set -- ${line} |
|
|
109 | p=$1 |
|
|
110 | shift |
|
|
111 | EPATCH_OPTS="$*" |
|
|
112 | set -- $(grep "^P${p#%p}: " "${spec}") |
|
|
113 | shift |
|
|
114 | epatch "${dir:+${dir}/}$*" |
|
|
115 | done |
|
|
116 | } |
|
|
117 | |
| 96 | EXPORT_FUNCTIONS src_unpack |
118 | EXPORT_FUNCTIONS src_unpack |