Blame add-back-setup.py-file.patch

313945
From acf3caf7eb28767185e782815f145e373ca03923 Mon Sep 17 00:00:00 2001
313945
From: Daan De Meyer <daan.j.demeyer@gmail.com>
313945
Date: Fri, 8 Sep 2023 10:28:15 +0200
313945
Subject: [PATCH] Add back setup.py file
313945
313945
The pyproject metadata stuff depends on
313945
https://peps.python.org/pep-0621/ for which support is only available
313945
in a recent version of setuptools that isn't available in all distributions
313945
just yet. So let's add back a setup.py file to allow building on older
313945
distributions.
313945
---
313945
 setup.py | 19 +++++++++++++++++++
313945
 1 file changed, 19 insertions(+)
313945
 create mode 100644 setup.py
313945
313945
diff --git a/setup.py b/setup.py
313945
new file mode 100644
313945
index 0000000..077691d
313945
--- /dev/null
313945
+++ b/setup.py
dbe4b7
@@ -0,0 +1,26 @@
313945
+#!/usr/bin/python3
313945
+# SPDX-License-Identifier: LGPL-2.1+
313945
+
313945
+from setuptools import setup, find_packages
dbe4b7
+from pathlib import Path
dbe4b7
+
dbe4b7
+def glob(glob: str) -> list[str]:
dbe4b7
+    return [str(p.relative_to("mkosi/resources")) for p in Path("mkosi/resources").glob(glob) if p.is_file()]
313945
+
313945
+setup(
313945
+    name="mkosi",
1e7f24
+    version="24",
313945
+    description="Build Bespoke OS Images",
313945
+    url="https://github.com/systemd/mkosi",
313945
+    maintainer="mkosi contributors",
313945
+    maintainer_email="systemd-devel@lists.freedesktop.org",
313945
+    license="LGPLv2+",
313945
+    python_requires=">=3.9",
dbe4b7
+    packages = ["mkosi", "mkosi.distributions", "mkosi.initrd", "mkosi.initrd.resources", "mkosi.installer", "mkosi.resources"],
dbe4b7
+    package_data = {
dbe4b7
+        "mkosi.resources": [*glob("repart/**/*"), "mkosi.md", "mkosi.1", *glob("mkosi-initrd/**/*"), *glob("mkosi-tools/**/*")],
dbe4b7
+        "mkosi.initrd": ["mkosi-initrd.md", "mkosi-initrd.1"],
dbe4b7
+    },
313945
+    include_package_data = True,
1e7f24
+    entry_points = { "console_scripts": ["mkosi = mkosi.__main__:main", "mkosi-initrd = mkosi.initrd.__main__:main"] },
313945
+)
313945
-- 
313945
2.41.0
313945