summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-04-28 22:05:52 +0300
committerDevaev Maxim <[email protected]>2019-04-28 22:05:52 +0300
commit47641bf914c809f3c575d2caf071132008e19587 (patch)
tree5209b30137b67a4c899ff723572cc79ce8a96846
parente13b5027d6093cbacccf49e9af9c46c0dc1ef374 (diff)
fast entrypoints
-rw-r--r--PKGBUILD1
-rwxr-xr-xsetup.py21
2 files changed, 21 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 0247801c..91a982ed 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -62,7 +62,6 @@ package_kvmd() {
cd "$srcdir/$pkgname-build"
python setup.py install --root="$pkgdir"
- install -Dm755 scripts/* "$pkgdir/usr/bin"
mkdir -p "$pkgdir/usr/lib/systemd/system"
cp configs/os/systemd/*.service "$pkgdir/usr/lib/systemd/system"
diff --git a/setup.py b/setup.py
index 42cc6586..f380d85b 100755
--- a/setup.py
+++ b/setup.py
@@ -21,11 +21,26 @@
# ========================================================================== #
+import os
+import textwrap
+
from setuptools import setup
+from setuptools.command.easy_install import ScriptWriter
# =====
def main() -> None:
+ ScriptWriter.template = textwrap.dedent("""
+ # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
+
+ __requires__ = %(spec)r
+
+ from kvmd.apps.%(name)r import main
+
+ if __name__ == "__main__":
+ main()
+ """).strip()
+
setup(
name="kvmd",
version="0.158",
@@ -53,6 +68,12 @@ def main() -> None:
"kvmd": ["data/*.yaml"],
},
+ scripts=[
+ os.path.join("scripts", name)
+ for name in os.listdir("scripts")
+ if not name.startswith(".")
+ ],
+
entry_points={
"console_scripts": [
"kvmd = kvmd.apps.kvmd:main",