Ok, I found in 19.07 branch the package "/openwrt/feeds/packages/lang/python/python-paho-mqtt", it was already added but only for python3. If I take this one as a template for example, where do I have to put it?
Well, I copied it to /openwrt/package/python2-paho-mqtt changed the Makefile slightly according to python2:
include $(TOPDIR)/rules.mk
PKG_NAME:=python2-paho-mqtt
PKG_VERSION:=1.4.0
PKG_RELEASE:=1
PKG_LICENSE:=Eclipse Public License v1.0 / Eclipse Distribution License v1.0
PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>, Alexandru Ardelean <ardeleanalex@gmail.com>
PKG_SOURCE:=paho-mqtt-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/25/63/db25e62979c2a716a74950c9ed658dce431b5cb01fde29eb6cba9489a904
PKG_HASH:=e440a052b46d222e184be3be38676378722072fcd4dfd2c8f509fb861a7b0b79
PKG_BUILD_DIR:=$(BUILD_DIR)/paho-mqtt-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python
include $(INCLUDE_DIR)/package.mk
#include ../python-package.mk
$(call include_mk, python-package.mk)
define Package/python2-paho-mqtt
SECTION:=lang
CATEGORY:=Languages
SUBMENU:=Python
TITLE:=python2-paho-mqtt
URL:=http://eclipse.org/paho
DEPENDS:=+python-light
VARIANT:=python
endef
define Package/python2-paho-mqtt/description
MQTT version 3.1/3.1.1 client class
endef
$(eval $(call PyPackage,python2-paho-mqtt))
$(eval $(call BuildPackage,python2-paho-mqtt))
Found it in "make menuconfig" and selected it. No check errors:
$ make package/python2-paho-mqtt/check
make[1] package/python2-paho-mqtt/check
make[2] -C package/python2-paho-mqtt check
It ends without building the package (Nothing to be done for 'compile'.):
$ make package/python2-paho-mqtt/compile V=sc
...
echo "python-base" >> /home/nic/openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/python.default.install
echo "python-light" >> /home/nic/openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/python.default.install
echo "python" >> /home/nic/openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/python.default.install
make[2]: Leaving directory '/home/nic/openwrt/feeds/packages/lang/python/python'
time: package/feeds/packages/python/compile#0.17#0.05#0.20
make[2]: Entering directory '/home/nic/openwrt/package/python2-paho-mqtt'
make[2]: Nothing to be done for 'compile'.
make[2]: Leaving directory '/home/nic/openwrt/package/python2-paho-mqtt'
time: package/python2-paho-mqtt/python/compile#0.07#0.00#0.07
make[1]: Leaving directory '/home/nic/openwrt'
So whats missing or wrong?
Best regards,
Nic