Bug 253844 - [NEW PORT] net/opensips31
Summary: [NEW PORT] net/opensips31
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Daniel Engberg
Depends on:
Blocks: 222718
  Show dependency treegraph
Reported: 2021-02-25 10:45 UTC by bambyster
Modified: 2021-09-07 09:16 UTC (History)
2 users (show)

See Also:

opensips24 and opensips31 ports (21.70 KB, application/gzip)
2021-02-25 10:45 UTC, bambyster
no flags Details
opensips24 and opensips31 ports (24.37 KB, application/gzip)
2021-03-17 11:45 UTC, bambyster
no flags Details
opensips31 port (41.72 KB, patch)
2021-03-26 10:10 UTC, bambyster
no flags Details | Diff
Patch for opensips31 (WIP) (43.83 KB, patch)
2021-03-27 11:21 UTC, Daniel Engberg
no flags Details | Diff
opensips31 port (43.11 KB, patch)
2021-03-29 13:01 UTC, bambyster
no flags Details | Diff
Patch for opensips31 (43.25 KB, patch)
2021-05-31 20:13 UTC, Daniel Engberg
no flags Details | Diff
opensips-3.1.2 port (41.98 KB, patch)
2021-06-01 11:37 UTC, bambyster
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bambyster 2021-02-25 10:45:28 UTC
Created attachment 222820 [details]
opensips24 and opensips31 ports

Let me offer you two ports for openSIPS for the latest stable releases 2.4.9 and 3.1.1. While opensips-3.1.1 is python 3 compatible as is, however it was necessary to add a patch for opensips-2.4.9/modules/python/Makefile to make sure it is also Python 3 compatible.
Comment 1 bambyster 2021-03-17 11:45:14 UTC
Created attachment 223356 [details]
opensips24 and opensips31 ports

I have a follow up. The python module in opensips-2.4.9 is actually only compatible with Python 2 so I've added necessary patches for it to be compatible with Python 3 too.
Comment 2 Daniel Engberg freebsd_committer 2021-03-17 20:56:38 UTC
Thanks for contributing!

OpenSIPS 2.4.x
https://www.opensips.org/About/AvailableVersions - Supported until: 24th of May 2021

Seems to be a very little to reason to have it in tree for 2 months?

Please attach patches as diff/patch files

A few things I spotted having a quick look

"Table 5.2. Package Naming Examples"

MASTER_SITES: http --> https (redirects to https)

Is it much work to get rid of gtar and ginstall as build deps?

GCC requirement: Just for 11, all versions, specific arch?

Does shebangfix really work on *.php files since it's not set as a dependency and is it a missing dependency?

Can't we reuse MAKE_ENV from framework instead of working around it?

do-configure seems a bit out of place, this should be in post-patch?

do-build can most likely use ports framework, see " Generic Variables Replacement"

"@${ECHO_CMD} "Stripping binaries in"... I understand the idea but we don't do this anywhere else in tree.

Do we need to use a lot of loops for stripping binaries or can this be reduced?

Try to fix as many issues as possible reported by portlint and portfmt
Comment 3 bambyster 2021-03-26 10:10:01 UTC
Created attachment 223605 [details]
opensips31 port

(In reply to daniel.engberg.lists from comment #2)

Thank you for your guidelines!

I agree that there is no reason to add port for opensips24. And I reworked the port for opensip31.

Initially I based my port on the previous now obsolete version of the net/opensips port. It looks like a bug in the Makefile in the opensips itself prevented the maintainer of the port from using MAKE_ENV and forced him to use custom do-build, strip and other extra stuff.

Now with this bug patched I've been able to make the port much more compact and straightforward. I removed dependencies on gtar, ginstall and gcc. I also removed the code which strips binaries.

I've rearranged the variables according to the handbook but portlint still complains about misplaced LIB_DEPENDS and USES.
Comment 4 Daniel Engberg freebsd_committer 2021-03-27 11:20:08 UTC

I made a few changes to your Makefile, mainly minor issue and utilizing the framework a bit more however I didn't test any options.

gettext-runtime (missing dep)
libxml2 --> USES=gnome + USE_GNOME=libxml2
net/xmlrpc-c dep removed, can't find any reference to where it's needed
redis dep removed, is this a runtime dep as it builds fine without?
Is python a run dep or is it used during compilation?
Remove *.php from SHEBANG_GLOB, I couldn't find any files directly calling PHP and/or it didn't work as intended (no shebang at L1)
C/CXX/LDFLAGS --> USES= localbase:ldflags
Moved BUILD_DEPS and LIB_DEPS for options below OPTIONS_ and _DESC

I also did a quick run using Poudriere (12.2) and isn't happy (yet) :-)

There however a few more issues that needs to be addressed

Warning: /usr/ports/net/opensips31/pkg-message not in UCL format, will be shown on initial install only.
Warning: See https://www.freebsd.org/doc/en/books/porters-handbook/pkg-files.html#porting-message
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: %%ETCDIR%%/scenario_callcenter.xml
Error: Orphaned: %%LIBDIR%%/modules/callops.so
Error: Orphaned: %%LIBDIR%%/modules/freeswitch.so
Error: Orphaned: %%LIBDIR%%/modules/freeswitch_scripting.so
Error: Orphaned: %%LIBDIR%%/modules/media_exchange.so
Error: Orphaned: %%LIBDIR%%/modules/proto_smpp.so
Error: Orphaned: %%LIBDIR%%/modules/qrouting.so
Error: Orphaned: %%LIBDIR%%/modules/rate_cacher.so
Error: Orphaned: sbin/osipsconfig
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.auth_jwt
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.callops
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.cgrates
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.compression
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.db_http
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.db_perlvdb
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.event_routing
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.event_stream
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.freeswitch
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.freeswitch_scripting
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.jsonrpc
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.media_exchange
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.mi_html
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.mid_registrar
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.proto_smpp
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.qrouting
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.rabbitmq
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.rabbitmq_consumer
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.rate_cacher
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.sip_i
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.siprec
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.stir_shaken
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.tracer
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.uuid
Error: Orphaned: %%PORTDOCS%%%%DOCSDIR%%/README.xml
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1

Best regards,
Comment 5 Daniel Engberg freebsd_committer 2021-03-27 11:21:00 UTC
Created attachment 223634 [details]
Patch for opensips31 (WIP)

Some additional fixes (WIP)
Comment 6 bambyster 2021-03-29 13:01:47 UTC
Created attachment 223681 [details]
opensips31 port


Thank you very much for your help with the Makefile.

The xmlrpc-c and redis were there in the original port and I never checked if they are really required.

The python is both build and runtime dependency. The python module in opensips is linked against a shared library from the python package.

The pkg-plist and pkg-message issues have been resolved.

Best regards,
Comment 7 Daniel Engberg freebsd_committer 2021-05-31 20:13:03 UTC
Created attachment 225430 [details]
Patch for opensips31

Convert all uses of PORTVERSION to DISTVERSION
Move pkg-message to files/pkg-message.in and add SUB_FILES=

Poudriere testport OK 12.2-RELEASE (amd64) (default options)
Comment 8 Daniel Engberg freebsd_committer 2021-05-31 20:15:50 UTC

It passes! :-)

Meanwhile openSIPS have released 3.1.2, can you please look into bumping it to the latest LTS release?

Best regards,
Comment 9 bambyster 2021-06-01 11:37:43 UTC
Created attachment 225448 [details]
opensips-3.1.2 port


I've included your latest changes and updated the port to use the opensips-3.1.2.

Best regards,
Comment 10 Daniel Engberg freebsd_committer 2021-06-02 21:00:23 UTC
Poudriere testport OK 12.2-RELEASE (amd64) (default options)
Poudriere testport OK 11.4-RELEASE (amd64) (default options)
Comment 11 OlivierW 2021-09-01 11:28:52 UTC

I have been running OpenSIPS 3.1.2 with my patch: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222718 on FreeBSD 13.0 for a few weeks and it works fine :-)
Comment 12 Daniel Engberg freebsd_committer 2021-09-04 21:35:55 UTC
(In reply to OlivierW from comment #11)


We'll first land the initial submission with some changes so you'll need to rebase your patch and then maintainer can have a look at it.

Best regards,
Comment 13 commit-hook freebsd_committer 2021-09-05 18:43:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4e429139a01d479d0d29e0813cb9ac90b63229dd

commit 4e429139a01d479d0d29e0813cb9ac90b63229dd
Author:     Andriy <bambyster@gmail.com>
AuthorDate: 2021-09-05 18:29:35 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2021-09-05 18:42:00 +0000

    net/opensips31: New port: Open SIP Server

    Includes additional changes on top of submitters patch to improve port

    PR:             253844
    Approved by:    arrowd (mentor)
    Differential Revision:  https://reviews.freebsd.org/D31765

 net/Makefile                                       |   1 +
 net/opensips31/Makefile (new)                      | 104 +++
 net/opensips31/distinfo (new)                      |   3 +
 net/opensips31/files/Makefile.conf (new)           | 100 +++
 net/opensips31/files/opensips31.in (new)           |  35 +
 net/opensips31/files/patch-Makefile (new)          |  65 ++
 net/opensips31/files/patch-Makefile.defs (new)     |  21 +
 net/opensips31/files/patch-Makefile.rules (new)    |  11 +
 .../files/patch-modules_aaa__radius_Makefile (new) |  21 +
 .../files/patch-modules_presence_Makefile (new)    |  17 +
 .../patch-modules_presence__dfks_Makefile (new)    |  17 +
 .../patch-modules_presence__xml_Makefile (new)     |  17 +
 .../patch-modules_pua__dialoginfo_Makefile (new)   |  17 +
 .../files/patch-modules_xml_Makefile (new)         |  17 +
 net/opensips31/pkg-descr (new)                     |  12 +
 net/opensips31/pkg-message (new)                   |  23 +
 net/opensips31/pkg-plist (new)                     | 734 +++++++++++++++++++++
 17 files changed, 1215 insertions(+)
Comment 14 Daniel Engberg freebsd_committer 2021-09-05 18:44:10 UTC
Committed, thanks!
Comment 15 OlivierW 2021-09-07 09:16:44 UTC
(In reply to Daniel Engberg from comment #12)

Nice! Thanks for the new port, I'll update my patch.

Best Regards,