summaryrefslogtreecommitdiffstats
path: root/master/vlmcsd
blob: 1aafce6cfa1e8d435ad804190efad3bcadf3c5eb (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
diff --git a/package/jmm/vlmcsd/Makefile b/package/jmm/vlmcsd/Makefile
new file mode 100644
index 0000000..e56d3e2
--- /dev/null
+++ b/package/jmm/vlmcsd/Makefile
@@ -0,0 +1,45 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=vlmcsd
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=https://github.com/kebe7jun/linux-kms-server.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_DATE:=2018-03-30
+PKG_SOURCE_VERSION:=3bddc249d2f0ce257fbf13781cffc06b77c2579a
+PKG_MIRROR_HASH:=0ef8696b7f6fc3259fe8b2b18813a9135b75cae8ef8ad7d309f8d4d66ca4bcdb
+
+PKG_MAINTAINER:=me <meh@meh.meh>
+PKG_LICENSE:=GPL-2.0+
+
+MAKE_PATH:=vlmcsd
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/vlmcsd
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=linux-kms-server
+endef
+
+
+define Build/Compile
+	$(call Build/Compile/Default)
+endef
+
+define Package/vlmcsd/install
+	$(INSTALL_DIR) $(1)/usr/sbin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/${MAKE_PATH}/vlmcsd $(1)/usr/sbin/
+	$(INSTALL_DIR) $(1)/etc/init.d
+	$(INSTALL_BIN) ./files/vlmcsd.init $(1)/etc/init.d/vlmcsd
+endef
+
+$(eval $(call BuildPackage,vlmcsd))
diff --git a/package/jmm/vlmcsd/files/vlmcsd.init b/package/jmm/vlmcsd/files/vlmcsd.init
new file mode 100755
index 0000000..06dba05
--- /dev/null
+++ b/package/jmm/vlmcsd/files/vlmcsd.init
@@ -0,0 +1,30 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2011 OpenWrt.org
+
+START=50
+STOP=50
+
+USE_PROCD=1
+PROG=/usr/sbin/vlmcsd
+
+start_service() {
+	procd_open_instance
+	procd_set_param command $PROG -D -v -l syslog
+	procd_close_instance
+}
+
+shutdown() {
+	local pid
+	local pids
+	local pid_mine
+
+	stop
+
+	# kill active clients
+	pid_mine="$$"
+	pids="$(pidof vlmcsd)"
+	for pid in $pids; do
+		[ "$pid" = "$pid_mine" ] && continue
+		[ -e "/proc/$pid/stat" ] && kill $pid
+	done
+}