From 40764118789f79f79e943a95b805db4e929ec5d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= <karel.koci@nic.cz>
Date: Wed, 12 Sep 2018 17:18:42 +0200
Subject: Tweak bigclown packages

---
 bigclown-control-tools/Makefile  | 15 +++++++--------
 bigclown-control-tools/files/bch |  9 +++++++++
 2 files changed, 16 insertions(+), 8 deletions(-)
 create mode 100755 bigclown-control-tools/files/bch

(limited to 'bigclown-control-tools')

diff --git a/bigclown-control-tools/Makefile b/bigclown-control-tools/Makefile
index c11aea7..723e29a 100644
--- a/bigclown-control-tools/Makefile
+++ b/bigclown-control-tools/Makefile
@@ -1,14 +1,7 @@
-#
-## Copyright (C) 2016-2017 CZ.NIC z.s.p.o. (http://www.nic.cz/)
-#
-## This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-# #
-#
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bigclown-control-tools
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_SOURCE_URL:=https://github.com/bigclownlabs/bch-control-tool.git
 PKG_MAINTAINER:=Karel Kočí <cynerd@email.cz>
 
@@ -21,7 +14,13 @@ define Package/$(PKG_NAME)
 	DEPENDS:=+python3
 endef
 
+define Py3Package/$(PKG_NAME)/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) ./files/bch $(1)/usr/bin/bch
+endef
+
 define Build/Compile
+	sed -i 's/@@VERSION@@/$(PKG_VERSION)/' "$(PKG_BUILD_DIR)/setup.py"
 	$(call Build/Compile/Py3Mod,,install --prefix="/usr" --root=$(PKG_INSTALL_DIR))
 endef
 
diff --git a/bigclown-control-tools/files/bch b/bigclown-control-tools/files/bch
new file mode 100755
index 0000000..a473b30
--- /dev/null
+++ b/bigclown-control-tools/files/bch
@@ -0,0 +1,9 @@
+#!/usr/bin/python3.6
+import bch
+import sys
+from pkg_resources import load_entry_point
+
+if __name__ == '__main__':
+    sys.exit(
+        load_entry_point('bch', 'console_scripts', 'bch')()
+    )
-- 
cgit v1.2.3