|
| 1 | +# Copyright 1999-2023 Gentoo Authors |
| 2 | +# Distributed under the terms of the GNU General Public License v2 |
| 3 | + |
| 4 | +EAPI="8" |
| 5 | + |
| 6 | +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/dehydrated.asc |
| 7 | + |
| 8 | +inherit verify-sig |
| 9 | + |
| 10 | +DESCRIPTION="A client for signing certificates with an ACME-server" |
| 11 | +HOMEPAGE="https://dehydrated.io/" |
| 12 | +SRC_URI=" |
| 13 | + https://github.com/dehydrated-io/${PN}/releases/download/v${PV}/${P}.tar.gz |
| 14 | + verify-sig? ( https://github.com/dehydrated-io/${PN}/releases/download/v${PV}/${P}.tar.gz.asc ) |
| 15 | +" |
| 16 | + |
| 17 | +LICENSE="MIT" |
| 18 | +SLOT="0" |
| 19 | +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" |
| 20 | +IUSE="+cron" |
| 21 | + |
| 22 | +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-dehydrated )" |
| 23 | +RDEPEND="acct-group/dehydrated |
| 24 | + acct-user/dehydrated |
| 25 | + app-shells/bash |
| 26 | + net-misc/curl |
| 27 | + cron? ( virtual/cron )" |
| 28 | + |
| 29 | +src_configure() { |
| 30 | + default |
| 31 | + sed -i 's,^#CONFIG_D=.*,CONFIG_D="/etc/dehydrated/config.d",' docs/examples/config \ |
| 32 | + || die "could not set config (CONFIG_D)" |
| 33 | +} |
| 34 | + |
| 35 | +src_install() { |
| 36 | + dobin ${PN} |
| 37 | + insinto /etc/${PN} |
| 38 | + doins docs/examples/{config,domains.txt,hook.sh} |
| 39 | + fperms u+x /etc/${PN}/hook.sh |
| 40 | + dodoc docs/*.md |
| 41 | + |
| 42 | + insinto /etc/${PN}/config.d |
| 43 | + newins "${FILESDIR}"/00_gentoo.sh-r1 00_gentoo.sh |
| 44 | + |
| 45 | + keepdir /etc/${PN}/domains.d |
| 46 | + |
| 47 | + doman docs/man/dehydrated.1 |
| 48 | + |
| 49 | + if use cron ; then |
| 50 | + insinto /etc/cron.d |
| 51 | + newins "${FILESDIR}"/cron-r1 ${PN} |
| 52 | + fi |
| 53 | +} |
| 54 | + |
| 55 | +pkg_postinst() { |
| 56 | + if [[ -z "${REPLACING_VERSIONS}" ]] ; then |
| 57 | + einfo "See /etc/dehydrated/config for configuration." |
| 58 | + |
| 59 | + use cron && einfo "After finishing setup you should enable the cronjob in /etc/cron.d/dehydrated." |
| 60 | + fi |
| 61 | +} |
0 commit comments