commit: 53fdb7bf831e33a56d295b44569c588b3d49b442
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri May 2 19:33:39 2025 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri May 2 19:35:00 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53fdb7bf
app-emulation/glean: add 1.24.0, EAPI=8, py3.13, tests
- EAPI=8
- enable py3.13
- enable tests
- use upstream init files installer. Needed to patch it to support ${D}
Closes: https://bugs.gentoo.org/795909
Closes: https://bugs.gentoo.org/952200
Closes: https://bugs.gentoo.org/922164
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
app-emulation/glean/Manifest | 1 +
.../glean-1.24.0-support-gentoo-install.patch | 44 ++++++++++++++++++++++
app-emulation/glean/glean-1.24.0.ebuild | 43 +++++++++++++++++++++
3 files changed, 88 insertions(+)
diff --git a/app-emulation/glean/Manifest b/app-emulation/glean/Manifest
index 3a8cffe9e55b..053a60c0391b 100644
--- a/app-emulation/glean/Manifest
+++ b/app-emulation/glean/Manifest
@@ -1 +1,2 @@
DIST glean-1.23.0.tar.gz 76426 BLAKE2B
bca6d2da0393bb28392d3c9ab7708cf4b053e4736203b9c26bc278a52c6a829abead13ecb63ebb60ade9a4127ebba9dd560b75b765c3a168ea389025b07638a0
SHA512
4eca5ccd18bd7864fdecd35b483e5da6a0854c076d0266f802b70b7838de61790c9237f8928807a45d6845fa8ca9a37e2228653326759204483803b28de191ee
+DIST glean-1.24.0.tar.gz 76586 BLAKE2B
c4a11ef4681ea40cc08136b1365832995c700251afea4ab94c063b294f80b0e9eb183bf0b6ad85a77f38c40d7b4b47e4d1d7c02e06cd6228cc68d3a0a2b37b5d
SHA512
b62b02b6030bf317da192abcc97970a8b11bec531c167d8485e787dcb097fad7c9baa4f33390cf588429d7f71026c652135d64590aa524b6f5c653908e067df8
diff --git
a/app-emulation/glean/files/glean-1.24.0-support-gentoo-install.patch
b/app-emulation/glean/files/glean-1.24.0-support-gentoo-install.patch
new file mode 100644
index 000000000000..65e1ad5b24de
--- /dev/null
+++ b/app-emulation/glean/files/glean-1.24.0-support-gentoo-install.patch
@@ -0,0 +1,44 @@
+diff --git a/glean/install.py b/glean/install.py
+index c6a9db2..e5c33c6 100755
+--- a/glean/install.py
++++ b/glean/install.py
+@@ -69,7 +69,7 @@ def install(source_file, target_file, mode='0755',
replacements=dict()):
+ cmd = ('install -D -g root -o root'
+ ' -m {mode} {source_file} {target_file}').format(
+ source_file=os.path.join(script_dir, source_file),
+- target_file=target_file,
++ target_file=os.environ["D"] + target_file,
+ mode=mode)
+ log.info(cmd)
+ ret = os.system(cmd)
+@@ -81,7 +81,7 @@ def install(source_file, target_file, mode='0755',
replacements=dict()):
+ log.info("Replacing %s -> %s in %s" % (k, v, target_file))
+
+ cmd = 'sed -i "s|%%{k}%%|{v}|g" {target_file}'.format(
+- k=k, v=v, target_file=target_file)
++ k=k, v=v, target_file=os.environ["D"] + target_file)
+ log.info(cmd)
+ ret = os.system(cmd)
+
+@@ -131,9 +131,9 @@ def main():
+ # scripts dir. This means glean shell scripts can call the
+ # sibling python-glean and know that it's using the glean we
+ # installed, even in a virtualenv etc.
+- install('python-glean.template',
+- os.path.join(script_dir, 'python-glean'),
+- mode='0755', replacements=replacements)
++ #install('python-glean.template',
++ # os.path.join(script_dir, 'python-glean'),
++ # mode='0755', replacements=replacements)
+
+ # needs to go first because gentoo can have systemd along side openrc
+ if os.path.exists('/etc/gentoo-release'):
+@@ -177,7 +177,7 @@ def main():
+ mode='0644', replacements=replacements)
+ install(
+ 'glean-udev.rules',
+- '/etc/udev/rules.d/99-glean.rules',
++ '/lib/udev/rules.d/99-glean.rules',
+ mode='0644')
+ if args.use_nm:
+ # NetworkManager has a "after" network-pre, and
diff --git a/app-emulation/glean/glean-1.24.0.ebuild
b/app-emulation/glean/glean-1.24.0.ebuild
new file mode 100644
index 000000000000..d6e58f0b43a2
--- /dev/null
+++ b/app-emulation/glean/glean-1.24.0.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..13} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit edo distutils-r1 pypi udev
+
+DESCRIPTION="Simple program to write static config from config-drive"
+HOMEPAGE="https://opendev.org/opendev/glean"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="dev-python/pbr[${PYTHON_USEDEP}]"
+BDEPEND="${RDEPEND}
+ test? (
+ >=dev-python/testscenarios-0.5.0[${PYTHON_USEDEP}]
+ >=dev-python/testtools-2.3.0[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.24.0-support-gentoo-install.patch
+)
+
+distutils_enable_tests unittest
+
+python_install_all() {
+ distutils-r1_python_install_all
+ edo "${EPYTHON}" "${S}/glean/install.py"
+}
+
+pkg_postinst() {
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}