From ae20558266bce1816593b54621604b43caaf2e92 Mon Sep 17 00:00:00 2001 From: teldra Date: Tue, 12 Jul 2022 04:47:08 +0200 Subject: [PATCH] New package: asterisk-19.6.0 --- srcpkgs/asterisk/files/asterisk/run | 8 ++++ .../asterisk/patches/20-musl-astmm-fix.patch | 14 +++++++ .../asterisk/patches/40-asterisk-cdefs.patch | 21 ++++++++++ srcpkgs/asterisk/template | 42 +++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 srcpkgs/asterisk/files/asterisk/run create mode 100644 srcpkgs/asterisk/patches/20-musl-astmm-fix.patch create mode 100644 srcpkgs/asterisk/patches/40-asterisk-cdefs.patch create mode 100644 srcpkgs/asterisk/template diff --git a/srcpkgs/asterisk/files/asterisk/run b/srcpkgs/asterisk/files/asterisk/run new file mode 100644 index 000000000000..7095c870ba11 --- /dev/null +++ b/srcpkgs/asterisk/files/asterisk/run @@ -0,0 +1,8 @@ +#!/bin/sh +[ -r ./conf ] && . ./conf + +mkdir -p /var/run/asterisk +chown -R _asterisk:_asterisk /var/run/asterisk + +exec chpst -u _asterisk asterisk -f -i ${OPTS} + diff --git a/srcpkgs/asterisk/patches/20-musl-astmm-fix.patch b/srcpkgs/asterisk/patches/20-musl-astmm-fix.patch new file mode 100644 index 000000000000..e6f9d150e624 --- /dev/null +++ b/srcpkgs/asterisk/patches/20-musl-astmm-fix.patch @@ -0,0 +1,14 @@ +Add include file needed when compiling with musl + +diff --git a/include/asterisk/compat.h b/include/asterisk/compat.h +index 8547283..476dc2a 100644 +--- a/include/asterisk/compat.h ++++ b/include/asterisk/compat.h +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #ifdef HAVE_STDDEF_H + #include diff --git a/srcpkgs/asterisk/patches/40-asterisk-cdefs.patch b/srcpkgs/asterisk/patches/40-asterisk-cdefs.patch new file mode 100644 index 000000000000..6fc850125882 --- /dev/null +++ b/srcpkgs/asterisk/patches/40-asterisk-cdefs.patch @@ -0,0 +1,21 @@ +include depreciated cdefs.h as needed for compilation with alpine + +--- a/main/ast_expr2.c ++++ b/main/ast_expr2.c +@@ -95,6 +95,7 @@ + #include "asterisk.h" + + #include ++#include + #include + + #if defined(STANDALONE) || defined(STANDALONE2) +--- a/utils/db1-ast/include/db.h ++++ b/utils/db1-ast/include/db.h +@@ -37,6 +37,7 @@ + #define _DB_H 1 + + #include ++#include + + #include diff --git a/srcpkgs/asterisk/template b/srcpkgs/asterisk/template new file mode 100644 index 000000000000..fc87d1677dc1 --- /dev/null +++ b/srcpkgs/asterisk/template @@ -0,0 +1,42 @@ +# Template file for 'asterisk' +pkgname=asterisk +version=19.6.0 +revision=1 +build_style=gnu-configure +build_helper=qemu +conf_files="/etc/asterisk/*.conf" +make_dirs="/var/log/asterisk 0755 _asterisk _asterisk + /var/cache/asterisk 0755 _asterisk _asterisk + /var/lib/asterisk 0755 _asterisk _asterisk + /var/spool/asterisk 0755 _asterisk _asterisk" +hostmakedepends="curl tar pkg-config" +makedepends="openssl-devel libedit-devel libuuid-devel jansson-devel + libxml2-devel sqlite-devel speex-devel libvorbis-devel libgsm-devel + alsa-lib-devel libbluetooth-devel libsrtp-devel" +short_desc="Complete PBX solution" +maintainer="teldra " +license="GPL-2.0-only WITH custom:OpenSSL-Exception" +homepage="https://asterisk.org" +changelog="https://downloads.asterisk.org/pub/telephony/asterisk/ChangeLog-19-current" +distfiles="https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${version}.tar.gz" +checksum=4a382d9659f5dde6e654dfd5c7dc1b491ccaa6251577c6c51b94bc09aa8c6572 +python_version=3 +system_accounts="_asterisk" + +do_configure() { + export lt_cv_sys_lib_dlsearch_path_spec="/usr/lib64 /usr/lib32 /usr/lib /lib /usr/local/lib" + vtargetrun ${configure_script} ${configure_args} +} + +do_build() { + vtargetrun make +} + +post_install() { + make DESTDIR="${DESTDIR}" samples + chmod -R 0755 ${DESTDIR}/var/*/asterisk + vsv asterisk + for f in LICENSE COPYING; do + vlicense $f + done +}