Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/functions/src_unpack/rpm-sources/
Date: Fri, 14 Sep 2018 16:55:48
Message-Id: 1536944109.00a1865827862c17a4019d56afb4b5b5f8a3f658.grknight@gentoo
1 commit: 00a1865827862c17a4019d56afb4b5b5f8a3f658
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 14 16:55:09 2018 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 14 16:55:09 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=00a18658
7
8 Bring rpm example up to EAPI 6 standards
9
10 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
11
12 .../functions/src_unpack/rpm-sources/text.xml | 22 ++++++++++++++--------
13 1 file changed, 14 insertions(+), 8 deletions(-)
14
15 diff --git a/ebuild-writing/functions/src_unpack/rpm-sources/text.xml b/ebuild-writing/functions/src_unpack/rpm-sources/text.xml
16 index 64ac1de..584866a 100644
17 --- a/ebuild-writing/functions/src_unpack/rpm-sources/text.xml
18 +++ b/ebuild-writing/functions/src_unpack/rpm-sources/text.xml
19 @@ -19,7 +19,7 @@ that will unpack the RPM files.
20 </p>
21
22 <p>
23 -If you do need to apply patches then override <c>src_unpack</c> in a
24 +If you do need to call additional unpack functions then override <c>src_unpack</c> in a
25 manner such as:
26 </p>
27
28 @@ -55,9 +55,11 @@ patches. The filename should be <c>suse-fetchmail-6.2.5.54.1.ebuild</c>.
29 # Copyright 1999-2018 Gentoo Foundation
30 # Distributed under the terms of the GNU General Public License v2
31
32 -inherit eutils versionator rpm
33 +EAPI="6"
34
35 -MY_PV=$(replace_version_separator 3 '-')
36 +inherit eapi7-ver rpm
37 +
38 +MY_PV=$(ver_rs 3 '-')
39 MY_P=fetchmail-${MY_PV}
40
41 SRC_URI="https://suse.osuosl.org/suse/i386/9.2/suse/src/${MY_P}.src.rpm"
42 @@ -80,13 +82,17 @@ RESTRICT="mirror"
43
44 #USE_RPMOFFSET_ONLY=1
45
46 -S=${WORKDIR}/fetchmail-$(get_version_component_range 1-3)
47 +S=${WORKDIR}/fetchmail-$(ver_cut 1-3)
48
49 src_unpack () {
50 - rpm_src_unpack ${A}
51 - cd "${S}"
52 - EPATCH_SOURCE="${WORKDIR}" EPATCH_SUFFIX="patch" \
53 - EPATCH_FORCE="yes" epatch
54 + rpm_src_unpack ${A}
55 +}
56 +
57 +src_prepare () {
58 + for i in "${WORKDIR}"/*.patch ; do
59 + eapply "${i}"
60 + done
61 + eapply_user
62 }
63 </codesample>