net-misc/chrony: fix live ebuild
authorThomas Deutschmann <whissi@gentoo.org>
Sat, 2 May 2020 10:15:10 +0000 (12:15 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Sat, 2 May 2020 10:43:30 +0000 (12:43 +0200)
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
net-misc/chrony/chrony-4.0_pre2-r1.ebuild
net-misc/chrony/chrony-9999.ebuild

index 503840b27548425b1077cbf190828c95570c7348..322eeb9249442f6713a08f39ec6632ca34f4603b 100644 (file)
@@ -6,20 +6,33 @@ inherit systemd tmpfiles toolchain-funcs
 
 DESCRIPTION="NTP client and server programs"
 HOMEPAGE="https://chrony.tuxfamily.org/"
-SRC_URI="https://download.tuxfamily.org/${PN}/${P/_/-}.tar.gz"
+
+if [[ ${PV} == "9999" ]]; then
+       EGIT_REPO_URI="https://git.tuxfamily.org/chrony/chrony.git"
+
+       inherit git-r3
+else
+       SRC_URI="https://download.tuxfamily.org/${PN}/${P/_/-}.tar.gz"
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+fi
+
 LICENSE="GPL-2"
 SLOT="0"
 
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
 IUSE="
        +adns +caps +cmdmon html ipv6 libedit +nettle +ntp +phc pps readline +refclock +rtc
        +seccomp +sechash selinux
 "
+
 REQUIRED_USE="
        ?? ( libedit readline )
        sechash? ( nettle )
 "
 
+RESTRICT=test
+
+BDEPEND=""
+
 CDEPEND="
        caps? ( acct-group/ntp acct-user/ntp sys-libs/libcap )
        libedit? ( dev-libs/libedit )
@@ -27,17 +40,21 @@ CDEPEND="
        readline? ( >=sys-libs/readline-4.1-r4:= )
        seccomp? ( sys-libs/libseccomp )
 "
+
 DEPEND="
        ${CDEPEND}
        html? ( dev-ruby/asciidoctor )
        pps? ( net-misc/pps-tools )
 "
+
 RDEPEND="
        ${CDEPEND}
        selinux? ( sec-policy/selinux-chronyd )
 "
 
-RESTRICT=test
+if [[ ${PV} == "9999" ]]; then
+       BDEPEND+=" virtual/w3m"
+fi
 
 S="${WORKDIR}/${P/_/-}"
 
@@ -48,6 +65,7 @@ PATCHES=(
 
 src_prepare() {
        default
+
        sed -i \
                -e 's:/etc/chrony\.conf:/etc/chrony/chrony.conf:g' \
                doc/* examples/* || die
@@ -117,6 +135,11 @@ src_configure() {
 }
 
 src_compile() {
+       if [[ ${PV} == "9999" ]]; then
+               # uses w3m
+               emake -C doc man txt
+       fi
+
        emake all docs $(usex html '' 'ADOC=true')
 }
 
index 06eeb9fa03237624ac0915202c23b676efc0841a..322eeb9249442f6713a08f39ec6632ca34f4603b 100644 (file)
@@ -2,39 +2,60 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit git-r3 tmpfiles systemd toolchain-funcs
+inherit systemd tmpfiles toolchain-funcs
 
 DESCRIPTION="NTP client and server programs"
 HOMEPAGE="https://chrony.tuxfamily.org/"
-EGIT_REPO_URI="https://git.tuxfamily.org/chrony/chrony.git/"
+
+if [[ ${PV} == "9999" ]]; then
+       EGIT_REPO_URI="https://git.tuxfamily.org/chrony/chrony.git"
+
+       inherit git-r3
+else
+       SRC_URI="https://download.tuxfamily.org/${PN}/${P/_/-}.tar.gz"
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+fi
+
 LICENSE="GPL-2"
 SLOT="0"
 
-KEYWORDS=""
 IUSE="
-       +adns +caps +cmdmon html ipv6 libedit +ntp +phc pps readline +refclock +rtc
-       +seccomp selinux
+       +adns +caps +cmdmon html ipv6 libedit +nettle +ntp +phc pps readline +refclock +rtc
+       +seccomp +sechash selinux
 "
+
 REQUIRED_USE="
        ?? ( libedit readline )
+       sechash? ( nettle )
 "
 
+RESTRICT=test
+
+BDEPEND=""
+
 CDEPEND="
        caps? ( acct-group/ntp acct-user/ntp sys-libs/libcap )
        libedit? ( dev-libs/libedit )
+       nettle? ( dev-libs/nettle:= )
        readline? ( >=sys-libs/readline-4.1-r4:= )
        seccomp? ( sys-libs/libseccomp )
 "
+
 DEPEND="
        ${CDEPEND}
-       dev-ruby/asciidoctor
+       html? ( dev-ruby/asciidoctor )
        pps? ( net-misc/pps-tools )
 "
+
 RDEPEND="
        ${CDEPEND}
        selinux? ( sec-policy/selinux-chronyd )
 "
-RESTRICT=test
+
+if [[ ${PV} == "9999" ]]; then
+       BDEPEND+=" virtual/w3m"
+fi
+
 S="${WORKDIR}/${P/_/-}"
 
 PATCHES=(
@@ -44,6 +65,7 @@ PATCHES=(
 
 src_prepare() {
        default
+
        sed -i \
                -e 's:/etc/chrony\.conf:/etc/chrony/chrony.conf:g' \
                doc/* examples/* || die
@@ -88,15 +110,16 @@ src_configure() {
                $(usex caps '' --disable-linuxcaps)
                $(usex cmdmon '' --disable-cmdmon)
                $(usex ipv6 '' --disable-ipv6)
+               $(usex nettle '' --without-nettle)
                $(usex ntp '' --disable-ntp)
                $(usex phc '' --disable-phc)
                $(usex pps '' --disable-pps)
                $(usex refclock '' --disable-refclock)
                $(usex rtc '' --disable-rtc)
+               $(usex sechash '' --disable-sechash)
                ${CHRONY_EDITLINE}
                ${EXTRA_ECONF}
                --chronysockdir="${EPREFIX}/run/chrony"
-               --disable-sechash
                --docdir="${EPREFIX}/usr/share/doc/${PF}"
                --mandir="${EPREFIX}/usr/share/man"
                --prefix="${EPREFIX}/usr"
@@ -112,7 +135,12 @@ src_configure() {
 }
 
 src_compile() {
-       emake all docs
+       if [[ ${PV} == "9999" ]]; then
+               # uses w3m
+               emake -C doc man txt
+       fi
+
+       emake all docs $(usex html '' 'ADOC=true')
 }
 
 src_install() {
@@ -129,8 +157,10 @@ src_install() {
 
        newtmpfiles - chronyd.conf <<<"d /run/chrony 0750 $(usex caps 'ntp ntp' 'root root')"
 
-       docinto html
-       dodoc doc/*.html
+       if use html; then
+               docinto html
+               dodoc doc/*.html
+       fi
 
        keepdir /var/{lib,log}/chrony