Bug 280905

Summary: [NEW PORT] net/asterisk20: Latest LTS version of Asterisk PBX software
Product: Ports & Packages Reporter: Oleksandr Kryvulia <o.kryvulia>
Component: Individual Port(s)Assignee: Li-Wen Hsu <lwhsu>
Status: Closed FIXED    
Severity: Affects Only Me CC: herbert, lwhsu, o.kryvulia, pradeep.michchi, vvd
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
net/asterisk20 port
none
net/asterisk20 port v2
none
Update to 20.9.3
none
Update to 20.10.0
none
Fix build with llvm>=15
none
Update to 20.11.0 none

Description Oleksandr Kryvulia 2024-08-18 12:08:40 UTC
Created attachment 252878 [details]
net/asterisk20 port

This is a port of current Asterisk LTS version, based on net/asterisk18 port. Build tested with poudriere-testport(8) on 14.1-RELEASE and 13.3-RELEASE i386/amd64. Work tested on 14.1-RELEASE amd64 as our office PBX. Please note that chan_sip module doesn't build anymore by default in upstream and must be explicitly enabled while port configured.
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2024-08-21 02:43:45 UTC
As this is the latest version of asterisk, perhaps we just call it net/asterisk?
Comment 2 Oleksandr Kryvulia 2024-08-21 05:57:22 UTC
Latest version of Asterisk is 21. Asterisk 20 is a latest version with Long Time Support. However, we had net/asterisk in ports until 2016. Since that all asterisk ports have version in the name.
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-21 20:33:24 UTC
1. PORTVERSION => DISTVERSION.
2. Why most of DESC with "?": "*_DESC?=" ?
3. "USES+=llvm:max=14" did you tested with LLVM from base and it fails (as asterisk18)?
4. Remove GNU_CONFIGURE_MANPREFIX.
Comment 4 Guido Falsi freebsd_committer freebsd_triage 2024-08-22 09:17:05 UTC
Hi,

I stumbled on this by chance. I'd like to share a little insight.

As a former maintainer for asterisk, while I agree I have no right to mandate anything I'd like to suggest to avoid recreating multiple asterisk ports with version numbers in the port, especially if they are going to be maintained by different people.

If this is the new LTS, the main net/asterisk port should be updated to it and if keeping the previous LTS around is deemed really really really important, that one should be moved to a versioned port.

The maintenance burden on asterisk can get important easily, so having multiple versions in the tree is expensive in maintainer/committer workload terms.

Just two cents.

(I did drop asterisk maintainership because I has not been using it anymore for years and still not using it, so I have no horse in this race anymore)
Comment 5 Guido Falsi freebsd_committer freebsd_triage 2024-08-22 09:18:42 UTC
(In reply to Guido Falsi from comment #4)

uhmmm...maybe I replied too early, please ignore my previous post.

If I could I'd remove it! :)

I failed to account for some information.
Comment 6 Oleksandr Kryvulia 2024-08-22 10:15:23 UTC
Created attachment 253009 [details]
net/asterisk20 port v2

(In reply to Vladimir Druzenko from comment #3)
>1. PORTVERSION => DISTVERSION.
>2. Why most of DESC with "?": "*_DESC?=" ?
>3. "USES+=llvm:max=14" did you tested with LLVM from base and it fails (as asterisk18)?
>4. Remove GNU_CONFIGURE_MANPREFIX.
Fixed.
Currently it doesn't build with llvm version>=15. It is a subject for further work, but need some help as I am not a code developer.
Comment 7 Oleksandr Kryvulia 2024-09-23 08:32:19 UTC
Created attachment 253769 [details]
Update to 20.9.3

Update to 20.9.3
Comment 8 pradeep.michchi 2024-10-04 04:16:36 UTC
Hi Guys,

I am willing to make a small financial contribution for this work to the actual coder whoever it is.

Please let me know how I can contribute.
Comment 9 Oleksandr Kryvulia 2024-10-04 17:18:38 UTC
(In reply to pradeep.michchi from comment #8)
Thank you for your proposition.
The work on this port is already sponsored by my company. Now we are looking for a developer who may help us to build this port with llvm15 and greater, but this is not in our preferred todo list. This job I think may be donated. Also if you find this port useful please  vote it for commit in ports tree.
Comment 10 Herbert J. Skuhra 2024-10-27 09:09:18 UTC
OpenBSD and NetBSD already have asterisk 20.10.0 and at least OpenBSD uses clang/llvm 16.0.6. Maybe some of their patches work for FreeBSD? 

How do we vote? Why has this still not landed?
Sometimes I have the impression that it is a total waste of time to post patches here.
Comment 11 Oleksandr Kryvulia 2024-10-30 10:42:25 UTC
Created attachment 254636 [details]
Update to 20.10.0
Comment 12 Oleksandr Kryvulia 2024-10-30 10:43:40 UTC
(In reply to Herbert J. Skuhra from comment #10)
Thanks for the advice, I'll try to take a look
Comment 13 Oleksandr Kryvulia 2024-11-01 10:00:37 UTC
Created attachment 254842 [details]
Fix build with llvm>=15

Build tested on current and 13.3/14.1 i386/amd64
Comment 14 Li-Wen Hsu freebsd_committer freebsd_triage 2024-11-21 04:24:01 UTC
(In reply to Oleksandr Kryvulia from comment #13)
Very sorry for the delay. I did some minor tweaks of the patch, please help checking this commit before pushing to the main branch:

https://github.com/lwhsu/freebsd-ports/commit/3c03aa57c3e52d9cf37a3df5ef8b61a2d41c59c3

Modifications:
- Fixes (some) errors and warnings from portlint, portfmt and portclippy
- Squeeze commits as we're adding a new port
- Use `make makepatch` to regenerate patches fulfill standard.

Finally, please check the email Author filed in Git commit and MAINTAINER field in Makefile, it's different from the submitter of this ticket. Please let us know what's the preferred one. If you're migrating to a new address, we can help you to merge the history. Please register a new account with the new address and comment to confirm with both accounts, then we can merge them.

Thanks for the patch!
Comment 15 Oleksandr Kryvulia 2024-11-22 10:24:35 UTC
(In reply to Li-Wen Hsu from comment #14)
Your commit looks good, thank you for the help.

I created new account with my work email as you suggest.
Comment 16 p5B2EA84B3 2024-11-27 19:17:02 UTC
From https://docs.asterisk.org/About-the-Project/Asterisk-Versions/

18.x 	LTS 	2020-10-20 	2024-10-20 	2025-10-20 	Security Fix Only
19.x 	Standard 	2021-11-02 	2022-11-02 	2023-11-02 	EOL
20.x 	LTS 	2022-10-19 	2026-10-19 	2027-10-19 	Fully Supported
21.x 	Standard 	2023-10-18 	2025-10-18 	2026-10-18 	Fully Supported
22.x 	LTS 	2024-10-16 	2028-10-16 	2029-10-16 	Fully Supported

Consider porting version LTS version Asterisk 22 as this offers two more years "endurance".
Comment 17 Oleksandr Kryvulia 2024-11-27 19:26:15 UTC
Porting of net/asterisk22 is in early progress. But this is a subject for another pr.
Comment 18 Li-Wen Hsu freebsd_committer freebsd_triage 2024-12-16 03:05:11 UTC
(In reply to Oleksandr Kryvulia from comment #15)

Sorry for the delay, so which one do you preferred to use and merged to?

Of course you can keep both, but if you want to use that in the MAINTAINER field, please use it to comment it as approval.
Comment 19 Oleksandr Kryvulia 2024-12-16 12:48:55 UTC
Created attachment 255892 [details]
Update to 20.11.0

This patch is based on work from comment #14 and makes obsolete all previous patches in this bug.
Comment 20 Oleksandr Kryvulia 2024-12-16 12:53:33 UTC
(In reply to Li-Wen Hsu from comment #18)
Please help me to make my new account o.kryvulia@flex-it.com.ua as preferred and merge with old shuriku@shurik.kiev.ua.
Thank you!
Comment 21 commit-hook freebsd_committer freebsd_triage 2024-12-16 18:06:34 UTC
A commit in branch main references this bug:

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

commit b85572488263a0e0b89a98427c4fc26b32109b87
Author:     Oleksandr Kryvulia <o.kryvulia@flex-it.com.ua>
AuthorDate: 2024-12-16 12:25:27 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2024-12-16 18:05:21 +0000

    Add net/asterisk20: LTS version of Asterisk PBX software

    PR:             280905

 net/Makefile                                       |   1 +
 net/asterisk20/Makefile (new)                      | 338 ++++++++++++++++
 net/asterisk20/distinfo (new)                      |   7 +
 net/asterisk20/files/asterisk.in (new)             |  86 +++++
 net/asterisk20/files/patch-Makefile (new)          | 135 +++++++
 net/asterisk20/files/patch-Makefile.rules (new)    |  27 ++
 net/asterisk20/files/patch-agi_Makefile (new)      |  13 +
 ...tch-build__tools_make__xml__documentation (new) |  11 +
 .../files/patch-channels_chan__dahdi.c (new)       |  33 ++
 .../files/patch-channels_sip_include_sip.h (new)   |  11 +
 net/asterisk20/files/patch-configure (new)         |  88 +++++
 net/asterisk20/files/patch-contrib_Makefile (new)  |  23 ++
 net/asterisk20/files/patch-main_Makefile (new)     |  14 +
 net/asterisk20/files/patch-main_lock.c (new)       |  12 +
 net/asterisk20/files/patch-main_term.c (new)       |  10 +
 .../files/patch-menuselect_configure (new)         |  11 +
 .../patch-third-party_pjproject_Makefile (new)     |  30 ++
 ...atch-third-party_pjproject_Makefile.rules (new) |  20 +
 net/asterisk20/pkg-descr (new)                     |   3 +
 net/asterisk20/pkg-message (new)                   |  42 ++
 net/asterisk20/pkg-plist (new)                     | 428 +++++++++++++++++++++
 21 files changed, 1343 insertions(+)
Comment 22 Li-Wen Hsu freebsd_committer freebsd_triage 2024-12-16 18:39:13 UTC
(In reply to Oleksandr Kryvulia from comment #20)
History of shuriku@shurik.kiev.ua has been merged to o.kryvulia@flex-it.com.ua .