From c3c34d961beecc10b533a5f30156bc8b5c8d184b Mon Sep 17 00:00:00 2001 From: nia Date: Tue, 25 Feb 2025 15:03:25 +0100 Subject: [PATCH 1/4] py-xmm7360: Remove --- net/Makefile | 1 - net/py-xmm7360/DESCR | 6 -- net/py-xmm7360/Makefile | 44 ---------- net/py-xmm7360/PLIST | 5 -- net/py-xmm7360/distinfo | 7 -- .../patches/patch-rpc_open_xdatachannel.py | 80 ------------------- net/py-xmm7360/patches/patch-rpc_rpc.py | 42 ---------- 7 files changed, 185 deletions(-) delete mode 100644 net/py-xmm7360/DESCR delete mode 100644 net/py-xmm7360/Makefile delete mode 100644 net/py-xmm7360/PLIST delete mode 100644 net/py-xmm7360/distinfo delete mode 100644 net/py-xmm7360/patches/patch-rpc_open_xdatachannel.py delete mode 100644 net/py-xmm7360/patches/patch-rpc_rpc.py diff --git a/net/Makefile b/net/Makefile index e1c79e86d82f..5828e71624cc 100644 --- a/net/Makefile +++ b/net/Makefile @@ -815,7 +815,6 @@ SUBDIR+= py-txtorcon SUBDIR+= py-uModbus SUBDIR+= py-unearth SUBDIR+= py-xandikos -SUBDIR+= py-xmm7360 SUBDIR+= py-zeep SUBDIR+= py-zeroconf SUBDIR+= py-zmq diff --git a/net/py-xmm7360/DESCR b/net/py-xmm7360/DESCR deleted file mode 100644 index bc24e58adc55..000000000000 --- a/net/py-xmm7360/DESCR +++ /dev/null @@ -1,6 +0,0 @@ -This package contains tool to connect Intel XMM7360 modem to mobile network. - -It requires the wwanc(4) driver to be present, and device nodes already -created, for details see the manpage. - -open_xdatachannel.py must be run as root. diff --git a/net/py-xmm7360/Makefile b/net/py-xmm7360/Makefile deleted file mode 100644 index 5fd9587f0fe4..000000000000 --- a/net/py-xmm7360/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# $NetBSD: Makefile,v 1.3 2021/12/30 13:05:40 adam Exp $ - -DISTNAME= xmm7360-0.20200727 -PKGNAME= ${PYPKGPREFIX}-${DISTNAME} -CATEGORIES= net python -MASTER_SITES= ${MASTER_SITE_GITHUB:=xmm7360/} -GITHUB_PROJECT= xmm7360-pci -GITHUB_TAG= 0060149958d00b9cec87b73cd610c136f69e5275 - -MAINTAINER= pkgsrc-users@NetBSD.org -HOMEPAGE= https://github.com/xmm7360/xmm7360-pci -COMMENT= Network initialization for L850-GL / Intel XMM7360 driver -LICENSE= modified-bsd - -ONLY_FOR_PLATFORM= NetBSD-*-* OpenBSD-*-* - -USE_LANGUAGES= # none - -DEPENDS+= ${PYPKGPREFIX}-configargparse>=1.2.3:../../devel/py-configargparse - -NO_BUILD= yes -XMM_DIR= ${PYSITELIB}/xmm7360 - -PYTHON_VERSIONS_INCOMPATIBLE= 27 -REPLACE_PYTHON= rpc/open_xdatachannel.py rpc/rpc.py -INSTALLATION_DIRS+= bin ${XMM_DIR} -PY_PATCHPLIST= yes - -do-configure: - # XXX: Blank, but we can't define NO_CONFIGURE and use REPLACE_PYTHON... - -do-install: - ${INSTALL_SCRIPT} ${WRKSRC}/rpc/rpc.py \ - ${DESTDIR}${PREFIX}/${XMM_DIR}/ - ${INSTALL_SCRIPT} ${WRKSRC}/rpc/rpc_call_ids.py \ - ${DESTDIR}${PREFIX}/${XMM_DIR}/ - ${INSTALL_SCRIPT} ${WRKSRC}/rpc/rpc_unsol_table.py \ - ${DESTDIR}${PREFIX}/${XMM_DIR}/ - ${INSTALL_SCRIPT} ${WRKSRC}/rpc/open_xdatachannel.py \ - ${DESTDIR}${PREFIX}/bin/open_xdatachannel.py - -.include "../../lang/python/application.mk" -.include "../../lang/python/extension.mk" -.include "../../mk/bsd.pkg.mk" diff --git a/net/py-xmm7360/PLIST b/net/py-xmm7360/PLIST deleted file mode 100644 index cf950a92b17e..000000000000 --- a/net/py-xmm7360/PLIST +++ /dev/null @@ -1,5 +0,0 @@ -@comment $NetBSD: PLIST,v 1.1 2020/07/27 14:11:16 jdolecek Exp $ -bin/open_xdatachannel.py -${PYSITELIB}/xmm7360/rpc.py -${PYSITELIB}/xmm7360/rpc_call_ids.py -${PYSITELIB}/xmm7360/rpc_unsol_table.py diff --git a/net/py-xmm7360/distinfo b/net/py-xmm7360/distinfo deleted file mode 100644 index a26bbe9a111e..000000000000 --- a/net/py-xmm7360/distinfo +++ /dev/null @@ -1,7 +0,0 @@ -$NetBSD: distinfo,v 1.3 2021/10/26 11:06:46 nia Exp $ - -BLAKE2s (xmm7360-0.20200727-0060149958d00b9cec87b73cd610c136f69e5275.tar.gz) = 99fad3ddd2a4787888a341b75383518001c5f9faf1f65900fa25f32b7bb01ae2 -SHA512 (xmm7360-0.20200727-0060149958d00b9cec87b73cd610c136f69e5275.tar.gz) = d732a536d02dc68e6768e5687db74ac544b62c5ab57d25b8a7fa1270c2f38a855aa707c69f82a64ad08c87badc50837364deb1563b70da9aa74ef9f56d3cf547 -Size (xmm7360-0.20200727-0060149958d00b9cec87b73cd610c136f69e5275.tar.gz) = 24345 bytes -SHA1 (patch-rpc_open_xdatachannel.py) = ba4c07aa4028716aea5d7b259c07afbda888dde0 -SHA1 (patch-rpc_rpc.py) = 17a614d4d9bc03d8d8f3b09f83d2eddfed7c5281 diff --git a/net/py-xmm7360/patches/patch-rpc_open_xdatachannel.py b/net/py-xmm7360/patches/patch-rpc_open_xdatachannel.py deleted file mode 100644 index db49b39fec67..000000000000 --- a/net/py-xmm7360/patches/patch-rpc_open_xdatachannel.py +++ /dev/null @@ -1,80 +0,0 @@ -$NetBSD: patch-rpc_open_xdatachannel.py,v 1.1 2020/07/27 14:11:16 jdolecek Exp $ - ---- rpc/open_xdatachannel.py.orig 2020-01-15 00:30:10.000000000 +0000 -+++ rpc/open_xdatachannel.py -@@ -4,11 +4,18 @@ import logging - # must do this before importing pyroute2 - logging.basicConfig(level=logging.DEBUG) - --import rpc -+from xmm7360 import rpc - import binascii - import time - import sys --from pyroute2 import IPRoute -+import os -+try: -+ from pyroute2 import IPRoute -+ ipr = IPRoute() -+ if not callable(getattr(ipr, 'link_lookup')): -+ ipr = None -+except: -+ ipr = None - - import configargparse - -@@ -29,8 +36,6 @@ cfg = parser.parse_args() - - r = rpc.XMMRPC() - --ipr = IPRoute() -- - r.execute('UtaMsSmsInit') - r.execute('UtaMsCbsInit') - r.execute('UtaMsNetOpen') -@@ -72,26 +77,30 @@ logging.info("DNS server(s): " + ', '.jo - - # For some reason, on IPv6 networks, the GetNegIpAddrReq call returns 8 bytes of the IPv6 address followed by our 4 byte IPv4 address. - # use the last nonzero IP -+ip_addr = None - for addr in ip_values[::-1]: - if addr.compressed != '0.0.0.0': - ip_addr = addr.compressed - break - --idx = ipr.link_lookup(ifname='wwan0')[0] -- --ipr.flush_addr(index=idx) --ipr.link('set', -- index=idx, -- state='up') --ipr.addr('add', -- index=idx, -- address=ip_addr) -- --if not cfg.nodefaultroute: -- ipr.route('add', -- dst='default', -- priority=cfg.metric, -- oif=idx) -+if not ip_addr: -+ logging.info('No valid IP address, exiting') -+ sys.exit(1) -+ -+if ipr: -+ idx = ipr.link_lookup(ifname='wwan0')[0] -+ -+ ipr.flush_addr(index=idx) -+ ipr.link('set', index=idx, state='up') -+ ipr.addr('add', index=idx, address=ip_addr) -+ -+ if not cfg.nodefaultroute: -+ ipr.route('add', dst='default', -+ priority=cfg.metric, -+ oif=idx) -+else: -+ os.system('ifconfig wwan0 %s' % (ip_addr)) -+ os.system('route add default -iface %s' % (ip_addr)) - - # Add DNS values to /etc/resolv.conf - if not cfg.noresolv: diff --git a/net/py-xmm7360/patches/patch-rpc_rpc.py b/net/py-xmm7360/patches/patch-rpc_rpc.py deleted file mode 100644 index 26b31f1856b0..000000000000 --- a/net/py-xmm7360/patches/patch-rpc_rpc.py +++ /dev/null @@ -1,42 +0,0 @@ -$NetBSD: patch-rpc_rpc.py,v 1.1 2020/07/27 14:11:16 jdolecek Exp $ - ---- rpc/rpc.py.orig 2020-01-15 00:30:10.000000000 +0000 -+++ rpc/rpc.py -@@ -7,8 +7,8 @@ import struct - import itertools - import ipaddress - import hashlib --import rpc_call_ids --import rpc_unsol_table -+from .rpc_call_ids import call_ids -+from .rpc_unsol_table import xmm7360_unsol - - def asn_int4(val): - return b'\x02\x04' + struct.pack('>L', val) -@@ -29,7 +29,7 @@ class XMMRPC(object): - desc = resp['type'] - - if resp['type'] == 'unsolicited': -- name = rpc_unsol_table.xmm7360_unsol.get(resp['code'], '0x%02x' % resp['code']) -+ name = xmm7360_unsol.get(resp['code'], '0x%02x' % resp['code']) - desc = 'unsolicited: %s' % name - self.handle_unsolicited(resp) - -@@ -107,7 +107,7 @@ class XMMRPC(object): - return {'tid': txid, 'type': t, 'code': code, 'body': body, 'content': content} - - def handle_unsolicited(self, message): -- name = rpc_unsol_table.xmm7360_unsol.get(message['code'], None) -+ name = xmm7360_unsol.get(message['code'], None) - - if name == 'UtaMsNetIsAttachAllowedIndCb': - self.attach_allowed = message['content'][2] -@@ -322,7 +322,7 @@ def UtaModeSet(rpc, mode): - while True: - msg = rpc.pump() - # msg['txid'] will be mode_tid as well -- if rpc_unsol_table.xmm7360_unsol.get(msg['code'], None) == 'UtaModeSetRspCb': -+ if xmm7360_unsol.get(msg['code'], None) == 'UtaModeSetRspCb': - if msg['content'][0] != mode: - raise IOError("UtaModeSet was not able to set mode. FCC lock enabled?") - return From f4fd7ecee0b2f02e8403a6a53f3d091ef91e7dcf Mon Sep 17 00:00:00 2001 From: nia Date: Tue, 25 Feb 2025 15:12:04 +0100 Subject: [PATCH 2/4] py-simpletal: Remove. --- www/Makefile | 1 - www/py-simpletal/DESCR | 4 ---- www/py-simpletal/Makefile | 22 ---------------------- www/py-simpletal/PLIST | 26 -------------------------- www/py-simpletal/distinfo | 5 ----- 5 files changed, 58 deletions(-) delete mode 100644 www/py-simpletal/DESCR delete mode 100644 www/py-simpletal/Makefile delete mode 100644 www/py-simpletal/PLIST delete mode 100644 www/py-simpletal/distinfo diff --git a/www/Makefile b/www/Makefile index 2d913826f2b1..02532e3fc499 100644 --- a/www/Makefile +++ b/www/Makefile @@ -904,7 +904,6 @@ SUBDIR+= py-scgi SUBDIR+= py-scrapy SUBDIR+= py-selenium SUBDIR+= py-sigal -SUBDIR+= py-simpletal SUBDIR+= py-soupsieve SUBDIR+= py-sparqlwrapper SUBDIR+= py-starlette diff --git a/www/py-simpletal/DESCR b/www/py-simpletal/DESCR deleted file mode 100644 index f6e839633c72..000000000000 --- a/www/py-simpletal/DESCR +++ /dev/null @@ -1,4 +0,0 @@ -SimpleTAL is a stand alone Python implementation of the TAL, TALES and -METAL specifications used in Zope to power HTML and XML -templates. SimpleTAL is an independent implementation of TAL; there are no -dependencies on Zope nor is any of the Zope work re-used. diff --git a/www/py-simpletal/Makefile b/www/py-simpletal/Makefile deleted file mode 100644 index 2416ebac03be..000000000000 --- a/www/py-simpletal/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# $NetBSD: Makefile,v 1.15 2022/01/10 18:22:46 wiz Exp $ - -DISTNAME= SimpleTAL-4.1 -PKGNAME= ${PYPKGPREFIX}-${DISTNAME} -PKGREVISION= 2 -CATEGORIES= www -MASTER_SITES= http://www.owlfish.com/software/simpleTAL/downloads/ - -MAINTAINER= pkgsrc-users@NetBSD.org -HOMEPAGE= https://www.owlfish.com/software/simpleTAL/ -COMMENT= Stand alone implementation of the Zope TAL -LICENSE= modified-bsd - -USE_LANGUAGES= #none - -PYTHON_VERSIONS_ACCEPTED= 27 - -do-test: - ${PYTHONBIN} ${WRKSRC}/runtests.py - -.include "../../lang/python/egg.mk" -.include "../../mk/bsd.pkg.mk" diff --git a/www/py-simpletal/PLIST b/www/py-simpletal/PLIST deleted file mode 100644 index d717fa421f0a..000000000000 --- a/www/py-simpletal/PLIST +++ /dev/null @@ -1,26 +0,0 @@ -@comment $NetBSD: PLIST,v 1.6 2022/01/14 17:52:06 wiz Exp $ -${PYSITELIB}/${EGG_INFODIR} -${PYSITELIB}/simpletal/DummyLogger.py -${PYSITELIB}/simpletal/DummyLogger.pyc -${PYSITELIB}/simpletal/DummyLogger.pyo -${PYSITELIB}/simpletal/FixedHTMLParser.py -${PYSITELIB}/simpletal/FixedHTMLParser.pyc -${PYSITELIB}/simpletal/FixedHTMLParser.pyo -${PYSITELIB}/simpletal/__init__.py -${PYSITELIB}/simpletal/__init__.pyc -${PYSITELIB}/simpletal/__init__.pyo -${PYSITELIB}/simpletal/sgmlentitynames.py -${PYSITELIB}/simpletal/sgmlentitynames.pyc -${PYSITELIB}/simpletal/sgmlentitynames.pyo -${PYSITELIB}/simpletal/simpleElementTree.py -${PYSITELIB}/simpletal/simpleElementTree.pyc -${PYSITELIB}/simpletal/simpleElementTree.pyo -${PYSITELIB}/simpletal/simpleTAL.py -${PYSITELIB}/simpletal/simpleTAL.pyc -${PYSITELIB}/simpletal/simpleTAL.pyo -${PYSITELIB}/simpletal/simpleTALES.py -${PYSITELIB}/simpletal/simpleTALES.pyc -${PYSITELIB}/simpletal/simpleTALES.pyo -${PYSITELIB}/simpletal/simpleTALUtils.py -${PYSITELIB}/simpletal/simpleTALUtils.pyc -${PYSITELIB}/simpletal/simpleTALUtils.pyo diff --git a/www/py-simpletal/distinfo b/www/py-simpletal/distinfo deleted file mode 100644 index 8a8b574ab1d4..000000000000 --- a/www/py-simpletal/distinfo +++ /dev/null @@ -1,5 +0,0 @@ -$NetBSD: distinfo,v 1.4 2021/10/26 11:30:48 nia Exp $ - -BLAKE2s (SimpleTAL-4.1.tar.gz) = c4cf977f124b2458f68c1166ce66a1ae4f98d6fff0eb5849277e0df07c85def8 -SHA512 (SimpleTAL-4.1.tar.gz) = 30e86a80fa51832f94be833f211884597418564cf03430d51cbe10cf87e853bfa1aef4464ec7d436d6b5eaba3e9db7c1fdbd282251f8871ef673cd2d8ca4d2dd -Size (SimpleTAL-4.1.tar.gz) = 95813 bytes From 5c01f268c76b6d182cece7acfaabb664d16c017b Mon Sep 17 00:00:00 2001 From: nia Date: Tue, 25 Feb 2025 15:17:36 +0100 Subject: [PATCH 3/4] py-cx_Oracle: Remove. --- databases/Makefile | 1 - databases/py-cx_Oracle/DESCR | 1 - databases/py-cx_Oracle/Makefile | 31 ------------------------------- databases/py-cx_Oracle/PLIST | 6 ------ databases/py-cx_Oracle/distinfo | 5 ----- www/py-django/MESSAGE | 1 - www/py-django3/MESSAGE | 1 - www/py-django4/MESSAGE | 1 - 8 files changed, 47 deletions(-) delete mode 100644 databases/py-cx_Oracle/DESCR delete mode 100644 databases/py-cx_Oracle/Makefile delete mode 100644 databases/py-cx_Oracle/PLIST delete mode 100644 databases/py-cx_Oracle/distinfo diff --git a/databases/Makefile b/databases/Makefile index 7ae7ba632deb..c1cef3c0f51f 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -368,7 +368,6 @@ SUBDIR+= py-cassa SUBDIR+= py-cassandra-driver SUBDIR+= py-cdb SUBDIR+= py-ckanclient -SUBDIR+= py-cx_Oracle SUBDIR+= py-datapkg SUBDIR+= py-dbf SUBDIR+= py-dbfread diff --git a/databases/py-cx_Oracle/DESCR b/databases/py-cx_Oracle/DESCR deleted file mode 100644 index c9b3aea77af0..000000000000 --- a/databases/py-cx_Oracle/DESCR +++ /dev/null @@ -1 +0,0 @@ -Oracle binding for Python diff --git a/databases/py-cx_Oracle/Makefile b/databases/py-cx_Oracle/Makefile deleted file mode 100644 index 4a7b5c7c95e1..000000000000 --- a/databases/py-cx_Oracle/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -# $NetBSD: Makefile,v 1.8 2022/11/09 13:14:07 joerg Exp $ -# - -DISTNAME= cx_Oracle-5.0.2 -PKGNAME= ${PYPKGPREFIX}-${DISTNAME} -PKGREVISION= 1 -CATEGORIES= www python -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=cx-oracle/} - -MAINTAINER= pkgsrc-users@NetBSD.org -HOMEPAGE= http://cx-oracle.sourceforge.net/ -COMMENT= Oracle binding for Python - -PYDISTUTILSPKG= yes - -.include "../../mk/bsd.prefs.mk" - -.if !defined(ORACLE_HOME) -PKG_FAIL_REASON+= "You must set ORACLE_HOME to the location of your Oracle installation" -.elif !exists(${ORACLE_HOME}) -PKG_FAIL_REASON+= "The location of ORACLE_HOME does not exist" -.endif - -BUILDLINK_PASSTHRU_DIRS+= ${ORACLE_HOME} -BUILDLINK_PASSTHRU_RPATHDIRS+= ${ORACLE_HOME} -LDFLAGS+= -Wl,-rpath,${ORACLE_HOME}/lib - -ALL_ENV+= ORACLE_HOME=${ORACLE_HOME:Q} - -.include "../../lang/python/egg.mk" -.include "../../mk/bsd.pkg.mk" diff --git a/databases/py-cx_Oracle/PLIST b/databases/py-cx_Oracle/PLIST deleted file mode 100644 index 9e0bb5865005..000000000000 --- a/databases/py-cx_Oracle/PLIST +++ /dev/null @@ -1,6 +0,0 @@ -@comment $NetBSD: PLIST,v 1.1.1.1 2010/02/11 13:13:24 joerg Exp $ -${PYSITELIB}/${EGG_INFODIR}/PKG-INFO -${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt -${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt -${PYSITELIB}/${EGG_INFODIR}/top_level.txt -${PYSITELIB}/cx_Oracle.so diff --git a/databases/py-cx_Oracle/distinfo b/databases/py-cx_Oracle/distinfo deleted file mode 100644 index b8d8e3c99923..000000000000 --- a/databases/py-cx_Oracle/distinfo +++ /dev/null @@ -1,5 +0,0 @@ -$NetBSD: distinfo,v 1.4 2021/10/26 10:09:50 nia Exp $ - -BLAKE2s (cx_Oracle-5.0.2.tar.gz) = 553f8071d576fd2aa40495e25e4bda9362bb260554acb3a2ea3fa6617a706317 -SHA512 (cx_Oracle-5.0.2.tar.gz) = 9d12414f2f37b122cf3c3865668b06f0524e643774d9fb8dfba905bacbfaaeaebedf05630ef45556d3945acee1c63fb665d38eb31634979720f29273070fc3ae -Size (cx_Oracle-5.0.2.tar.gz) = 183536 bytes diff --git a/www/py-django/MESSAGE b/www/py-django/MESSAGE index c3ca6c1f78a1..29535ca863a8 100644 --- a/www/py-django/MESSAGE +++ b/www/py-django/MESSAGE @@ -6,5 +6,4 @@ Django also requires a database backend. For PostgreSQL, install databases/py-psycopg2 package. For MySQL/MariaDB, install databases/py-mysqlclient or databases/py-mysql-connector package. -For Oracle, install databases/py-cx_Oracle package. =========================================================================== diff --git a/www/py-django3/MESSAGE b/www/py-django3/MESSAGE index c6e28a64af82..db4f767acb08 100644 --- a/www/py-django3/MESSAGE +++ b/www/py-django3/MESSAGE @@ -6,5 +6,4 @@ Django also requires a database backend. For PostgreSQL, install databases/py-psycopg2 package. For MySQL/MariaDB, install databases/py-mysqlclient or databases/py-mysql-connector package. -For Oracle, install databases/py-cx_Oracle package. =========================================================================== diff --git a/www/py-django4/MESSAGE b/www/py-django4/MESSAGE index 906923987f96..44989b8495b5 100644 --- a/www/py-django4/MESSAGE +++ b/www/py-django4/MESSAGE @@ -6,5 +6,4 @@ Django also requires a database backend. For PostgreSQL, install databases/py-psycopg2 package. For MySQL/MariaDB, install databases/py-mysqlclient or databases/py-mysql-connector package. -For Oracle, install databases/py-cx_Oracle package. =========================================================================== From 31317c6660ec92aae40ff913b8e8b9d84cc0ef8d Mon Sep 17 00:00:00 2001 From: nia Date: Tue, 25 Feb 2025 15:27:01 +0100 Subject: [PATCH 4/4] Revert "py-xmm7360: Remove" This reverts commit c3c34d961beecc10b533a5f30156bc8b5c8d184b. --- net/Makefile | 1 + net/py-xmm7360/DESCR | 6 ++ net/py-xmm7360/Makefile | 44 ++++++++++ net/py-xmm7360/PLIST | 5 ++ net/py-xmm7360/distinfo | 7 ++ .../patches/patch-rpc_open_xdatachannel.py | 80 +++++++++++++++++++ net/py-xmm7360/patches/patch-rpc_rpc.py | 42 ++++++++++ 7 files changed, 185 insertions(+) create mode 100644 net/py-xmm7360/DESCR create mode 100644 net/py-xmm7360/Makefile create mode 100644 net/py-xmm7360/PLIST create mode 100644 net/py-xmm7360/distinfo create mode 100644 net/py-xmm7360/patches/patch-rpc_open_xdatachannel.py create mode 100644 net/py-xmm7360/patches/patch-rpc_rpc.py diff --git a/net/Makefile b/net/Makefile index 5828e71624cc..e1c79e86d82f 100644 --- a/net/Makefile +++ b/net/Makefile @@ -815,6 +815,7 @@ SUBDIR+= py-txtorcon SUBDIR+= py-uModbus SUBDIR+= py-unearth SUBDIR+= py-xandikos +SUBDIR+= py-xmm7360 SUBDIR+= py-zeep SUBDIR+= py-zeroconf SUBDIR+= py-zmq diff --git a/net/py-xmm7360/DESCR b/net/py-xmm7360/DESCR new file mode 100644 index 000000000000..bc24e58adc55 --- /dev/null +++ b/net/py-xmm7360/DESCR @@ -0,0 +1,6 @@ +This package contains tool to connect Intel XMM7360 modem to mobile network. + +It requires the wwanc(4) driver to be present, and device nodes already +created, for details see the manpage. + +open_xdatachannel.py must be run as root. diff --git a/net/py-xmm7360/Makefile b/net/py-xmm7360/Makefile new file mode 100644 index 000000000000..5fd9587f0fe4 --- /dev/null +++ b/net/py-xmm7360/Makefile @@ -0,0 +1,44 @@ +# $NetBSD: Makefile,v 1.3 2021/12/30 13:05:40 adam Exp $ + +DISTNAME= xmm7360-0.20200727 +PKGNAME= ${PYPKGPREFIX}-${DISTNAME} +CATEGORIES= net python +MASTER_SITES= ${MASTER_SITE_GITHUB:=xmm7360/} +GITHUB_PROJECT= xmm7360-pci +GITHUB_TAG= 0060149958d00b9cec87b73cd610c136f69e5275 + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= https://github.com/xmm7360/xmm7360-pci +COMMENT= Network initialization for L850-GL / Intel XMM7360 driver +LICENSE= modified-bsd + +ONLY_FOR_PLATFORM= NetBSD-*-* OpenBSD-*-* + +USE_LANGUAGES= # none + +DEPENDS+= ${PYPKGPREFIX}-configargparse>=1.2.3:../../devel/py-configargparse + +NO_BUILD= yes +XMM_DIR= ${PYSITELIB}/xmm7360 + +PYTHON_VERSIONS_INCOMPATIBLE= 27 +REPLACE_PYTHON= rpc/open_xdatachannel.py rpc/rpc.py +INSTALLATION_DIRS+= bin ${XMM_DIR} +PY_PATCHPLIST= yes + +do-configure: + # XXX: Blank, but we can't define NO_CONFIGURE and use REPLACE_PYTHON... + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/rpc/rpc.py \ + ${DESTDIR}${PREFIX}/${XMM_DIR}/ + ${INSTALL_SCRIPT} ${WRKSRC}/rpc/rpc_call_ids.py \ + ${DESTDIR}${PREFIX}/${XMM_DIR}/ + ${INSTALL_SCRIPT} ${WRKSRC}/rpc/rpc_unsol_table.py \ + ${DESTDIR}${PREFIX}/${XMM_DIR}/ + ${INSTALL_SCRIPT} ${WRKSRC}/rpc/open_xdatachannel.py \ + ${DESTDIR}${PREFIX}/bin/open_xdatachannel.py + +.include "../../lang/python/application.mk" +.include "../../lang/python/extension.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/net/py-xmm7360/PLIST b/net/py-xmm7360/PLIST new file mode 100644 index 000000000000..cf950a92b17e --- /dev/null +++ b/net/py-xmm7360/PLIST @@ -0,0 +1,5 @@ +@comment $NetBSD: PLIST,v 1.1 2020/07/27 14:11:16 jdolecek Exp $ +bin/open_xdatachannel.py +${PYSITELIB}/xmm7360/rpc.py +${PYSITELIB}/xmm7360/rpc_call_ids.py +${PYSITELIB}/xmm7360/rpc_unsol_table.py diff --git a/net/py-xmm7360/distinfo b/net/py-xmm7360/distinfo new file mode 100644 index 000000000000..a26bbe9a111e --- /dev/null +++ b/net/py-xmm7360/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.3 2021/10/26 11:06:46 nia Exp $ + +BLAKE2s (xmm7360-0.20200727-0060149958d00b9cec87b73cd610c136f69e5275.tar.gz) = 99fad3ddd2a4787888a341b75383518001c5f9faf1f65900fa25f32b7bb01ae2 +SHA512 (xmm7360-0.20200727-0060149958d00b9cec87b73cd610c136f69e5275.tar.gz) = d732a536d02dc68e6768e5687db74ac544b62c5ab57d25b8a7fa1270c2f38a855aa707c69f82a64ad08c87badc50837364deb1563b70da9aa74ef9f56d3cf547 +Size (xmm7360-0.20200727-0060149958d00b9cec87b73cd610c136f69e5275.tar.gz) = 24345 bytes +SHA1 (patch-rpc_open_xdatachannel.py) = ba4c07aa4028716aea5d7b259c07afbda888dde0 +SHA1 (patch-rpc_rpc.py) = 17a614d4d9bc03d8d8f3b09f83d2eddfed7c5281 diff --git a/net/py-xmm7360/patches/patch-rpc_open_xdatachannel.py b/net/py-xmm7360/patches/patch-rpc_open_xdatachannel.py new file mode 100644 index 000000000000..db49b39fec67 --- /dev/null +++ b/net/py-xmm7360/patches/patch-rpc_open_xdatachannel.py @@ -0,0 +1,80 @@ +$NetBSD: patch-rpc_open_xdatachannel.py,v 1.1 2020/07/27 14:11:16 jdolecek Exp $ + +--- rpc/open_xdatachannel.py.orig 2020-01-15 00:30:10.000000000 +0000 ++++ rpc/open_xdatachannel.py +@@ -4,11 +4,18 @@ import logging + # must do this before importing pyroute2 + logging.basicConfig(level=logging.DEBUG) + +-import rpc ++from xmm7360 import rpc + import binascii + import time + import sys +-from pyroute2 import IPRoute ++import os ++try: ++ from pyroute2 import IPRoute ++ ipr = IPRoute() ++ if not callable(getattr(ipr, 'link_lookup')): ++ ipr = None ++except: ++ ipr = None + + import configargparse + +@@ -29,8 +36,6 @@ cfg = parser.parse_args() + + r = rpc.XMMRPC() + +-ipr = IPRoute() +- + r.execute('UtaMsSmsInit') + r.execute('UtaMsCbsInit') + r.execute('UtaMsNetOpen') +@@ -72,26 +77,30 @@ logging.info("DNS server(s): " + ', '.jo + + # For some reason, on IPv6 networks, the GetNegIpAddrReq call returns 8 bytes of the IPv6 address followed by our 4 byte IPv4 address. + # use the last nonzero IP ++ip_addr = None + for addr in ip_values[::-1]: + if addr.compressed != '0.0.0.0': + ip_addr = addr.compressed + break + +-idx = ipr.link_lookup(ifname='wwan0')[0] +- +-ipr.flush_addr(index=idx) +-ipr.link('set', +- index=idx, +- state='up') +-ipr.addr('add', +- index=idx, +- address=ip_addr) +- +-if not cfg.nodefaultroute: +- ipr.route('add', +- dst='default', +- priority=cfg.metric, +- oif=idx) ++if not ip_addr: ++ logging.info('No valid IP address, exiting') ++ sys.exit(1) ++ ++if ipr: ++ idx = ipr.link_lookup(ifname='wwan0')[0] ++ ++ ipr.flush_addr(index=idx) ++ ipr.link('set', index=idx, state='up') ++ ipr.addr('add', index=idx, address=ip_addr) ++ ++ if not cfg.nodefaultroute: ++ ipr.route('add', dst='default', ++ priority=cfg.metric, ++ oif=idx) ++else: ++ os.system('ifconfig wwan0 %s' % (ip_addr)) ++ os.system('route add default -iface %s' % (ip_addr)) + + # Add DNS values to /etc/resolv.conf + if not cfg.noresolv: diff --git a/net/py-xmm7360/patches/patch-rpc_rpc.py b/net/py-xmm7360/patches/patch-rpc_rpc.py new file mode 100644 index 000000000000..26b31f1856b0 --- /dev/null +++ b/net/py-xmm7360/patches/patch-rpc_rpc.py @@ -0,0 +1,42 @@ +$NetBSD: patch-rpc_rpc.py,v 1.1 2020/07/27 14:11:16 jdolecek Exp $ + +--- rpc/rpc.py.orig 2020-01-15 00:30:10.000000000 +0000 ++++ rpc/rpc.py +@@ -7,8 +7,8 @@ import struct + import itertools + import ipaddress + import hashlib +-import rpc_call_ids +-import rpc_unsol_table ++from .rpc_call_ids import call_ids ++from .rpc_unsol_table import xmm7360_unsol + + def asn_int4(val): + return b'\x02\x04' + struct.pack('>L', val) +@@ -29,7 +29,7 @@ class XMMRPC(object): + desc = resp['type'] + + if resp['type'] == 'unsolicited': +- name = rpc_unsol_table.xmm7360_unsol.get(resp['code'], '0x%02x' % resp['code']) ++ name = xmm7360_unsol.get(resp['code'], '0x%02x' % resp['code']) + desc = 'unsolicited: %s' % name + self.handle_unsolicited(resp) + +@@ -107,7 +107,7 @@ class XMMRPC(object): + return {'tid': txid, 'type': t, 'code': code, 'body': body, 'content': content} + + def handle_unsolicited(self, message): +- name = rpc_unsol_table.xmm7360_unsol.get(message['code'], None) ++ name = xmm7360_unsol.get(message['code'], None) + + if name == 'UtaMsNetIsAttachAllowedIndCb': + self.attach_allowed = message['content'][2] +@@ -322,7 +322,7 @@ def UtaModeSet(rpc, mode): + while True: + msg = rpc.pump() + # msg['txid'] will be mode_tid as well +- if rpc_unsol_table.xmm7360_unsol.get(msg['code'], None) == 'UtaModeSetRspCb': ++ if xmm7360_unsol.get(msg['code'], None) == 'UtaModeSetRspCb': + if msg['content'][0] != mode: + raise IOError("UtaModeSet was not able to set mode. FCC lock enabled?") + return