diff --git a/Makefile b/Makefile index bf2838664..e62912c47 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ ifeq ($(with_transcoding),yes) $(MAKE) -C recording-daemon $(MAKE) -C perf-tester endif +ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.ngcp-rtpengine.pysip-lite)) + $(MAKE) -C python +endif install: $(MAKE) -C daemon install @@ -51,6 +54,7 @@ distclean clean: $(MAKE) -C kernel-module clean $(MAKE) -C t clean $(MAKE) -C lib clean + $(MAKE) -C python clean rm -f config.mk .DEFAULT: diff --git a/debian/control b/debian/control index 10e984314..ee9fb3579 100644 --- a/debian/control +++ b/debian/control @@ -5,6 +5,7 @@ Homepage: https://www.sipwise.com/ Standards-Version: 4.7.2 Build-Depends: debhelper-compat (= 13), + dh-python, dh-sequence-dkms, default-libmysqlclient-dev, discount, @@ -14,6 +15,7 @@ Build-Depends: libavformat-dev (>= 6:10), libavutil-dev (>= 6:10), libbcg729-dev , + libbellesip-dev , libbencode-perl, libcrypt-openssl-rsa-perl, libcrypt-rijndael-perl, @@ -49,7 +51,9 @@ Build-Depends: ngcp-libcodec-chain-dev (>= 13.3) , pandoc, pkgconf, + pybuild-plugin-pyproject , python3, + python3-hatchling , python3-websockets, systemd-dev | systemd, zlib1g-dev, @@ -166,3 +170,17 @@ Description: helper tool to test rtpengine transcoding performance - data files base and produces performance and load statistics. . These are data files needed for the binary package. + +Package: ngcp-python3-pysip-lite +Architecture: any +Build-Profiles: +Multi-Arch: foreign +Depends: + python3, + ${misc:Depends}, + ${python3:Depends}, + ${shlibs:Depends}, +Description: light-weight SIP module + This module provides a simple SIP framework to implement SIP user agents and + other applications. It only handles SIP and specifically doesn't handle RTP or + media. diff --git a/debian/rules b/debian/rules index 459c279d6..146ef0da8 100755 --- a/debian/rules +++ b/debian/rules @@ -24,7 +24,22 @@ export FIXTURES_PATH = /usr/share/rtpengine-perftest export deb_systemdsystemunitdir := $(shell pkg-config --variable=systemdsystemunitdir systemd) %: - dh $@ + dh $@ --with python3 + +override_dh_auto_build: + dh_auto_build +ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.ngcp-rtpengine.pysip-lite)) + dh_auto_build \ + --buildsystem=pybuild +endif + +override_dh_auto_install: + dh_auto_install +ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.ngcp-rtpengine.pysip-lite)) + dh_auto_install \ + --buildsystem=pybuild \ + --destdir=$(CURDIR)/debian/ngcp-python3-pysip-lite +endif execute_before_dh_auto_configure: (cd debian && sh generate-systemd-templates.sh) diff --git a/pyproject.toml b/pyproject.toml index eb3b35ac9..8ca9679bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,32 @@ +[build-system] +requires = ["hatchling >= 1.26"] +build-backend = "hatchling.build" + +[project] +name = "pysip-simple" +description = "Lightweight SIP framework based on belle-sip" +readme = "python/README.md" +license = "GPL-3.0-or-later" +dynamic = ["version"] +requires-python = ">= 3.13" +dependencies = [ + "aiohttp >= 3.11", +] +authors = [ + {name = "Richard Fuchs", email = "rfuchs@sipwise.com"}, +] +maintainers = [ + {name = "Richard Fuchs", email = "rfuchs@sipwise.com"}, +] + +[tool.hatch.version] +path = "python/pysip_lite/__init__.py" + +[tool.hatch.build.targets.wheel] +packages = ["python/pysip_lite"] +exclude = [".gitignore"] +artifacts = ["python/src/*.so"] + [tool.black] # Match line-length expected by pycodestyle. line-length = 79