summaryrefslogtreecommitdiff
path: root/app-crypt/certbot/certbot-3.2.0-r100.ebuild
blob: 247ce0f88a34a6aa135443f97fbccaaa9da44065 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..13} )

inherit distutils-r1

if [[ "${PV}" == *9999 ]]; then
	inherit git-r3

	EGIT_REPO_URI="https://github.com/certbot/certbot.git"
	EGIT_SUBMODULES=()
	EGIT_CHECKOUT_DIR="${WORKDIR}/${P}"
else
	SRC_URI="
		https://github.com/certbot/certbot/archive/v${PV}.tar.gz
			-> ${P}.gh.tar.gz
	"
	#KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
	# Only for amd64, arm64 and x86 because of dev-python/python-augeas
	#KEYWORDS="~amd64 ~arm64 ~x86"
	# Only for amd64 and x86 because of dev-python/dns-lexicon
	KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
fi

DESCRIPTION="Let’s Encrypt client to automate deployment of X.509 certificates"
HOMEPAGE="
	https://github.com/certbot/certbot
	https://pypi.org/project/certbot/
	https://letsencrypt.org/
"

LICENSE="Apache-2.0"
SLOT="0"

# acme required for certbot, and then required for modules
CERTBOT_BASE=(acme certbot)
# List of "subpackages" from tools/_release.sh (without acme which is already above)
CERTBOT_MODULES_EXTRA=(
	apache
	#dns-cloudflare # Requires missing packages, already in GURU
	#dns-digitalocean # Requires missing packages, already in GURU
	dns-dnsimple
	dns-dnsmadeeasy
	dns-gehirn
	dns-google
	dns-linode
	dns-luadns
	dns-nsone
	dns-ovh
	dns-rfc2136
	dns-route53
	dns-sakuracloud
	nginx
)

IUSE="selinux"
for module in "${CERTBOT_MODULES_EXTRA[@]}"; do
	IUSE+=" certbot-${module}"
done

BDEPEND="
	test? (
		dev-python/pytest[${PYTHON_USEDEP}]
		dev-python/typing-extensions[${PYTHON_USEDEP}]
	)
"

# See each setup.py for dependencies
# Also discard the previous related packages
# except their transition step
RDEPEND="
	!<app-crypt/acme-3.2.0-r100
	!<app-crypt/certbot-apache-3.2.0-r100
	!<app-crypt/certbot-dns-desec-3.2.0-r100
	!<app-crypt/certbot-dns-dnsimple-3.2.0-r100
	!<app-crypt/certbot-dns-nsone-3.2.0-r100
	!<app-crypt/certbot-dns-rfc2136-3.2.0-r100
	!<app-crypt/certbot-nginx-3.2.0-r100

	dev-python/chardet[${PYTHON_USEDEP}]
	>=dev-python/configargparse-1.5.3[${PYTHON_USEDEP}]
	>=dev-python/configobj-5.0.6[${PYTHON_USEDEP}]
	>=dev-python/cryptography-43.0.0[${PYTHON_USEDEP}]
	>=dev-python/distro-1.0.1[${PYTHON_USEDEP}]
	>=dev-python/josepy-1.13.0[${PYTHON_USEDEP}]
	<dev-python/josepy-2[${PYTHON_USEDEP}]
	>=dev-python/parsedatetime-2.4[${PYTHON_USEDEP}]
	>=dev-python/pyopenssl-25.0.0[${PYTHON_USEDEP}]
	dev-python/pyrfc3339[${PYTHON_USEDEP}]
	>=dev-python/pytz-2019.3[${PYTHON_USEDEP}]
	>=dev-python/requests-2.20.0[${PYTHON_USEDEP}]
	certbot-apache? (
		dev-python/python-augeas[${PYTHON_USEDEP}]
	)
	certbot-dns-dnsimple? (
		>=dev-python/dns-lexicon-3.14.1[${PYTHON_USEDEP}]
	)
	certbot-dns-dnsmadeeasy? (
		>=dev-python/dns-lexicon-3.14.1[${PYTHON_USEDEP}]
	)
	certbot-dns-gehirn? (
		>=dev-python/dns-lexicon-3.14.1[${PYTHON_USEDEP}]
	)
	certbot-dns-google? (
		>=dev-python/google-api-python-client-1.6.5[${PYTHON_USEDEP}]
		>=dev-python/google-auth-2.16.0[${PYTHON_USEDEP}]
	)
	certbot-dns-linode? (
		>=dev-python/dns-lexicon-3.14.1[${PYTHON_USEDEP}]
	)
	certbot-dns-luadns? (
		>=dev-python/dns-lexicon-3.14.1[${PYTHON_USEDEP}]
	)
	certbot-dns-nsone? (
		>=dev-python/dns-lexicon-3.14.1[${PYTHON_USEDEP}]
	)
	certbot-dns-ovh? (
		>=dev-python/dns-lexicon-3.15.1[${PYTHON_USEDEP}]
	)
	certbot-dns-rfc2136? (
		>=dev-python/dnspython-2.6.1[${PYTHON_USEDEP}]
	)
	certbot-dns-route53? (
		>=dev-python/boto3-1.15.15[${PYTHON_USEDEP}]
	)
	certbot-dns-sakuracloud? (
		>=dev-python/dns-lexicon-3.14.1[${PYTHON_USEDEP}]
	)
	certbot-nginx? (
		>=dev-python/pyopenssl-25.0.0[${PYTHON_USEDEP}]
		>=dev-python/pyparsing-2.4.7[${PYTHON_USEDEP}]
	)
	selinux? ( sec-policy/selinux-certbot )
"
# RDEPEND+="
#	!<app-crypt/certbot-dns-cloudflare-3.2.0-r100
#
# 	>=dev-python/requests-toolbelt-0.3.0[${PYTHON_USEDEP}] # @TODO is still necessary?
# 	certbot-dns-cloudflare? (
# 		# Available in GURU
# 		>=dev-python/cloudflare-2.19[${PYTHON_USEDEP}]
# 		<dev-python/cloudflare-2.20[${PYTHON_USEDEP}]
# 	)
# 	certbot-dns-digitalocean? (
# 		# Available in GURU
# 		>=dev-python/digitalocean-1.11[${PYTHON_USEDEP}]
# 	)
# "

distutils_enable_sphinx docs \
	dev-python/sphinx-rtd-theme
distutils_enable_tests pytest

src_prepare() {
	local S_BACKUP="${S}"

	local certbot_dirs=()
	local base module dir
	for base in "${CERTBOT_BASE[@]}"; do
		certbot_dirs+=("${base}")
	done
	for module in "${CERTBOT_MODULES_EXTRA[@]}"; do
		use "certbot-${module}" \
			&& certbot_dirs+=("certbot-${module}")
	done

	for dir in "${certbot_dirs[@]}"; do
		S="${WORKDIR}/${P}/${dir}"
		pushd "${S}" > /dev/null || die
		distutils-r1_src_prepare
		popd > /dev/null || die
	done

	# Restore S
	S="${S_BACKUP}"
}

src_configure() {
	local S_BACKUP="${S}"

	local certbot_dirs=()
	local base module dir
	for base in "${CERTBOT_BASE[@]}"; do
		certbot_dirs+=("${base}")
	done
	for module in "${CERTBOT_MODULES_EXTRA[@]}"; do
		use "certbot-${module}" \
			&& certbot_dirs+=("certbot-${module}")
	done

	for dir in "${certbot_dirs[@]}"; do
		S="${WORKDIR}/${P}/${dir}"
		pushd "${S}" > /dev/null || die
		distutils-r1_src_configure
		popd > /dev/null || die
	done

	# Restore S
	S="${S_BACKUP}"
}

src_compile() {
	local S_BACKUP="${S}"

	local certbot_dirs=()
	local base module dir
	for base in "${CERTBOT_BASE[@]}"; do
		certbot_dirs+=("${base}")
	done
	for module in "${CERTBOT_MODULES_EXTRA[@]}"; do
		use "certbot-${module}" \
			&& certbot_dirs+=("certbot-${module}")
	done

	for dir in "${certbot_dirs[@]}"; do
		S="${WORKDIR}/${P}/${dir}"
		pushd "${S}" > /dev/null || die
		distutils-r1_src_compile
		popd > /dev/null || die
	done

	# Restore S
	S="${S_BACKUP}"
}

python_test() {
	local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
	epytest
}

src_test() {
	local S_BACKUP="${S}"

	local certbot_dirs=()
	local base module dir
	for base in "${CERTBOT_BASE[@]}"; do
		certbot_dirs+=("${base}")
	done
	for module in "${CERTBOT_MODULES_EXTRA[@]}"; do
		use "certbot-${module}" \
			&& certbot_dirs+=("certbot-${module}")
	done

	for dir in "${certbot_dirs[@]}"; do
		S="${WORKDIR}/${P}/${dir}"
		pushd "${S}" > /dev/null || die
		distutils-r1_src_test
		popd > /dev/null || die
	done

	# Restore S
	S="${S_BACKUP}"
}

src_install() {
	local S_BACKUP="${S}"

	local certbot_dirs=()
	local base module dir
	for base in "${CERTBOT_BASE[@]}"; do
		certbot_dirs+=("${base}")
	done
	for module in "${CERTBOT_MODULES_EXTRA[@]}"; do
		use "certbot-${module}" \
			&& certbot_dirs+=("certbot-${module}")
	done

	for dir in "${certbot_dirs[@]}"; do
		S="${WORKDIR}/${P}/${dir}"
		pushd "${S}" > /dev/null || die
		distutils-r1_src_install
		popd > /dev/null || die
	done

	# Restore S
	S="${S_BACKUP}"
}