Temat: Dodanie modułu python3-pyinotify do OpenWrt 19.07

Cześć,

Próbuję dodać moduł python3-pyinotify do OpenWrt 19.07 podczas budowania systemu. Aktualizacja feed'ów nie dodaje go do listy dostępnych modułów Python3 (z tego co znalazłem to wchodzi on dopiero na OpenWrt 22.03). Próbowałem wzorować się na Makefile który znalazłem tutaj: https://github.com/openwrt/packages/blo … y/Makefile

Aktualnie treść mojego Makefile który umieściłem w katalogu "package/python3-pyinotify" wygląda tak:

include $(TOPDIR)/rules.mk

PKG_NAME:=python3-pyinotify
PKG_VERSION:=0.9.6
PKG_RELEASE:=1

PYPI_NAME:=pyinotify
PKG_SOURCE:=$(PYPI_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/p/$(PYPI_NAME)
PKG_HASH:=9c998a5d7606ca835065cdabc013ae6c66eb9ea76a00a1e3bc6e0cfe2b4f71f4

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PYPI_NAME)-$(PKG_VERSION)

PKG_BUILD_DEPENDS:=python3

PYTHON_FEED_DIR=$(TOPDIR)/feeds/packages/lang/python

include $(INCLUDE_DIR)/package.mk
include $(PYTHON_FEED_DIR)/python3-package.mk

PYTHON3:=/usr/bin/python3

define Package/python3-pyinotify
  SUBMENU:=Python
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=pyinotify for Python3
  URL:=https://pypi.org/project/pyinotify/
  DEPENDS:=+python3
endef

define Package/python3-pyinotify/description
pyinotify provides Python bindings for the inotify Linux kernel subsystem.
endef

define Build/Compile
    cd $(PKG_BUILD_DIR); $(PYTHON3) setup.py build
endef

define Package/python3-pyinotify/install
    $(info PYTHON3_PKG_DIR=$(PYTHON3_PKG_DIR))
    $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
    $(CP) $(PKG_BUILD_DIR)/python3/pyinotify.py $(1)$(PYTHON3_PKG_DIR)/
endef

$(eval $(call BuildPackage,python3-pyinotify))

Efekt jest taki że mam możliwość zaznaczyć go w menuconfig, obraz buduje się bez błędów, moduł jest potem możliwy do zaimportowania w konsoli Python3, natomiast polecenie pip3 list nie wyświetla go jakby nie było go w systemie. Z tego co wyczytałem to prawdopodobnie brakuje mu *.dist-info  i/lub *.egg-info.

ls /usr/lib/python3.*/site-packages/pyinotify*
/usr/lib/python3.7/site-packages/pyinotify.py 

Na hoście na którym buduję (Ubuntu) w build_dir pojawia się tylko jeden plik pyinotify.py

ls build_dir/target-*/root-*/usr/lib/python3.*/site-packages
ADS1x15                            inotify                            pyserial-3.4-py3.7.egg-info
ADS1x15_ADC-1.2.2-py3.7.egg-info   inotify-0.2.10.dist-info           python_dateutil-2.8.0-py3.7.egg-info
certifi                            inotify-0.2.10-py3.7.egg-info      README.txt
certifi-2019.11.28-py3.7.egg-info  mysqlclient-1.3.14-py3.7.egg-info  requests
chardet                            _mysql.cpython-37.so               requests-2.23.0-py3.7.egg-info
chardet-3.0.4-py3.7.egg-info       MySQLdb                            serial
configobj                          _mysql_exceptions.pyc              setuptools
configobj-5.0.9.dist-info          nose                               setuptools-47.1.0.dist-info
curl                               nose-1.3.7.dist-info               shapely
dateutil                           pcf8574_sg24                       Shapely-1.7.1.dist-info
docutils                           pcf8574_sg24-1.2.2-py3.7.egg-info  Shapely-1.7.1-py3.7.egg-info
docutils-0.14-py3.7.egg-info       pip                                six-1.13.0-py3.7.egg-info
easy_install.pyc                   pip-22.0.4.dist-info               six.pyc
geographiclib                      pkg_resources                      smbus-1.1-py3.7.egg-info
geographiclib-1.50.dist-info       pycurl-7.43.0.3-py3.7.egg-info     smbus2
geographiclib-1.52.dist-info       pycurl.cpython-37.so               smbus2-0.4.2.dist-info
geopy                              pyinotify.py                       smbus.cpython-37.so
geopy-2.0.0.dist-info              pynmea                             urllib3
idna                               pynmea-0.6.0.dist-info             urllib3-1.25.10-py3.7.egg-info
idna-2.9-py3.7.egg-info            pynmea-0.6.0-py3.7.egg-info        validate

Co jeszcze mogę spróbować zrobić żeby dodać ten moduł w pełni?

2

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

To przy okazji ( bo to tego też się tyczy) ,w poradniku kompilacji jest instalacjia python3-distutils , co w najnowszym ubuntu już nie wchodzi , jak dobrze pamiętam, trzeba jak dobrze pamiętam istalować python3-setuptools

3

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

Czy próbowałeś pobrać Makefile od 21.02 z tym pakietem, tak bez zmian wrzucić i spróbować skompilować?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

4

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

MiG25 napisał/a:

To przy okazji ( bo to tego też się tyczy) ,w poradniku kompilacji jest instalacjia python3-distutils , co w najnowszym ubuntu już nie wchodzi , jak dobrze pamiętam, trzeba jak dobrze pamiętam istalować python3-setuptools

Ok, sprawdzę i dodam wieczorem info. Dzięki.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

Cezary napisał/a:

Czy próbowałeś pobrać Makefile od 21.02 z tym pakietem, tak bez zmian wrzucić i spróbować skompilować?

Tak, i wtedy wyrzuca błędy przy kompilacji:

time: package/network/utils/tcpdump/full/compile#0.20#0.09#0.28
make[3]: Entering directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/package/python3-pyinotify'
Makefile:39: WARNING: skipping python3-pyinotify -- package has no install section
Makefile:40: *** Package/python3-pyinotify-src is missing the TITLE field.  Stop.
make[3]: Leaving directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/package/python3-pyinotify'
time: package/python3-pyinotify/compile#0.13#0.03#0.15
make[2]: *** [package/Makefile:113: package/python3-pyinotify/compile] Error 2
make[2]: Leaving directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt'
make[1]: *** [package/Makefile:107: /media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt'
make: *** [/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/include/toplevel.mk:227: world] Błąd 2

6

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

missng the TITLE field


Dodaj mu to TITLE to define Package

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

7

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

Cezary napisał/a:

Dodaj mu to TITLE to define Package

Tam już był TITLE:

define Package/python3-pyinotify
  SUBMENU:=Python
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=Linux filesystem events monitoring
  URL:=https://github.com/seb-m/pyinotify
  DEPENDS:= +python3-light \
  +python3-ctypes \
  +python3-logging
endef

8

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

Wywal linię $(eval $(call BuildPackage,python3-pyinotify-src)) on się o python3-pyinotify-src buntuje.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

9

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

make[3]: Entering directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/package/python3-pyinotify'
Makefile:39: WARNING: skipping python3-pyinotify -- package has no install section
Makefile:21: ../python3-package.mk: No such file or directory
make[3]: *** No rule to make target '../python3-package.mk'.  Stop.
make[3]: Leaving directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/package/python3-pyinotify'
time: package/python3-pyinotify/compile#0.11#0.03#0.14
make[2]: *** [package/Makefile:113: package/python3-pyinotify/compile] Error 2
make[2]: Leaving directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt'
make[1]: *** [package/Makefile:107: /media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt'
make: *** [/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/include/toplevel.mk:227: world] Błąd 2

10

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

../python3-package.mk: No such file or directory

znajdź ten plik i podaj pełną ścieżkę lub zobacz co jest wklepane w innych pakietach od pythona w 19.07

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

11

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

Aktualnie Makefile wygląda tak:

#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=python3-pyinotify
PKG_VERSION:=0.9.6
PKG_RELEASE:=1

PYPI_NAME:=pyinotify
PKG_HASH:=9c998a5d7606ca835065cdabc013ae6c66eb9ea76a00a1e3bc6e0cfe2b4f71f4

PKG_MAINTAINER:=Gerald Kerma <gandalf@gk2.net>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING

PYTHON_FEED_DIR=$(TOPDIR)/feeds/packages/lang/python

include $(PYTHON_FEED_DIR)/pypi.mk
include $(INCLUDE_DIR)/package.mk
include $(PYTHON_FEED_DIR)/python3-package.mk

define Package/python3-pyinotify
  SUBMENU:=Python
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=Linux filesystem events monitoring
  URL:=https://github.com/seb-m/pyinotify
  DEPENDS:= +python3-light \
  +python3-ctypes \
  +python3-logging
endef

define Package/python3-pyinotify/description
  Pyinotify is a Python module for monitoring filesystems changes.
endef

$(eval $(call Py3Package,python3-pyinotify))
$(eval $(call BuildPackage,python3-pyinotify))

I przy kompilacji wybucha w ten sposób:

touch /media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/pyinotify-0.9.6/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f /media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/pyinotify-0.9.6/.built
touch /media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/pyinotify-0.9.6/.built_check
CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -iremap/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/pyinotify-0.9.6:pyinotify-0.9.6 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/include -I/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/include -I/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/usr/include -I/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/include/fortify -I/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/include " CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -iremap/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/pyinotify-0.9.6:pyinotify-0.9.6 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/include -I/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/include -I/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/usr/include -I/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/include/fortify -I/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/include " LDFLAGS="-L/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/lib -L/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/lib -L/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/usr/lib -L/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/lib -znow -zrelro " make -j1 -C /media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/pyinotify-0.9.6/. AR="arm-openwrt-linux-muslgnueabi-gcc-ar" AS="arm-openwrt-linux-muslgnueabi-gcc -c -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -iremap/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/pyinotify-0.9.6:pyinotify-0.9.6 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=arm-openwrt-linux-muslgnueabi-ld NM="arm-openwrt-linux-muslgnueabi-gcc-nm" CC="arm-openwrt-linux-muslgnueabi-gcc" GCC="arm-openwrt-linux-muslgnueabi-gcc" CXX="arm-openwrt-linux-muslgnueabi-g++" RANLIB="arm-openwrt-linux-muslgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-muslgnueabi-strip OBJCOPY=arm-openwrt-linux-muslgnueabi-objcopy OBJDUMP=arm-openwrt-linux-muslgnueabi-objdump SIZE=arm-openwrt-linux-muslgnueabi-size CROSS="arm-openwrt-linux-muslgnueabi-" ARCH="arm" ;
make[4]: Entering directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/pyinotify-0.9.6'
make[4]: *** No targets specified and no makefile found.  Stop.
make[4]: Leaving directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/pyinotify-0.9.6'
make[3]: *** [Makefile:44: /media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/pyinotify-0.9.6/.built] Error 2
make[3]: Leaving directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/package/python3-pyinotify'
time: package/python3-pyinotify/compile#0.22#0.06#0.28
make[2]: *** [package/Makefile:113: package/python3-pyinotify/compile] Error 2
make[2]: Leaving directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt'
make[1]: *** [package/Makefile:107: /media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt'
make: *** [/media/pcx/Dysk_2_Linux/nanopi_neo_openwrt/openwrt/include/toplevel.mk:227: world] Błąd 2

12

Odp: Dodanie modułu python3-pyinotify do OpenWrt 19.07

Teraz to tak jak by w źródłach nie było makefile lub nie wiedział jak go zrobić.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.