summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-06-29 00:29:24 +0300
committerDevaev Maxim <[email protected]>2018-06-29 00:29:24 +0300
commitb06bf44e3357e245f6d7b7fe7283dd7a1f691d83 (patch)
tree49f4d9f22562f83dd13bf8a6d6ab2e701e0f128b /kvmd
parent9237bb020d098f62877622f4926aef9f5f72153b (diff)
build
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/.bumpversion.cfg15
-rw-r--r--kvmd/MANIFEST.in1
-rw-r--r--kvmd/PKGBUILD43
-rw-r--r--kvmd/kvmd.service6
-rwxr-xr-xkvmd/setup.py51
5 files changed, 113 insertions, 3 deletions
diff --git a/kvmd/.bumpversion.cfg b/kvmd/.bumpversion.cfg
new file mode 100644
index 00000000..0574a99e
--- /dev/null
+++ b/kvmd/.bumpversion.cfg
@@ -0,0 +1,15 @@
+[bumpversion]
+commit = True
+tag = True
+current_version = 0.1
+parse = (?P<major>\d+)\.(?P<minor>\d+)(\-(?P<release>[a-z]+))?)?
+serialize =
+ {major}.{minor}.{patch}
+
+[bumpversion:file:setup.py]
+search = version="{current_version}"
+replace = version="{new_version}"
+
+[bumpversion:file:PKGBUILD]
+search = pkgver="{current_version}"
+replace = pkgver="{new_version}"
diff --git a/kvmd/MANIFEST.in b/kvmd/MANIFEST.in
new file mode 100644
index 00000000..f9bd1455
--- /dev/null
+++ b/kvmd/MANIFEST.in
@@ -0,0 +1 @@
+include requirements.txt
diff --git a/kvmd/PKGBUILD b/kvmd/PKGBUILD
new file mode 100644
index 00000000..c603814a
--- /dev/null
+++ b/kvmd/PKGBUILD
@@ -0,0 +1,43 @@
+# Contributor: Maxim Devaev <[email protected]>
+# Author: Maxim Devaev <[email protected]>
+
+
+pkgname="kvmd"
+pkgver="0.1"
+pkgrel="1"
+pkgdesc="The main Pi-KVM daemon"
+arch=("any")
+url="https://github.com/mdevaev/pi-kvm"
+license=("GPL")
+depends=(
+ "python"
+ "python-yaml"
+ "python-aiohttp"
+ "python-raspberry-gpio"
+)
+backup=("etc/kvmd.yaml")
+makedepends=("python-setuptools" "wget")
+
+
+build() {
+ cd $startdir/src
+ if [ ! -d $pkgname-$pkgver ]; then
+ msg "Downloading tag v$pkgver..."
+ wget $url/archive/v$pkgver.tar.gz
+ tar -xzf v$pkgver.tar.gz
+ fi
+
+ rm -rf $pkgname-build
+ cp -r $pkgname-$pkgver $pkgname-build
+ cd $pkgname-build/kvmd
+
+ python setup.py build
+}
+
+package() {
+ cd $srcdir/$pkgname-build/kvmd
+ python setup.py install --root=$pkgdir
+
+ install -Dm644 kvmd.yaml $pkgdir/etc/kvmd.yaml
+ install -Dm644 kvmd.service "$pkgdir"/usr/lib/systemd/system/nginx.service
+}
diff --git a/kvmd/kvmd.service b/kvmd/kvmd.service
index 40fd6cd9..7b04fc59 100644
--- a/kvmd/kvmd.service
+++ b/kvmd/kvmd.service
@@ -1,5 +1,5 @@
[Unit]
-Description=The main process of Pi-KVM
+Description=The main Pi-KVM daemon
After=network.target network-online.target nss-lookup.target
[Service]
@@ -7,8 +7,8 @@ Type=simple
Restart=always
RestartSec=3
-ExecStart=python -m kvmd --config /etc/kvmd.yaml
-ExecStopPost=python -m kvmd.extras.cleanup --config /etc/kvmd.yaml
+ExecStart=kvmd --config /etc/kvmd.yaml
+ExecStopPost=kvmd-cleanup --config /etc/kvmd.yaml
[Install]
WantedBy=multi-user.target
diff --git a/kvmd/setup.py b/kvmd/setup.py
new file mode 100755
index 00000000..30316b37
--- /dev/null
+++ b/kvmd/setup.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python3
+
+
+from setuptools import setup
+
+
+# =====
+def main() -> None:
+ with open("requirements.txt") as requirements_file:
+ install_requires = list(filter(None, requirements_file.read().splitlines()))
+
+ setup(
+ name="kvmd",
+ version="0.1",
+ url="https://github.com/mdevaev/pi-kvm",
+ license="GPLv3",
+ author="Maxim Devaev",
+ author_email="[email protected]",
+ description="The main Pi-KVM daemon",
+ platforms="any",
+
+ packages=[
+ "kvmd",
+ "kvmd.extras",
+ ],
+
+ entry_points={
+ "console_scripts": [
+ "kvmd = kvmd:main",
+ "kvmd-cleanup = kvmd.extras.cleanup:main",
+ "kvmd-wscli = kvmd.extras.wscli:main",
+ ],
+ },
+
+ install_requires=install_requires,
+
+ classifiers=[
+ "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
+ "Development Status :: 3 - Alpha",
+ "Programming Language :: Python :: 3.6",
+ "Topic :: System :: Systems Administration",
+ "Operating System :: POSIX :: Linux",
+ "Intended Audience :: System Administrators",
+ "Intended Audience :: End Users/Desktop",
+ "Intended Audience :: Telecommunications Industry",
+ ],
+ )
+
+
+if __name__ == "__main__":
+ main()