Gentoo Archives: gentoo-dev

From: Pacho Ramos <pacho@g.o>
To: Zac Medico <zmedico@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] About using a CONFIGURATION (or SETUP) file under /usr/share/doc for configuration information
Date: Tue, 01 Jan 2013 13:34:02
Message-Id: 1357047180.4837.1.camel@belkin4
In Reply to: Re: [gentoo-dev] About using a CONFIGURATION (or SETUP) file under /usr/share/doc for configuration information by Zac Medico
1 El lun, 31-12-2012 a las 14:53 -0800, Zac Medico escribió:
2 > On 12/31/2012 05:21 AM, Pacho Ramos wrote:
3 > > pkg_postinst() {
4 > >
5 > > Some improvements I am not sure how to implement just now:
6 > > - What would be the proper way to "elog" contents
7 > > of /usr/share/doc/${PF}/CONFIGURATION.bz2 and, then, allow the following
8 > > to be shorter:
9 > >
10 > > if ! has_version 'sys-power/acpid'; then
11 > > elog
12 > > elog "You may wish to read the Gentoo Linux Power Management Guide,"
13 > > elog "which can be found online at:"
14 > > elog "http://www.gentoo.org/doc/en/power-management-guide.xml"
15 > > elog
16 > > fi
17 > > ?
18 > >
19 > > Thanks for your help
20 > >
21 >
22 > It seems that you're allowed to call the unpack() function in any phase,
23 > so something like this should work:
24 >
25 > cd "${T}"
26 > cp "${EROOT}/usr/share/doc/${PF}/CONFIGURATION"* ./
27 > [ -f ./CONFIGURATION ] || unpack ./CONFIGURATION*
28 > elog "$(< ./CONFIGURATION)"
29 >
30 >
31
32 Thanks a lot for the tip :)
33
34 On the other hand, I have seen another way of doing that looking at
35 kernel-2.eclass:
36 --- /home/pacho/gentoo-x86/sys-power/acpid/acpid-2.0.17.ebuild
37 2012-11-26 09:20:15.000000000 +0100
38 +++ ./acpid-2.0.17.ebuild 2013-01-01 14:30:18.000000000 +0100
39 @@ -17,6 +17,11 @@
40 RDEPEND="selinux? ( sec-policy/selinux-apm )"
41 DEPEND="${RDEPEND}"
42
43 +CONFIGURATION_INSTRUCTIONS="
44 + You may wish to read the Gentoo Linux Power Management Guide,
45 + which can be found online at:
46 + http://www.gentoo.org/doc/en/power-management-guide.xml"
47 +
48 src_configure() {
49 econf --docdir=/usr/share/doc/${PF}
50 }
51 @@ -37,6 +42,9 @@
52 newconfd "${FILESDIR}"/${PN}-2.0.16-conf.d ${PN}
53
54 systemd_dounit "${FILESDIR}"/systemd/${PN}.{service,socket}
55 +
56 + echo ${CONFIGURATION_INSTRUCTIONS} | fmt > CONFIGURATION
57 + dodoc CONFIGURATION
58 }
59
60 pkg_postinst() {
61 @@ -48,6 +56,8 @@
62 elog
63 fi
64
65 + echo ${CONFIGURATION_INSTRUCTIONS} | fmt | while read -s ELINE; do
66 elog "${ELINE}"; done
67 +
68 # files/systemd/acpid.socket -> ListenStream=/run/acpid.socket
69 mkdir -p "${ROOT}"/run
70
71 This could probably be moved to eutils.eclass to use it on this kind of
72 ebuilds

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies