From 5bb9ff1ee56d2b5e75e01a7f066d8b0cec84ec02 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 20 Mar 2021 14:27:17 +0000 Subject: gentoo resync : 20.03.2021 --- net-misc/asterisk/Manifest | 18 +- net-misc/asterisk/asterisk-13.38.1-r2.ebuild | 7 +- net-misc/asterisk/asterisk-13.38.2-r1.ebuild | 348 ++++++++++++++++++++ net-misc/asterisk/asterisk-13.38.2.ebuild | 7 +- net-misc/asterisk/asterisk-16.16.2-r1.ebuild | 365 +++++++++++++++++++++ net-misc/asterisk/asterisk-16.16.2.ebuild | 7 +- net-misc/asterisk/asterisk-18.2.2.ebuild | 364 ++++++++++++++++++++ .../asterisk-13.38.2-r1-menuselect-exitcodes.patch | 67 ++++ .../asterisk-16.16.2-no-var-run-install.patch | 2 +- net-misc/asterisk/files/asterisk.tmpfiles3.conf | 2 + net-misc/asterisk/files/confd-16.16.2-r1 | 171 ++++++++++ net-misc/asterisk/files/initd-16.16.2-r1 | 363 ++++++++++++++++++++ net-misc/asterisk/metadata.xml | 7 +- 13 files changed, 1710 insertions(+), 18 deletions(-) create mode 100644 net-misc/asterisk/asterisk-13.38.2-r1.ebuild create mode 100644 net-misc/asterisk/asterisk-16.16.2-r1.ebuild create mode 100644 net-misc/asterisk/asterisk-18.2.2.ebuild create mode 100644 net-misc/asterisk/files/asterisk-13.38.2-r1-menuselect-exitcodes.patch create mode 100644 net-misc/asterisk/files/asterisk.tmpfiles3.conf create mode 100644 net-misc/asterisk/files/confd-16.16.2-r1 create mode 100644 net-misc/asterisk/files/initd-16.16.2-r1 (limited to 'net-misc/asterisk') diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest index a4d0c5c43255..a791fbadfa28 100644 --- a/net-misc/asterisk/Manifest +++ b/net-misc/asterisk/Manifest @@ -2,18 +2,26 @@ AUX 1.6.2/asterisk.logrotate4 848 BLAKE2B b169368ad6893e2fc2680b788569cf8b746575 AUX asterisk-13.18.1-r2-autoconf-2.70.patch 535 BLAKE2B 06f880515f27166a75738bde6e81be1cac961a2ec2eec049cddbbb39b58d350f37a4feb49e86157d6dd5e80abaf251cf6b122ec094e0109c1f20f3e9b0f65c29 SHA512 77d1bb1be97fe5b8df78a8b21173c0d12a91f9a543404d73e4f4af2080a0b4edb87b3ccd36b1935f4fbd2a0bb44e971d303eba774e648c48c2a453c8e42838a7 AUX asterisk-13.38.1-r1-autoconf-lua-version.patch 2320 BLAKE2B 5f9a4b4063286f964da0756698134ce9127a3ae854e19ccec098fb554f4835cbb1698da6ac76293dcb1af3dfd8ea741e9450d58b61c7da440ff3077c848dae68 SHA512 dae3daad5a6755a8a932b40c5d209c348a72266c139a2e05420ea4b8f292062832cf791bc8d41de4bf8c1e0516e8699efdb80724a5afb2d017ab707073d7fca8 AUX asterisk-13.38.1-r1-func_lock-fix-races.patch 9580 BLAKE2B 174aa69b0738c87f02692c2eec978171216b2117218a54b9785a836d0b72b779ed1aa48a3c3b624deb9e16e3485d60a8390b60019c90524f6248665d1ae0ff44 SHA512 bff6f20a677eef837a6727859c1c90309e6f012621743b7e8b6b92ad17cf44c9b94aa75a0b64550ae39a6260210a944725d9e9603fbe0ca7bcbd4fd61d991748 +AUX asterisk-13.38.2-r1-menuselect-exitcodes.patch 1736 BLAKE2B 32f18fe623c6a9ba4db24001bc6669a2bc0838f2b757a2bcacde6eeb6b63f31881af877ce25cf7f38f6b7c010d92b5a1065d22b3f7526bcdc22799a09b22a975 SHA512 c4888e24051f0913c7dd13dbadbc38e7638bdedfee36b6f6cee047f6113d39cd09d79d9ecbfbb38f72ae6c9092e1423a0eff885118cfa44d4995f11d95c4a1d3 AUX asterisk-16.15.1-r2-autoconf-2.70.patch 499 BLAKE2B d52c6514d3cd120402298322dac081d88821035a13a5210bddf8574dfe69ec1e6eca1f3335dbd2976e870a8dfc634d1883b3e0db707557581da38b074f7359e6 SHA512 a55725377a874ee15a722076fc63323d73a976592aad524e56bdff5f4164eaa7e533723f5add93b738f39532392541bd2615fc39b3a4fd55a49f57f584d82846 -AUX asterisk-16.16.2-no-var-run-install.patch 745 BLAKE2B fccfadf92aed04072d84e982cf2016ac648dbc6afa35bdc7446c2a032731bb93b227414dc75035a6c93329db3f1c2b81dc815690174f5c7d7c3a7078e5acffb4 SHA512 99b96357aa39a288a3381c8662cdb4a528fb998365d5456ba28863302cb528f568f3f7aecdb6ca830f2cda310f2a940d001e9096124a2df1ad064a62025e0e06 +AUX asterisk-16.16.2-no-var-run-install.patch 728 BLAKE2B 25fc61c4aa68d9e3243d1161e68e0b61b14b5505eadd00fdf46e1c3977e7fb536afd42dc6c9a07f400a686c19afd04fd8f00fc1cb916978783a9e54ecfe81dd4 SHA512 ab1e7ac700711125162396c4ebe590eb000f4ad6c4cbe8845794f5d06353a4a52167fcc83ee97860f38540089cad6d45f2e8589c1f30098e85479a2b4c722f75 AUX asterisk-historic-no-var-run-install.patch 790 BLAKE2B 6fb753a3dc1b557b4cca8df1dc93eba3de70114f0bb206692461a3faf4068ffbf641740fa51e5010cabf0cbb64d8856dd9a830eba802b1988208b8a185a1fc57 SHA512 9c941d49a1ea10f702b7ce2c9c4a120c0e8ea297f13ecaa9d2a9b059cf4452a981aa0e0eabd5c4711c222311e3f9a52ee1135c59433ba878a9bd3a979be852fd AUX asterisk.service 456 BLAKE2B 4a5da9f0e45aa3b1eff29d59317d09e061e0a0e3c0e38cd39732e7880e96b7f34a68b44001d2608a7636b1259803f567b94bdb85ef15428727427fa1081ee385 SHA512 d443c3821d50e78a76b7cad8906f560ab0f4b58007f6c9322256626bc4a502bdbd844f1ee48cdaf86d499bf78f50cebb0cfc88a0cab0c4876f4e853bc2e76aa8 AUX asterisk.service.conf 324 BLAKE2B b802f69897f050f661412631da7ddc6e3207ff0d776ad2c2cfb13677049b8e3fce8c565103057745a48a4245f8c660f805088844fdea7fb042facd32b5ec13b7 SHA512 94be3b27f9d862d357b62d14b9d59ca47487bfd4987ce3b0ea2bb862c6d03e1d3c8b536590f20295fd085166da3efdff869c4cfc37542a31933d22b6d9b73da3 AUX asterisk.tmpfiles2.conf 43 BLAKE2B b459348ce0bf46a915b0a64a4961d753bb9610486dc8499e7ff4eb2fab8d1afda59d880057bd4862f12a497d4cba5b025d73f5f510987d349dd46d269a4d1869 SHA512 65e35490966095a7be6f4acb9e338fe94021976860319fd1c13b8d1b19376854f45348e182ce3a6c02d459c6dfeae62236148b7c992ddfaeb0ed55d0d8682e1b +AUX asterisk.tmpfiles3.conf 88 BLAKE2B 826beba7712e4d096c5506fed353a1a21c89b4acbc6b6ae99f60fbc7e338a331056ec145bd885dd23b7058f4bdf3109d68fddff715ae32e9ec0fc88ce68bef56 SHA512 992902fd01dfd03a2d77bf8a6c7b3adbdcd769478cf0bfa019632515107222aa59b12be10f5dfd26b4e18651e51b81939f1321ae29531dda0f3a623306e6a983 AUX confd-13.32.0 3895 BLAKE2B eada6c9ef6bb6754645679e6f2f5f2d299d89a3df3830f32ad468d2b83da3e98a4dda51250d86b5625e240c89dc151b26199e23b4131fd00764bcad223d15768 SHA512 55e8b2e2ac4da129375224cdfbb1165032b934fcce3da509e966083c80d7606af77025460214349da5203d9650cc03a9d4087266128459c7d99593068d94aae5 +AUX confd-16.16.2-r1 4078 BLAKE2B 9d49eb95660f5cb92d62d34a262d77909ab9acd68afa353dcff2d8c239cb203da289a7af91c083f4b89350d64bc2e87b1d7422266207605997badfab00ea24fc SHA512 4b4402ce62527084d0f82c5ad975d6b85276bb9c1e97d6f405737c6eee3c15f45e1b48f149d508c4f5cd70dd23a5e9be3ebd673047f80f4dfcda4913c9b6b287 AUX initd-13.32.0-r1 9945 BLAKE2B 231bb632b6634fbe1455ba9e6312562c00a14552a2a38fe88dce5655e36628644e38f07984e305c706b167ec3674eec63933fb889586b78a9386c16bb3765766 SHA512 6c31c7627e30b15a35540d9eabad310841b5f740f8f361fc01630fd6ab389bae02f0d1092ee35e6375b5ae93a7d8d71d03cb06201045d084882177a2ce49a4da +AUX initd-16.16.2-r1 9986 BLAKE2B 4b1c9537ef85c9de1d0064a851472163576480f08b573839db7860fd10828f444aef0f08d189a4e129a5545538424c1698e7d9d980cdbb44da2e68ff73dd0c75 SHA512 81747f6e6b4142b341797a8b2e9b212a48870d8db661669759020cc4c3ab0b66996a37dbd35afaa842dc00cd43aa834d3146021420b3f29b0d2f8b6e11d3fca7 DIST asterisk-13.38.1.tar.gz 33705256 BLAKE2B c783ee40880455cee5a60b111f69d95fdc42bd42a598834236e9999d0f2f401548229560e937fa8d842c5d24715d3891e7860f098d35d5630522e7a659123242 SHA512 270b7c8374104b3c2e9999503fa5cab5b465e37ddfa6759c1019fb99b6bb5877fe4505501ac3306a708ce911aeda36d04796f51156312c04fec013dbaa56a57f DIST asterisk-13.38.2.tar.gz 33708267 BLAKE2B f8c188f6500a01e807982518486972c18f8f903285910e64b4d8e2a4f553d42534f910696a02ab13e371dbd83dfd932c5cb7a6cea08817862ecaddcc7afd99d2 SHA512 bd9755503048cd8dcf8e39947dd5cfb617c20c4b1ad5033ae297499a4967c06ba11b6e43233c1ae0d33f8f11a81dbb9b4487f16a1f4786007172028caf1ee051 DIST asterisk-16.16.2.tar.gz 27808852 BLAKE2B dc05fe7c797f9b848c918121ffe7e7648bca75fccb70412fcd39f37beb3fd33e7d64cd198919cb6ae2867cd685651497ae15a30fb280988a9c7184e80de235ae SHA512 9e47ea2906a2c0d1a2f527d106ef6200a8d0cce76a31a6cfb3ca720a2ef7b5f723ae5c6266c74b0bdfd5718346e8d01a30fc346981463fa4ee7a4b7c99a67928 -EBUILD asterisk-13.38.1-r2.ebuild 9702 BLAKE2B e35e6757ff6429b49580eb0af9b203d9071334964ae0f588994028f14bb26b9aa1901991a6b7d00ce04c1c898276290f1b19862b15102ed5a7b1c925193ec7d7 SHA512 381907b16af92653d10df9679c770185f7fb639c63971cbf98732e856c19b08d56b6f7626753f20e4a9bd152e3290dac0742bc81e33a3abe5fefcb61dee5203e -EBUILD asterisk-13.38.2.ebuild 9704 BLAKE2B fd0412c01c13bb1ae61afc25f7361722ffa06f0070e5dacf8ffa4752a6da27903f256cda72d1e423129f71510ef14ab59b7e48c1549ac25c883c247094e481bd SHA512 59a4471cb839682a312597ee17336a4f61c8d9fa7f3fd52b50060f4135171493cf46bf75f77e5dc2d45d8c797cbfbc0c462634be2dfdb247b4456812debac9fd -EBUILD asterisk-16.16.2.ebuild 9893 BLAKE2B c84f1403a0405224650395cc577f3e8af06a52856af956229499f1025fb933b1dedde19c638487e4f2b84b34dbea3c4e8441ba5647ba2c9ce86721a6c02c48bd SHA512 547c80803791260513d16f73b2fbe744ca31f46d20c28aa17f13f3708533d9c66e2740a21c1af86840b75865e9368ae5477f7a22b7c5d4deadaaeae91d931ced -MISC metadata.xml 1377 BLAKE2B 4b7f76e4834ff58ed593b7e1141b4781b6dfbfb1fb32ee7a1e4f6a982f1267f2e690409f4d6d7f7ea45d4dc8f93bda274a72d1e39d9034f39ed6386a25382413 SHA512 192b14fc1c15b7a7117ee1653adada3fdc480082d2533662c7e7c8ccd13dce08d4eb0c02413c269f544b93870a1deb60092dee8ea92abfd6ce0a39630a9807d8 +DIST asterisk-18.2.2.tar.gz 27888521 BLAKE2B 5837b6434568a8e9f7a8963098994ccb487cfe9b85d59b30e5866e4eb67d222c4ac2c77036f7d461de72acc6ffd07fcd2d56bcaa618f4aecdbdba60d609eeb93 SHA512 e15fe3c7f46d49991bcb6f6f565f15e4af0d658b4cd6b091079209dd95a8027858effdc2f2314d72ed46a73cdebc089d3c27d5cf8db50d2d21f3c317a8a4a546 +EBUILD asterisk-13.38.1-r2.ebuild 9725 BLAKE2B a25d483b9242d2ca6223226d75f5da9f5b56ef0aafc865393e876a1178fec355867e98ed178bb4be7dd5ea805137ee809a6e3274a53a54a6d0628a2cb8c6b9e9 SHA512 9021cd20e0bf2d825cbd9855d975c3a562bbbd00d6c4c8e8c246d85c839f3198b19cb62819c9a1708b4aec5d2784bb05079a04ead3f937f7fc661ef072434dd6 +EBUILD asterisk-13.38.2-r1.ebuild 10793 BLAKE2B 9e0ba0d5db3f56b8726a557e8f80ac5833aceb1a023f5d107f5736a275eb3866f98eec6cc9234af73c8ecbdc44302207a0b595e89e7f2a4c578b8553037e8ea5 SHA512 d324345df46ae82b113b06746a9ee4020700de68619f1f82f7c2d41da46f8056c9479b4f9e2cea96bc964c89b72e7fc300d9d5f91162eb0e0a922170916f9b61 +EBUILD asterisk-13.38.2.ebuild 9727 BLAKE2B 23045501df1313e8eaffff84854c636b451c62d866e08faad95c5e9437c3a4663bb8da102fe41e9ca353b1f281572aafead82a6cb949db173aebf6b5f9909654 SHA512 ff7df049d824e33618e7759930df761bdb0ab5e6dca852409daff2bd94bdb84fb99ae3139e877d14655b2cd7a12ec423a87fb2a9fe8aa13c7e9cb2a29867044b +EBUILD asterisk-16.16.2-r1.ebuild 11358 BLAKE2B 11dfe65926cad46998ccc2942e00d2a43343dee69c6a0ce2b32c070d1927a58cefba753463467d55e0c3133bb3b01941c5879ebd8881c227cbc94089947b2722 SHA512 ab299440f47d5dc2aa16af46f6859ab4317ec1d83aef853fadcc403a44d3cbc4043a9b6cfe7ce146e6b3bc5958123072e04705e80a3b964009177266a12570a5 +EBUILD asterisk-16.16.2.ebuild 9916 BLAKE2B a02bc1d09394459ca9737f43dea546b16fe3230319585bf7a86a8bbccc123342054f63578382b17bf1c02cee94749c1516860aaea383aaec173990267ba41f35 SHA512 c06ebbc5202ddbda233747120b17b2cda0cb8db4465ea5f445f0d064c8efdb49ef7cf957c5da759bc392dcb5e5805e30b47268062c94b241d2cb27e0ec33c152 +EBUILD asterisk-18.2.2.ebuild 11331 BLAKE2B 89f1eb498c7e25872918ec01a865bb00c393f4b86e6199622f49259b9ceff341c71992d99adce75d8ef808edbf4d139106c3bd41f2ee46e69e013da1b0af03bb SHA512 f4568a1caf38249e2e62ee6a0033aeb023bb0c731820b42429f02afd3f7faffa64fa66f95d708f7f19a0032bdd0ab7c830dfe5a4f985f7ff40b0f7108ccdfb58 +MISC metadata.xml 1482 BLAKE2B 71a7d51199cb53116efd36963d5881264faa13f8beb375ab68074c3ab560443c3ea9cb021c5c03c9c55fdfa9fc27425c90b4313d3a3bd680079add6ebf5763d1 SHA512 df1f06ccc232488d08202b9f6bfc62e17769ef740a2c1da9ee8a2c48d40d7a293f522b6c9c899c7ae202ba7c6b207fc25e69730d2983bb307921f82c070a09ee diff --git a/net-misc/asterisk/asterisk-13.38.1-r2.ebuild b/net-misc/asterisk/asterisk-13.38.1-r2.ebuild index 00fb2c78dce3..4afefac8480b 100644 --- a/net-misc/asterisk/asterisk-13.38.1-r2.ebuild +++ b/net-misc/asterisk/asterisk-13.38.1-r2.ebuild @@ -19,7 +19,7 @@ IUSE_VOICEMAIL_STORAGE=( voicemail_storage_odbc voicemail_storage_imap ) -IUSE="${IUSE_VOICEMAIL_STORAGE[*]//+/} alsa blocks bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog vorbis xmpp" +IUSE="${IUSE_VOICEMAIL_STORAGE[*]} alsa blocks bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog vorbis xmpp" REQUIRED_USE="gtalk? ( xmpp ) lua? ( ${LUA_REQUIRED_USE} ) ^^ ( ${IUSE_VOICEMAIL_STORAGE[*]//+/} ) @@ -99,7 +99,8 @@ RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-asterisk ) syslog? ( virtual/logger )" -BDEPEND="virtual/pkgconfig" +BDEPEND="dev-libs/libxml2:2 + virtual/pkgconfig" QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+" @@ -285,7 +286,7 @@ src_install() { dodoc UPGRADE* BUGS CREDITS # install extra documentation - use doc &&doc/*.{txt,pdf} + use doc && dodoc doc/*.{txt,pdf} # install logrotate snippet; bug #329281 # diff --git a/net-misc/asterisk/asterisk-13.38.2-r1.ebuild b/net-misc/asterisk/asterisk-13.38.2-r1.ebuild new file mode 100644 index 000000000000..93a5d9eec9aa --- /dev/null +++ b/net-misc/asterisk/asterisk-13.38.2-r1.ebuild @@ -0,0 +1,348 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..4} ) + +inherit autotools linux-info lua-single systemd toolchain-funcs tmpfiles + +DESCRIPTION="Asterisk: A Modular Open Source PBX System" +HOMEPAGE="https://www.asterisk.org/" +SRC_URI="https://downloads.asterisk.org/pub/telephony/asterisk/releases/${P}.tar.gz" +LICENSE="GPL-2" +SLOT="0/${PV%%.*}" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" + +IUSE_VOICEMAIL_STORAGE=( + +voicemail_storage_file + voicemail_storage_odbc + voicemail_storage_imap +) +IUSE="${IUSE_VOICEMAIL_STORAGE[*]} alsa blocks bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog systemd vorbis xmpp" +REQUIRED_USE="gtalk? ( xmpp ) + lua? ( ${LUA_REQUIRED_USE} ) + ^^ ( ${IUSE_VOICEMAIL_STORAGE[*]//+/} ) + voicemail_storage_odbc? ( odbc ) +" + +PATCHES=( + "${FILESDIR}/${PN}-historic-no-var-run-install.patch" + "${FILESDIR}/${PN}-13.38.1-r1-autoconf-lua-version.patch" + "${FILESDIR}/${PN}-13.38.1-r1-func_lock-fix-races.patch" + "${FILESDIR}/${PN}-13.18.1-r2-autoconf-2.70.patch" + "${FILESDIR}/${PN}-13.38.2-r1-menuselect-exitcodes.patch" +) + +DEPEND="acct-user/asterisk + acct-group/asterisk + dev-db/sqlite:3 + dev-libs/popt + dev-libs/jansson + dev-libs/libedit + dev-libs/libxml2:2 + dev-libs/libxslt + sys-libs/zlib + alsa? ( media-libs/alsa-lib ) + bluetooth? ( net-wireless/bluez:= ) + calendar? ( + net-libs/neon:= + dev-libs/libical:= + dev-libs/iksemel + ) + caps? ( sys-libs/libcap ) + blocks? ( sys-libs/blocksruntime ) + cluster? ( sys-cluster/corosync ) + curl? ( net-misc/curl ) + dahdi? ( + net-libs/libpri + net-misc/dahdi-tools + ) + freetds? ( dev-db/freetds ) + gtalk? ( dev-libs/iksemel ) + http? ( dev-libs/gmime:2.6 ) + iconv? ( virtual/libiconv ) + ilbc? ( media-libs/libilbc ) + ldap? ( net-nds/openldap ) + lua? ( ${LUA_DEPS} ) + mysql? ( dev-db/mysql-connector-c:= ) + newt? ( dev-libs/newt ) + odbc? ( dev-db/unixODBC ) + pjproject? ( net-libs/pjproject:= ) + portaudio? ( media-libs/portaudio ) + postgres? ( dev-db/postgresql:* ) + radius? ( net-dialup/freeradius-client ) + snmp? ( net-analyzer/net-snmp:= ) + span? ( media-libs/spandsp ) + speex? ( + media-libs/speex + media-libs/speexdsp + ) + srtp? ( net-libs/libsrtp:0 ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + systemd? ( sys-apps/systemd ) + !systemd? ( !sys-apps/systemd ) + vorbis? ( + media-libs/libogg + media-libs/libvorbis + ) + voicemail_storage_imap? ( virtual/imap-c-client ) + xmpp? ( dev-libs/iksemel ) +" + +RDEPEND="${DEPEND} + net-misc/asterisk-core-sounds + net-misc/asterisk-extra-sounds + net-misc/asterisk-moh-opsound + selinux? ( sec-policy/selinux-asterisk ) + syslog? ( virtual/logger )" + +BDEPEND="dev-libs/libxml2:2 + virtual/pkgconfig" + +QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+" + +_make_args=( + "NOISY_BUILD=yes" + "ASTDBDIR=\$(ASTDATADIR)/astdb" + "OPTIMIZE=" + "DEBUG=" + "DESTDIR=${D}" + "CONFIG_SRC=configs/samples" + "CONFIG_EXTEN=.sample" +) + +pkg_pretend() { + CONFIG_CHECK="~!NF_CONNTRACK_SIP" + local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users + have reported that this module dropped critical SIP packets in their deployments. You + may want to disable it if you see such problems." + check_extra_config + + [[ "${MERGE_TYPE}" == binary ]] && return + + if tc-is-clang; then + use blocks || die "CC=clang requires USE=blocks" + else + use blocks && die "USE=blocks can only be used with CC=clang" + fi +} + +pkg_setup() { + use lua && lua-single_pkg_setup +} + +src_prepare() { + default + AT_M4DIR="autoconf third-party third-party/pjproject third-party/jansson" eautoreconf +} + +src_configure() { + local vmst + local copt cstate + + econf \ + LUA_VERSION="${ELUA#lua}" \ + --libdir="/usr/$(get_libdir)" \ + --localstatedir="/var" \ + --with-crypto \ + --with-gsm=internal \ + --with-popt \ + --with-z \ + --with-libedit \ + $(use_with caps cap) \ + $(use_with lua lua) \ + $(use_with http gmime) \ + $(use_with newt) \ + $(use_with pjproject) \ + $(use_with portaudio) \ + $(use_with ssl) + + _menuselect() { + menuselect/menuselect "$@" || die "menuselect $* failed." + } + + _use_select() { + local state=$(usex "$1" enable disable) + shift # remove use from parameters + + while [[ -n $1 ]]; do + _menuselect --${state} "$1" menuselect.makeopts + shift + done + } + + # Blank out sounds/sounds.xml file to prevent + # asterisk from installing sounds files (we pull them in via + # asterisk-{core,extra}-sounds and asterisk-moh-opsound. + >"${S}"/sounds/sounds.xml + + # That NATIVE_ARCH chatter really is quite bothersome + sed -i 's/NATIVE_ARCH=/NATIVE_ARCH=0/' build_tools/menuselect-deps || die "Unable to squelch noisy build system" + + # Compile menuselect binary for optional components + emake "${_make_args[@]}" menuselect.makeopts + + # Disable BUILD_NATIVE (bug #667498) + _menuselect --disable build_native menuselect.makeopts + + # Broken functionality is forcibly disabled (bug #360143) + _menuselect --disable chan_misdn menuselect.makeopts + _menuselect --disable chan_ooh323 menuselect.makeopts + + # Utility set is forcibly enabled (bug #358001) + _menuselect --enable smsq menuselect.makeopts + _menuselect --enable streamplayer menuselect.makeopts + _menuselect --enable aelparse menuselect.makeopts + _menuselect --enable astman menuselect.makeopts + + # this is connected, otherwise it would not find + # ast_pktccops_gate_alloc symbol + _menuselect --enable chan_mgcp menuselect.makeopts + _menuselect --enable res_pktccops menuselect.makeopts + + # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available + _menuselect --enable pbx_dundi menuselect.makeopts + _menuselect --enable func_aes menuselect.makeopts + _menuselect --enable chan_iax2 menuselect.makeopts + + # SQlite3 is now the main database backend, enable related features + _menuselect --enable cdr_sqlite3_custom menuselect.makeopts + _menuselect --enable cel_sqlite3_custom menuselect.makeopts + + # The others are based on USE-flag settings + _use_select alsa chan_alsa + _use_select bluetooth chan_mobile + _use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar} + _use_select cluster res_corosync + _use_select curl func_curl res_config_curl res_curl + _use_select dahdi app_dahdiras app_meetme chan_dahdi codec_dahdi res_timing_dahdi + _use_select freetds {cdr,cel}_tds + _use_select gtalk chan_motif + _use_select http res_http_post + _use_select iconv func_iconv + _use_select ilbc codec_ilbc format_ilbc + _use_select ldap res_config_ldap + _use_select lua pbx_lua + _use_select mysql app_mysql cdr_mysql res_config_mysql + _use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc + _use_select oss chan_oss + _use_select postgres {cdr,cel}_pgsql res_config_pgsql + _use_select radius {cdr,cel}_radius + _use_select snmp res_snmp + _use_select span res_fax_spandsp + _use_select speex {codec,func}_speex + _use_select srtp res_srtp + _use_select statsd res_statsd res_{endpoint,chan}_stats + _use_select syslog cdr_syslog + _use_select vorbis format_ogg_vorbis + _use_select xmpp res_xmpp + + # Voicemail storage ... + for vmst in "${IUSE_VOICEMAIL_STORAGE[@]}"; do + if use "${vmst#+}"; then + _menuselect --enable "$(echo "${vmst##*_}" | tr '[:lower:]' '[:upper:]')_STORAGE" menuselect.makeopts + fi + done + + if use debug; then + for o in DONT_OPTIMIZE DEBUG_FD_LEAKS MALLOC_DEBUG BETTER_BACKTRACES; do + _menuselect --enable $o menuselect.makeopts + done + fi + + if [[ -n "${GENTOO_ASTERISK_CUSTOM_MENUSELECT:+yes}" ]]; then + for copt in ${GENTOO_ASTERISK_CUSTOM_MENUSELECT}; do + cstate=--enable + [[ "${copt}" == -* ]] && cstate=--disable + ebegin "Custom option ${copt#[-+]} ${cstate:2}d" + _menuselect ${cstate} "${copt#[-+]}" + eend $? + done + fi +} + +src_compile() { + emake "${_make_args[@]}" +} + +src_install() { + local d + + dodir "/usr/$(get_libdir)/pkgconfig" + diropts -m 0750 -o root -g asterisk + dodir /etc/asterisk + + emake "${_make_args[@]}" install install-configs + + fowners asterisk: /var/lib/asterisk/astdb + + if use radius; then + insinto /etc/radiusclient/ + doins contrib/dictionary.digium + fi + + # keep directories + diropts -m 0750 -o asterisk -g root + keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail,recording} + diropts -m 0750 -o asterisk -g asterisk + keepdir /var/log/asterisk/{cdr-csv,cdr-custom} + + newinitd "${FILESDIR}"/initd-13.32.0-r1 asterisk + newconfd "${FILESDIR}"/confd-13.32.0 asterisk + + systemd_dounit "${FILESDIR}"/asterisk.service + newtmpfiles "${FILESDIR}"/asterisk.tmpfiles2.conf asterisk.conf + systemd_install_serviced "${FILESDIR}"/asterisk.service.conf + + # Reset diropts else dodoc uses it for doc installations. + diropts -m0755 + + # install the upgrade documentation + dodoc UPGRADE* BUGS CREDITS + + # install extra documentation + use doc && dodoc doc/*.{txt,pdf} + + # install logrotate snippet; bug #329281 + # + insinto /etc/logrotate.d + newins "${FILESDIR}/1.6.2/asterisk.logrotate4" asterisk + + # Asterisk installs a few folders that's empty by design, + # but still required. This finds them, and marks them for + # portage. + while read d < <(find "${ED}"/var -type d -empty || die "Find failed."); do + keepdir "${d#${ED}}" + done +} + +pkg_postinst() { + if [ -z "${REPLACING_VERSIONS}" ]; then + elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/" + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net" + elif [ "$(ver_cut 1 "${REPLACING_VERSIONS}")" != "$(ver_cut 1)" ]; then + elog "You are updating from Asterisk $(ver_cut 1 "${REPLACING_VERSIONS}") upgrade document:" + elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+$(ver_cut 1)" + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net" + fi + + if [[ -n "${GENTOO_ASTERISK_CUSTOM_MENUSELECT:+yes}" ]]; then + ewarn "You are using GENTOO_ASTERISK_CUSTOM_MENUSELECT, this should only be used" + ewarn "for debugging, for anything else, please file a bug on https://bugs.gentoo.org" + fi + + if [[ -f /var/lib/asterisk/astdb.sqlite3 ]]; then + ewarn "Default astdb location has changed from /var/lib/asterisk to /var/lib/asterisk/astdb" + ewarn "You still have a /var/lib/asterisk/astdb.sqlite file. You need to either set" + ewarn "astdbdir in /etc/asterisk/asterisk.conf to /var/lib/asterisk or follow these" + ewarn "steps to migrate:" + ewarn "1. /etc/init.d/asterisk stop" + ewarn "2. mv /var/lib/asterisk/astdb.sqlite /var/lib/asterisk/astdb/" + ewarn "3. /etc/init.d/asterisk start" + ewarn "This update was done partly for security reasons so that /var/lib/asterisk can be root owned." + fi +} diff --git a/net-misc/asterisk/asterisk-13.38.2.ebuild b/net-misc/asterisk/asterisk-13.38.2.ebuild index 84f0aec402f7..7a8d1d57cf86 100644 --- a/net-misc/asterisk/asterisk-13.38.2.ebuild +++ b/net-misc/asterisk/asterisk-13.38.2.ebuild @@ -19,7 +19,7 @@ IUSE_VOICEMAIL_STORAGE=( voicemail_storage_odbc voicemail_storage_imap ) -IUSE="${IUSE_VOICEMAIL_STORAGE[*]//+/} alsa blocks bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog vorbis xmpp" +IUSE="${IUSE_VOICEMAIL_STORAGE[*]} alsa blocks bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog vorbis xmpp" REQUIRED_USE="gtalk? ( xmpp ) lua? ( ${LUA_REQUIRED_USE} ) ^^ ( ${IUSE_VOICEMAIL_STORAGE[*]//+/} ) @@ -99,7 +99,8 @@ RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-asterisk ) syslog? ( virtual/logger )" -BDEPEND="virtual/pkgconfig" +BDEPEND="dev-libs/libxml2:2 + virtual/pkgconfig" QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+" @@ -285,7 +286,7 @@ src_install() { dodoc UPGRADE* BUGS CREDITS # install extra documentation - use doc &&doc/*.{txt,pdf} + use doc && dodoc doc/*.{txt,pdf} # install logrotate snippet; bug #329281 # diff --git a/net-misc/asterisk/asterisk-16.16.2-r1.ebuild b/net-misc/asterisk/asterisk-16.16.2-r1.ebuild new file mode 100644 index 000000000000..4dc58a42a482 --- /dev/null +++ b/net-misc/asterisk/asterisk-16.16.2-r1.ebuild @@ -0,0 +1,365 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..4} ) + +inherit autotools linux-info lua-single systemd toolchain-funcs tmpfiles + +DESCRIPTION="Asterisk: A Modular Open Source PBX System" +HOMEPAGE="https://www.asterisk.org/" +SRC_URI="https://downloads.asterisk.org/pub/telephony/asterisk/releases/${P}.tar.gz" +LICENSE="GPL-2" +SLOT="0/${PV%%.*}" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" + +IUSE_VOICEMAIL_STORAGE=( + +voicemail_storage_file + voicemail_storage_odbc + voicemail_storage_imap +) +IUSE="${IUSE_VOICEMAIL_STORAGE[*]} alsa blocks bluetooth calendar +caps cluster codec2 curl dahdi debug -deprecated doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog systemd unbound vorbis xmpp" +IUSE_EXPAND="VOICEMAIL_STORAGE" +REQUIRED_USE="gtalk? ( xmpp ) + lua? ( ${LUA_REQUIRED_USE} ) + ^^ ( ${IUSE_VOICEMAIL_STORAGE[*]//+/} ) + voicemail_storage_odbc? ( odbc ) +" + +PATCHES=( + "${FILESDIR}/${PN}-16.16.2-no-var-run-install.patch" + "${FILESDIR}/${PN}-16.15.1-r2-autoconf-2.70.patch" + "${FILESDIR}/${PN}-13.38.2-r1-menuselect-exitcodes.patch" +) + +DEPEND="acct-user/asterisk + acct-group/asterisk + dev-db/sqlite:3 + dev-libs/popt + >=dev-libs/jansson-2.11 + dev-libs/libedit + dev-libs/libxml2:2 + dev-libs/libxslt + sys-apps/util-linux + sys-libs/zlib + alsa? ( media-libs/alsa-lib ) + bluetooth? ( net-wireless/bluez:= ) + calendar? ( + net-libs/neon:= + dev-libs/libical:= + dev-libs/iksemel + ) + caps? ( sys-libs/libcap ) + blocks? ( sys-libs/blocksruntime ) + cluster? ( sys-cluster/corosync ) + codec2? ( media-libs/codec2:= ) + curl? ( net-misc/curl ) + dahdi? ( + net-libs/libpri + net-misc/dahdi-tools + ) + freetds? ( dev-db/freetds ) + gtalk? ( dev-libs/iksemel ) + http? ( dev-libs/gmime:2.6 ) + iconv? ( virtual/libiconv ) + ilbc? ( media-libs/libilbc ) + ldap? ( net-nds/openldap ) + lua? ( ${LUA_DEPS} ) + mysql? ( dev-db/mysql-connector-c:= ) + newt? ( dev-libs/newt ) + odbc? ( dev-db/unixODBC ) + pjproject? ( >=net-libs/pjproject-2.9:= ) + portaudio? ( media-libs/portaudio ) + postgres? ( dev-db/postgresql:* ) + radius? ( net-dialup/freeradius-client ) + snmp? ( net-analyzer/net-snmp:= ) + span? ( media-libs/spandsp ) + speex? ( + media-libs/libogg + media-libs/speex + media-libs/speexdsp + ) + srtp? ( net-libs/libsrtp:0 ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + systemd? ( sys-apps/systemd ) + !systemd? ( !sys-apps/systemd ) + unbound? ( net-dns/unbound ) + vorbis? ( + media-libs/libogg + media-libs/libvorbis + ) + voicemail_storage_imap? ( virtual/imap-c-client ) + xmpp? ( dev-libs/iksemel ) +" + +RDEPEND="${DEPEND} + net-misc/asterisk-core-sounds + net-misc/asterisk-extra-sounds + net-misc/asterisk-moh-opsound + selinux? ( sec-policy/selinux-asterisk ) + syslog? ( virtual/logger )" + +BDEPEND="dev-libs/libxml2:2 + virtual/pkgconfig" + +QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+" + +_make_args=( + "NOISY_BUILD=yes" + "ASTDBDIR=\$(ASTDATADIR)/astdb" + "ASTCACHEDIR=/var/cache/asterisk" + "OPTIMIZE=" + "DEBUG=" + "DESTDIR=${D}" + "CONFIG_SRC=configs/samples" + "CONFIG_EXTEN=.sample" +) + +pkg_pretend() { + CONFIG_CHECK="~!NF_CONNTRACK_SIP" + local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users + have reported that this module dropped critical SIP packets in their deployments. You + may want to disable it if you see such problems." + check_extra_config + + [[ "${MERGE_TYPE}" == binary ]] && return + + if tc-is-clang; then + use blocks || die "CC=clang requires USE=blocks" + else + use blocks && die "USE=blocks can only be used with CC=clang" + fi +} + +pkg_setup() { + use lua && lua-single_pkg_setup +} + +src_prepare() { + default + AT_M4DIR="autoconf third-party third-party/pjproject third-party/jansson" eautoreconf +} + +src_configure() { + local vmst + local copt cstate + + econf \ + LUA_VERSION="${ELUA#lua}" \ + --libdir="/usr/$(get_libdir)" \ + --localstatedir="/var" \ + --with-crypto \ + --with-gsm=internal \ + --with-popt \ + --with-z \ + --with-libedit \ + --without-jansson-bundled \ + --without-pjproject-bundled \ + $(use_with caps cap) \ + $(use_with codec2) \ + $(use_with lua lua) \ + $(use_with http gmime) \ + $(use_with newt) \ + $(use_with pjproject) \ + $(use_with portaudio) \ + $(use_with ssl) \ + $(use_with unbound) + + _menuselect() { + menuselect/menuselect "$@" || die "menuselect $* failed." + } + + _use_select() { + local state=$(use "$1" && echo enable || echo disable) + shift # remove use from parameters + + while [[ -n $1 ]]; do + _menuselect --${state} "$1" menuselect.makeopts + shift + done + } + + # Blank out sounds/sounds.xml file to prevent + # asterisk from installing sounds files (we pull them in via + # asterisk-{core,extra}-sounds and asterisk-moh-opsound. + >"${S}"/sounds/sounds.xml + + # That NATIVE_ARCH chatter really is quite bothersome + sed -i 's/NATIVE_ARCH=/NATIVE_ARCH=0/' build_tools/menuselect-deps || die "Unable to squelch noisy build system" + + # Compile menuselect binary for optional components + emake "${_make_args[@]}" menuselect.makeopts + + # Disable BUILD_NATIVE (bug #667498) + _menuselect --disable build_native menuselect.makeopts + + # Broken functionality is forcibly disabled (bug #360143) + _menuselect --disable chan_misdn menuselect.makeopts + _menuselect --disable chan_ooh323 menuselect.makeopts + + # Utility set is forcibly enabled (bug #358001) + _menuselect --enable smsq menuselect.makeopts + _menuselect --enable streamplayer menuselect.makeopts + _menuselect --enable aelparse menuselect.makeopts + _menuselect --enable astman menuselect.makeopts + + # this is connected, otherwise it would not find + # ast_pktccops_gate_alloc symbol + _menuselect --enable chan_mgcp menuselect.makeopts + _menuselect --enable res_pktccops menuselect.makeopts + + # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available + _menuselect --enable pbx_dundi menuselect.makeopts + _menuselect --enable func_aes menuselect.makeopts + _menuselect --enable chan_iax2 menuselect.makeopts + + # SQlite3 is now the main database backend, enable related features + _menuselect --enable cdr_sqlite3_custom menuselect.makeopts + _menuselect --enable cel_sqlite3_custom menuselect.makeopts + + # The others are based on USE-flag settings + _use_select alsa chan_alsa + _use_select bluetooth chan_mobile + _use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar} + _use_select cluster res_corosync + _use_select codec2 codec_codec2 + _use_select curl func_curl res_config_curl res_curl + _use_select dahdi app_dahdiras app_meetme chan_dahdi codec_dahdi res_timing_dahdi + _use_select deprecated app_macro + _use_select freetds {cdr,cel}_tds + _use_select gtalk chan_motif + _use_select http res_http_post + _use_select iconv func_iconv + _use_select ilbc codec_ilbc format_ilbc + _use_select ldap res_config_ldap + _use_select lua pbx_lua + _use_select mysql app_mysql cdr_mysql res_config_mysql + _use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc + _use_select oss chan_oss + _use_select postgres {cdr,cel}_pgsql res_config_pgsql + _use_select radius {cdr,cel}_radius + _use_select snmp res_snmp + _use_select span res_fax_spandsp + _use_select speex {codec,func}_speex + _use_select speex format_ogg_speex + _use_select srtp res_srtp + _use_select statsd res_statsd res_{endpoint,chan}_stats + _use_select syslog cdr_syslog + _use_select vorbis format_ogg_vorbis + _use_select xmpp res_xmpp + + # Voicemail storage ... + for vmst in "${IUSE_VOICEMAIL_STORAGE[@]}"; do + if use "${vmst#+}"; then + _menuselect --enable "$(echo "${vmst##*_}" | tr '[:lower:]' '[:upper:]')_STORAGE" menuselect.makeopts + fi + done + + if use debug; then + for o in DONT_OPTIMIZE DEBUG_FD_LEAKS MALLOC_DEBUG BETTER_BACKTRACES; do + _menuselect --enable "${o}" menuselect.makeopts + done + fi + + if [[ -n "${GENTOO_ASTERISK_CUSTOM_MENUSELECT:+yes}" ]]; then + for copt in ${GENTOO_ASTERISK_CUSTOM_MENUSELECT}; do + cstate=--enable + [[ "${copt}" == -* ]] && cstate=--disable + ebegin "Custom option ${copt#[-+]} ${cstate:2}d" + _menuselect ${cstate} "${copt#[-+]}" + eend $? + done + fi +} + +src_compile() { + emake "${_make_args[@]}" +} + +src_install() { + local d + + dodir "/usr/$(get_libdir)/pkgconfig" + + diropts -m 0750 -o root -g asterisk + dodir /etc/asterisk + + emake "${_make_args[@]}" install install-configs + + fowners asterisk: /var/lib/asterisk/astdb + + if use radius; then + insinto /etc/radiusclient/ + doins contrib/dictionary.digium + fi + + # keep directories + diropts -m 0750 -o asterisk -g root + keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail,recording} + diropts -m 0750 -o asterisk -g asterisk + keepdir /var/log/asterisk/{cdr-csv,cdr-custom} + + newinitd "${FILESDIR}"/initd-16.16.2-r1 asterisk + newconfd "${FILESDIR}"/confd-16.16.2-r1 asterisk + + systemd_dounit "${FILESDIR}"/asterisk.service + newtmpfiles "${FILESDIR}"/asterisk.tmpfiles3.conf asterisk.conf + systemd_install_serviced "${FILESDIR}"/asterisk.service.conf + + # Reset diropts else dodoc uses it for doc installations. + diropts -m0755 + + # install the upgrade documentation + dodoc UPGRADE* BUGS CREDITS + + # install extra documentation + use doc && dodoc doc/*.{txt,pdf} + + # install logrotate snippet; bug #329281 + # + insinto /etc/logrotate.d + newins "${FILESDIR}/1.6.2/asterisk.logrotate4" asterisk + + # Asterisk installs a few folders that's empty by design, + # but still required. This finds them, and marks them for + # portage. + while read d < <(find "${ED}"/var -type d -empty || die "Find failed."); do + keepdir "${d#${ED}}" + done +} + +pkg_postinst() { + if [ -z "${REPLACING_VERSIONS}" ]; then + elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/" + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net" + elif [ "$(ver_cut 1 "${REPLACING_VERSIONS}")" != "$(ver_cut 1)" ]; then + elog "You are updating from Asterisk $(ver_cut 1 "${REPLACING_VERSIONS}") upgrade document:" + elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+$(ver_cut 1)" + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net" + fi + + if use deprecated; then + ewarn "You really aught to port whatever code you have that depends on this since these are going to go away." + ewarn "Refer: https://wiki.asterisk.org/wiki/display/AST/Module+Deprecation" + fi + + if [[ -n "${GENTOO_ASTERISK_CUSTOM_MENUSELECT:+yes}" ]]; then + ewarn "You are using GENTOO_ASTERISK_CUSTOM_MENUSELECT, this should only be used" + ewarn "for debugging, for anything else, please file a bug on https://bugs.gentoo.org" + fi + + if [[ -f /var/lib/asterisk/astdb.sqlite3 ]]; then + ewarn "Default astdb location has changed from /var/lib/asterisk to /var/lib/asterisk/astdb" + ewarn "You still have a /var/lib/asterisk/astdb.sqlite file. You need to either set" + ewarn "astdbdir in /etc/asterisk/asterisk.conf to /var/lib/asterisk or follow these" + ewarn "steps to migrate:" + ewarn "1. /etc/init.d/asterisk stop" + ewarn "2. mv /var/lib/asterisk/astdb.sqlite /var/lib/asterisk/astdb/" + ewarn "3. /etc/init.d/asterisk start" + ewarn "This update was done partly for security reasons so that /var/lib/asterisk can be root owned." + fi +} diff --git a/net-misc/asterisk/asterisk-16.16.2.ebuild b/net-misc/asterisk/asterisk-16.16.2.ebuild index 6a7ee37f0807..2ca6f4a6d01d 100644 --- a/net-misc/asterisk/asterisk-16.16.2.ebuild +++ b/net-misc/asterisk/asterisk-16.16.2.ebuild @@ -19,7 +19,7 @@ IUSE_VOICEMAIL_STORAGE=( voicemail_storage_odbc voicemail_storage_imap ) -IUSE="${IUSE_VOICEMAIL_STORAGE[*]//+/} alsa blocks bluetooth calendar +caps cluster codec2 curl dahdi debug doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog unbound vorbis xmpp" +IUSE="${IUSE_VOICEMAIL_STORAGE[*]} alsa blocks bluetooth calendar +caps cluster codec2 curl dahdi debug doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog unbound vorbis xmpp" IUSE_EXPAND="VOICEMAIL_STORAGE" REQUIRED_USE="gtalk? ( xmpp ) lua? ( ${LUA_REQUIRED_USE} ) @@ -101,7 +101,8 @@ RDEPEND="${DEPEND} selinux? ( sec-policy/selinux-asterisk ) syslog? ( virtual/logger )" -BDEPEND="virtual/pkgconfig" +BDEPEND="dev-libs/libxml2:2 + virtual/pkgconfig" QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+" @@ -292,7 +293,7 @@ src_install() { dodoc UPGRADE* BUGS CREDITS # install extra documentation - use doc &&doc/*.{txt,pdf} + use doc && dodoc doc/*.{txt,pdf} # install logrotate snippet; bug #329281 # diff --git a/net-misc/asterisk/asterisk-18.2.2.ebuild b/net-misc/asterisk/asterisk-18.2.2.ebuild new file mode 100644 index 000000000000..c253eb63cf92 --- /dev/null +++ b/net-misc/asterisk/asterisk-18.2.2.ebuild @@ -0,0 +1,364 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..4} ) + +inherit autotools linux-info lua-single systemd toolchain-funcs tmpfiles + +DESCRIPTION="Asterisk: A Modular Open Source PBX System" +HOMEPAGE="https://www.asterisk.org/" +SRC_URI="https://downloads.asterisk.org/pub/telephony/asterisk/releases/${P}.tar.gz" +LICENSE="GPL-2" +SLOT="0/${PV%%.*}" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" + +IUSE_VOICEMAIL_STORAGE=( + voicemail_storage_odbc + voicemail_storage_imap +) +IUSE="${IUSE_VOICEMAIL_STORAGE[*]} alsa blocks bluetooth calendar +caps cluster codec2 curl dahdi debug -deprecated doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog systemd unbound vorbis xmpp" +IUSE_EXPAND="VOICEMAIL_STORAGE" +REQUIRED_USE="gtalk? ( xmpp ) + lua? ( ${LUA_REQUIRED_USE} ) + voicemail_storage_odbc? ( odbc ) +" + +PATCHES=( + "${FILESDIR}/${PN}-16.16.2-no-var-run-install.patch" + "${FILESDIR}/${PN}-16.15.1-r2-autoconf-2.70.patch" + "${FILESDIR}/${PN}-13.38.2-r1-menuselect-exitcodes.patch" +) + +DEPEND="acct-user/asterisk + acct-group/asterisk + dev-db/sqlite:3 + dev-libs/popt + >=dev-libs/jansson-2.11 + dev-libs/libedit + dev-libs/libxml2:2 + dev-libs/libxslt + sys-apps/util-linux + sys-libs/zlib + alsa? ( media-libs/alsa-lib ) + bluetooth? ( net-wireless/bluez:= ) + calendar? ( + net-libs/neon:= + dev-libs/libical:= + dev-libs/iksemel + ) + caps? ( sys-libs/libcap ) + blocks? ( sys-libs/blocksruntime ) + cluster? ( sys-cluster/corosync ) + codec2? ( media-libs/codec2:= ) + curl? ( net-misc/curl ) + dahdi? ( + net-libs/libpri + net-misc/dahdi-tools + ) + freetds? ( dev-db/freetds ) + gtalk? ( dev-libs/iksemel ) + http? ( dev-libs/gmime:2.6 ) + iconv? ( virtual/libiconv ) + ilbc? ( media-libs/libilbc ) + ldap? ( net-nds/openldap ) + lua? ( ${LUA_DEPS} ) + mysql? ( dev-db/mysql-connector-c:= ) + newt? ( dev-libs/newt ) + odbc? ( dev-db/unixODBC ) + pjproject? ( >=net-libs/pjproject-2.9:= ) + portaudio? ( media-libs/portaudio ) + postgres? ( dev-db/postgresql:* ) + radius? ( net-dialup/freeradius-client ) + snmp? ( net-analyzer/net-snmp:= ) + span? ( media-libs/spandsp ) + speex? ( + media-libs/libogg + media-libs/speex + media-libs/speexdsp + ) + srtp? ( net-libs/libsrtp:0 ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + systemd? ( sys-apps/systemd ) + !systemd? ( !sys-apps/systemd ) + unbound? ( net-dns/unbound ) + vorbis? ( + media-libs/libogg + media-libs/libvorbis + ) + voicemail_storage_imap? ( virtual/imap-c-client ) + xmpp? ( dev-libs/iksemel ) +" + +RDEPEND="${DEPEND} + net-misc/asterisk-core-sounds + net-misc/asterisk-extra-sounds + net-misc/asterisk-moh-opsound + selinux? ( sec-policy/selinux-asterisk ) + syslog? ( virtual/logger )" + +BDEPEND="dev-libs/libxml2:2 + virtual/pkgconfig" + +QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+" + +_make_args=( + "NOISY_BUILD=yes" + "ASTDBDIR=\$(ASTDATADIR)/astdb" + "ASTCACHEDIR=/var/cache/asterisk" + "OPTIMIZE=" + "DEBUG=" + "DESTDIR=${D}" + "CONFIG_SRC=configs/samples" + "CONFIG_EXTEN=.sample" +) + +pkg_pretend() { + CONFIG_CHECK="~!NF_CONNTRACK_SIP" + local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users + have reported that this module dropped critical SIP packets in their deployments. You + may want to disable it if you see such problems." + check_extra_config + + [[ "${MERGE_TYPE}" == binary ]] && return + + if tc-is-clang; then + use blocks || die "CC=clang requires USE=blocks" + else + use blocks && die "USE=blocks can only be used with CC=clang" + fi +} + +pkg_setup() { + use lua && lua-single_pkg_setup +} + +src_prepare() { + default + AT_M4DIR="autoconf third-party third-party/pjproject third-party/jansson" eautoreconf +} + +src_configure() { + local vmst + local copt cstate + + econf \ + LUA_VERSION="${ELUA#lua}" \ + --libdir="/usr/$(get_libdir)" \ + --localstatedir="/var" \ + --with-crypto \ + --with-gsm=internal \ + --with-popt \ + --with-z \ + --with-libedit \ + --without-jansson-bundled \ + --without-pjproject-bundled \ + $(use_with caps cap) \ + $(use_with codec2) \ + $(use_with lua lua) \ + $(use_with http gmime) \ + $(use_with newt) \ + $(use_with pjproject) \ + $(use_with portaudio) \ + $(use_with ssl) \ + $(use_with unbound) + + _menuselect() { + menuselect/menuselect "$@" || die "menuselect $* failed." + } + + _use_select() { + local state=$(use "$1" && echo enable || echo disable) + shift # remove use from parameters + + while [[ -n $1 ]]; do + _menuselect --${state} "$1" menuselect.makeopts + shift + done + } + + # Blank out sounds/sounds.xml file to prevent + # asterisk from installing sounds files (we pull them in via + # asterisk-{core,extra}-sounds and asterisk-moh-opsound. + >"${S}"/sounds/sounds.xml + + # That NATIVE_ARCH chatter really is quite bothersome + sed -i 's/NATIVE_ARCH=/NATIVE_ARCH=0/' build_tools/menuselect-deps || die "Unable to squelch noisy build system" + + # Compile menuselect binary for optional components + emake "${_make_args[@]}" menuselect.makeopts + + # Disable BUILD_NATIVE (bug #667498) + _menuselect --disable build_native menuselect.makeopts + + # Broken functionality is forcibly disabled (bug #360143) + _menuselect --disable chan_misdn menuselect.makeopts + _menuselect --disable chan_ooh323 menuselect.makeopts + + # Utility set is forcibly enabled (bug #358001) + _menuselect --enable smsq menuselect.makeopts + _menuselect --enable streamplayer menuselect.makeopts + _menuselect --enable aelparse menuselect.makeopts + _menuselect --enable astman menuselect.makeopts + + # this is connected, otherwise it would not find + # ast_pktccops_gate_alloc symbol + _menuselect --enable chan_mgcp menuselect.makeopts + _menuselect --enable res_pktccops menuselect.makeopts + + # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available + _menuselect --enable pbx_dundi menuselect.makeopts + _menuselect --enable func_aes menuselect.makeopts + _menuselect --enable chan_iax2 menuselect.makeopts + + # SQlite3 is now the main database backend, enable related features + _menuselect --enable cdr_sqlite3_custom menuselect.makeopts + _menuselect --enable cel_sqlite3_custom menuselect.makeopts + + # The others are based on USE-flag settings + _use_select alsa chan_alsa + _use_select bluetooth chan_mobile + _use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar} + _use_select cluster res_corosync + _use_select codec2 codec_codec2 + _use_select curl func_curl res_config_curl res_curl + _use_select dahdi app_dahdiras app_meetme chan_dahdi codec_dahdi res_timing_dahdi + _use_select deprecated app_macro + _use_select freetds {cdr,cel}_tds + _use_select gtalk chan_motif + _use_select http res_http_post + _use_select iconv func_iconv + _use_select ilbc codec_ilbc format_ilbc + _use_select ldap res_config_ldap + _use_select lua pbx_lua + _use_select mysql app_mysql cdr_mysql res_config_mysql + _use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc + _use_select oss chan_oss + _use_select postgres {cdr,cel}_pgsql res_config_pgsql + _use_select radius {cdr,cel}_radius + _use_select snmp res_snmp + _use_select span res_fax_spandsp + _use_select speex {codec,func}_speex + _use_select speex format_ogg_speex + _use_select srtp res_srtp + _use_select statsd res_statsd res_{endpoint,chan}_stats + _use_select syslog cdr_syslog + _use_select vorbis format_ogg_vorbis + _use_select xmpp res_xmpp + + # Voicemail storage ... + _menuselect --enable app_voicemail menuselect.makeopts + for vmst in "${IUSE_VOICEMAIL_STORAGE[@]}"; do + if use "${vmst#+}"; then + _menuselect --enable "app_voicemail_${vmst##*_}" menuselect.makeopts + fi + done + + if use debug; then + for o in DONT_OPTIMIZE DEBUG_FD_LEAKS MALLOC_DEBUG BETTER_BACKTRACES; do + _menuselect --enable "${o}" menuselect.makeopts + done + fi + + if [[ -n "${GENTOO_ASTERISK_CUSTOM_MENUSELECT:+yes}" ]]; then + for copt in ${GENTOO_ASTERISK_CUSTOM_MENUSELECT}; do + cstate=--enable + [[ "${copt}" == -* ]] && cstate=--disable + ebegin "Custom option ${copt#[-+]} ${cstate:2}d" + _menuselect ${cstate} "${copt#[-+]}" + eend $? + done + fi +} + +src_compile() { + emake "${_make_args[@]}" +} + +src_install() { + local d + + dodir "/usr/$(get_libdir)/pkgconfig" + + diropts -m 0750 -o root -g asterisk + dodir /etc/asterisk + + emake "${_make_args[@]}" install install-headers install-configs + + fowners asterisk: /var/lib/asterisk/astdb + + if use radius; then + insinto /etc/radiusclient/ + doins contrib/dictionary.digium + fi + + # keep directories + diropts -m 0750 -o asterisk -g root + keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail,recording} + diropts -m 0750 -o asterisk -g asterisk + keepdir /var/log/asterisk/{cdr-csv,cdr-custom} + + newinitd "${FILESDIR}"/initd-16.16.2-r1 asterisk + newconfd "${FILESDIR}"/confd-16.16.2-r1 asterisk + + systemd_dounit "${FILESDIR}"/asterisk.service + newtmpfiles "${FILESDIR}"/asterisk.tmpfiles3.conf asterisk.conf + systemd_install_serviced "${FILESDIR}"/asterisk.service.conf + + # Reset diropts else dodoc uses it for doc installations. + diropts -m0755 + + # install the upgrade documentation + dodoc UPGRADE* BUGS CREDITS + + # install extra documentation + use doc && dodoc doc/*.{txt,pdf} + + # install logrotate snippet; bug #329281 + # + insinto /etc/logrotate.d + newins "${FILESDIR}/1.6.2/asterisk.logrotate4" asterisk + + # Asterisk installs a few folders that's empty by design, + # but still required. This finds them, and marks them for + # portage. + while read d < <(find "${ED}"/var -type d -empty || die "Find failed."); do + keepdir "${d#${ED}}" + done +} + +pkg_postinst() { + if [ -z "${REPLACING_VERSIONS}" ]; then + elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/" + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net" + elif [ "$(ver_cut 1 "${REPLACING_VERSIONS}")" != "$(ver_cut 1)" ]; then + elog "You are updating from Asterisk $(ver_cut 1 "${REPLACING_VERSIONS}") upgrade document:" + elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+$(ver_cut 1)" + elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net" + fi + + if use deprecated; then + ewarn "You really aught to port whatever code you have that depends on this since these are going to go away." + ewarn "Refer: https://wiki.asterisk.org/wiki/display/AST/Module+Deprecation" + fi + + if [[ -n "${GENTOO_ASTERISK_CUSTOM_MENUSELECT:+yes}" ]]; then + ewarn "You are using GENTOO_ASTERISK_CUSTOM_MENUSELECT, this should only be used" + ewarn "for debugging, for anything else, please file a bug on https://bugs.gentoo.org" + fi + + if [[ -f /var/lib/asterisk/astdb.sqlite3 ]]; then + ewarn "Default astdb location has changed from /var/lib/asterisk to /var/lib/asterisk/astdb" + ewarn "You still have a /var/lib/asterisk/astdb.sqlite file. You need to either set" + ewarn "astdbdir in /etc/asterisk/asterisk.conf to /var/lib/asterisk or follow these" + ewarn "steps to migrate:" + ewarn "1. /etc/init.d/asterisk stop" + ewarn "2. mv /var/lib/asterisk/astdb.sqlite /var/lib/asterisk/astdb/" + ewarn "3. /etc/init.d/asterisk start" + ewarn "This update was done partly for security reasons so that /var/lib/asterisk can be root owned." + fi +} diff --git a/net-misc/asterisk/files/asterisk-13.38.2-r1-menuselect-exitcodes.patch b/net-misc/asterisk/files/asterisk-13.38.2-r1-menuselect-exitcodes.patch new file mode 100644 index 000000000000..90c97e9df5e3 --- /dev/null +++ b/net-misc/asterisk/files/asterisk-13.38.2-r1-menuselect-exitcodes.patch @@ -0,0 +1,67 @@ +From 840eaa67e1ee0d10aa6bfb1e34659efa3095b772 Mon Sep 17 00:00:00 2001 +From: Jaco Kroon +Date: Sat, 13 Mar 2021 13:01:50 +0200 +Subject: [PATCH] menuselect: exit non-zero in case of failure on + --enable|disable options. + +Change-Id: I77e3466435f5a51a57538b29addb68d811af238d +Signed-off-by: Jaco Kroon +--- + menuselect/menuselect.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/menuselect/menuselect.c b/menuselect/menuselect.c +index 2eea3f09eb..adb6fa1777 100644 +--- a/menuselect/menuselect.c ++++ b/menuselect/menuselect.c +@@ -2090,6 +2090,7 @@ int main(int argc, char *argv[]) + /* Reset options processing */ + option_index = 0; + optind = 1; ++ res = 0; + + while ((c = getopt_long(argc, argv, "", long_options, &option_index)) != -1) { + print_debug("Got option %c\n", c); +@@ -2100,6 +2101,7 @@ int main(int argc, char *argv[]) + set_member_enabled(mem); + } else { + fprintf(stderr, "'%s' not found\n", optarg); ++ res = 1; + } + } + break; +@@ -2109,6 +2111,7 @@ int main(int argc, char *argv[]) + set_all(cat, 1); + } else { + fprintf(stderr, "'%s' not found\n", optarg); ++ res = 1; + } + } + break; +@@ -2123,6 +2126,7 @@ int main(int argc, char *argv[]) + clear_member_enabled(mem); + } else { + fprintf(stderr, "'%s' not found\n", optarg); ++ res = 1; + } + } + break; +@@ -2132,6 +2136,7 @@ int main(int argc, char *argv[]) + set_all(cat, 0); + } else { + fprintf(stderr, "'%s' not found\n", optarg); ++ res = 1; + } + } + break; +@@ -2146,7 +2151,6 @@ int main(int argc, char *argv[]) + break; + } + } +- res = 0; + } + + if (!res) { +-- +2.26.2 + diff --git a/net-misc/asterisk/files/asterisk-16.16.2-no-var-run-install.patch b/net-misc/asterisk/files/asterisk-16.16.2-no-var-run-install.patch index 63b2896bb097..cde9ea0e15ae 100644 --- a/net-misc/asterisk/files/asterisk-16.16.2-no-var-run-install.patch +++ b/net-misc/asterisk/files/asterisk-16.16.2-no-var-run-install.patch @@ -5,7 +5,7 @@ NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h)) OLDHEADERS=$(filter-out $(NEWHEADERS) $(notdir $(DESTDIR)$(ASTHEADERDIR)),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h))) -INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTCACHEDIR)" "$(ASTETCDIR)" "$(ASTVARRUNDIR)" \ -+INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTCACHEDIR)" "$(ASTETCDIR)" \ ++INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTETCDIR)" \ "$(ASTSPOOLDIR)" "$(ASTSPOOLDIR)/dictate" "$(ASTSPOOLDIR)/meetme" \ "$(ASTSPOOLDIR)/monitor" "$(ASTSPOOLDIR)/system" "$(ASTSPOOLDIR)/tmp" \ "$(ASTSPOOLDIR)/voicemail" "$(ASTSPOOLDIR)/recording" \ diff --git a/net-misc/asterisk/files/asterisk.tmpfiles3.conf b/net-misc/asterisk/files/asterisk.tmpfiles3.conf new file mode 100644 index 000000000000..7af4ed720d43 --- /dev/null +++ b/net-misc/asterisk/files/asterisk.tmpfiles3.conf @@ -0,0 +1,2 @@ +d /var/run/asterisk 0750 asterisk asterisk +d /var/cache/asterisk 0750 asterisk asterisk diff --git a/net-misc/asterisk/files/confd-16.16.2-r1 b/net-misc/asterisk/files/confd-16.16.2-r1 new file mode 100644 index 000000000000..a2da978af924 --- /dev/null +++ b/net-misc/asterisk/files/confd-16.16.2-r1 @@ -0,0 +1,171 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# +# Additional options for asterisk +# +# see "asterisk -h" for a list of options +# +# No default. +# +#ASTERISK_OPTS="" + +# +# User and group to run asterisk as +# +# Value: double-colon separated list of user and group, or empty to run as root: +# +# +# "asterisk:asterisk" to run as user "asterisk" and group "asterisk" +# "asterisk" to run as user "asterisk" and all groups that user "asterisk" is a member of +# ":asterisk" to run as user "root" and group "asterisk" +# +# Default: asterisk +# +#ASTERISK_USER="asterisk" + +# +# Nicelevel +# +# Set the priority of the asterisk process +# +# Value: (highest) -20..19 (lowest) +# +# No default (leave scheduling to be system default). +# +#ASTERISK_NICE="19" + +# Send crash notifications emails to this address +# (needs a working mail service and /usr/sbin/sendmail to do so (e.g. ssmtp)) +# +# Value: Email address or empty to disable +# +# No default. +# +#ASTERISK_NOTIFY_EMAIL="root" + +# +# Send asterisk's output to this terminal +# +# Value: Full path to device node or a number +# +# No default. +# +#ASTERISK_TTY="/dev/tty9" + +# +# Start an asterisk console on the terminal specified by ASTERISK_TTY +# +# Warning! Use only for debugging, this is a potential security issue! +# +# Value: yes/no +# +# Default: no +# +#ASTERISK_CONSOLE="no" + +# +# Maximum size of core files. +# +# Value: Size in bytes, unlimited for no limit or empty to disable. +# +# Default: do not generate core dumps +# +#ASTERISK_CORE_SIZE="unlimited" + +# +# ASTERISK_CORE_DIR +# +# Value: Directory (will be created if non-existant). +# +# Default: /tmp +# +#ASTERISK_CORE_DIR="/var/lib/asterisk/core" + +# +# Max number of filedescriptors. asterisk can trivially run out of +# descriptors. In most (SIP) cases it uses at least four descriptors per call, +# and this is a conservative value. +# +# Value: Number of descriptors +# +# Default: leave system default in place. +# +ASTERISK_MAX_FD="4096" + +# +# Delay time before restarting asterisk after a crash. +# +# Value: Number of seconds to sleep after a crash before restarting. +# +# Default: 5 +# +#ASTERISK_RESTART_DELAY=5 + +# +# The stop mechanism to use. Asterisk can do gracefully, when convenient or now. +# By default we expect you to want to stop as soon as possible, so we default +# +# Default: gracefully +# +#ASTERISK_STOP_METHOD="when convenient" + +# +# By default the init script waits two minutes for asterisk to stop. This allows +# you to change that, or even completely disable and go into wait for ever mode (-1). +# The value here is in seconds. +# +# Default: 120 +# +#ASTERISK_STOP_TIMEOUT=-1 + +# +# Kill these tasks after asterisk crashed +# +# Warning! This will kill _ALL_ tasks with the specified names! +# +# Value: Space separated list of names in double quotes (e.g. "mpg123 mad") +# +# Default is to not do stupid things like killing random processes. +# +#ASTERISK_CLEANUP_ON_CRASH="mpg123 asterisk-mpg123 mad" + +# +# ASTERISK_CONFDIR +# +# If you'd like an alternative folder to /etc/${RC_SVCNAME} to be used +# (typically /etc/asterisk) to be used for configuration. +# +# Default: /etc/${RC_SVCNAME} +# +#ASTERISK_CONFDIR="/etc/foo/bar" + +# ASTERISK_CACHEDIR +# +# Value: Directory to which astcachedir in asterisk.conf is set. +# +# Default: /var/cache/asterisk +# +#ASTERISK_CACHEDIR="/var/cache/asterisk" + + +# +# Normally the init script will not wait for asterisk to fully boot. With this +# setting set to yes/true/1 it will issue a "core waitfullybooted" directly +# after starting asterisk, and wait for asterisk to start up completely. This +# is useful in certain conditions where other software requires asterisk to be +# properly started before they themselves can be started. +# +# Default: no +# +#ASTERISK_WAITBOOTED=yes + +# +# When core-dumping, the default was to generate core-$(date +%Y%m%d-%H%M%S). +# In certain highly unusual configurations it's helpful to also get the +# hostname into this filename. By enabling this option the wrapper loop will +# adjust the core file to be named core-$(hostname)-$(date ...). +# +# Default: no +# +#ASTERISK_CORE_USEHOSTNAME=yes diff --git a/net-misc/asterisk/files/initd-16.16.2-r1 b/net-misc/asterisk/files/initd-16.16.2-r1 new file mode 100644 index 000000000000..bdd979a56978 --- /dev/null +++ b/net-misc/asterisk/files/initd-16.16.2-r1 @@ -0,0 +1,363 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="forcestop reload" + +depend() { + need net + use nscd dns dahdi mysql postgresql slapd capi +} + +is_running() { + [ -r "${ast_rundir}/asterisk.pid" ] || return 1 + PID="$(cat "${ast_rundir}/asterisk.pid")" + [ -d "/proc/${PID}" ] || return 1 + EXE="$(readlink -f /proc/${PID}/exe)" + EXE="${EXE% (deleted)}" # in case asterisk got upgraded and we're still looking at an old one. + [ "${EXE}" = /usr/sbin/asterisk ] || return 1 # pid got re-used for another process. + + # PID reported in pidfile is active, and is still an asterisk instance. + return 0 +} + +# Sets up a few variables for us for use +# ast_instancename: eg, asterisk when RC_SVCNAME=asterisk, or asterisk(foo) when asterisk.foo. +# ast_rundir: directory to be used as run folder (pid and ctl files). +setup_svc_variables() +{ + local t + + ast_instancename=asterisk + ast_rundir=/var/run/${RC_SVCNAME} + ast_logdir=/var/log/${RC_SVCNAME} + ast_confdir=/etc/${RC_SVCNAME/.//} + ast_cachedir=/var/cache/asterisk + ast_stop_timeout=120 + ast_stop_method="gracefully" + + if [ "${RC_SVCNAME}" != "asterisk" ]; then + t="${RC_SVCNAME#asterisk.}" + if [ "${RC_SVCNAME}" = "${t}" ]; then + eerror "Invalid SVCNAME of ${RC_SVCNAME}, must be of the format asterisk.name." + return 1 + fi + ast_instancename+="(${t})" + fi + + [ -n "${ASTERISK_RUNDIR}" ] && ast_rundir="${ASTERISK_RUNDIR}" + [ -n "${ASTERISK_LOGDIR}" ] && ast_logdir="${ASTERISK_LOGDIR}" + [ -n "${ASTERISK_CONFDIR}" ] && ast_confdir="${ASTERISK_CONFDIR}" + [ -n "${ASTERISK_CACHEDIR}" ] && ast_confdir="${ASTERISK_CACHEDIR}" + [ -n "${ASTERISK_STOP_TIMEOUT}" ] && ast_stop_timeout="${ASTERISK_STOP_TIMEOUT}" + case "${ASTERISK_STOP_METHOD}" in + gracefully|when\ convenient|now) + ast_stop_method="${ASTERISK_STOP_METHOD}" + ;; + esac + ast_group= + if [ -n "${ASTERISK_USER}" ]; then + ast_user="${ASTERISK_USER%%:*}" + if [ "${ast_user}" != "${ASTERISK_USER}" ]; then + ast_group="${ASTERISK_USER#*:}" + ast_group="${ast_group%%:*}" + fi + fi + + [ -z "${ast_user}" ] && ast_user=asterisk + + ast_pgroup="$(getent group $(getent passwd "${ast_user}" | awk -F: '{ print $4 }') | sed -re 's/:.*//')" + + return 0 +} + +asterisk_run_loop() { + local result=0 signal=0 + + echo "Initializing ${ast_instancename} wrapper" + OPTS="$*" + + trap "rm -f '${ast_rundir}/wrapper_loop.running'" EXIT + touch "${ast_rundir}/wrapper_loop.running" + + while [ -r "${ast_rundir}/wrapper_loop.running" ]; do + if [ -n "${TTY}" ]; then + /usr/bin/stty -F "${TTY}" sane + ${NICE} /usr/sbin/asterisk -C "${ast_confdir}/asterisk.conf" ${OPTS} >"${TTY}" 2>&1 <"${TTY}" + result=$? + else + ${NICE} /usr/sbin/asterisk -C "${ast_confdir}/asterisk.conf" ${OPTS} >/dev/null 2>&1 + result=$? + fi + + if [ "$result" -eq 0 ]; then + echo "Asterisk terminated normally" + break + else + if [ "$result" -gt 128 ]; then + signal="$(expr "$result" - 128)" + MSG="Asterisk terminated with Signal: $signal" + + CORE_TARGET="core-" + yesno "${ASTERISK_CORE_USEHOSTNAME}" && CORE_TARGET+="$(hostname)-" + CORE_TARGET+="$(date "+%Y%m%d-%H%M%S")" + + local CORE_DUMPED=0 + if [ -f "${ASTERISK_CORE_DIR}/core" ]; then + mv "${ASTERISK_CORE_DIR}/core" \ + "${ASTERISK_CORE_DIR}/${CORE_TARGET}" + CORE_DUMPED=1 + + elif [ -f "${ASTERISK_CORE_DIR}/core.${PID}" ]; then + mv "${ASTERISK_CORE_DIR}/core.${PID}" \ + "${ASTERISK_CORE_DIR}/${CORE_TARGET}" + CORE_DUMPED=1 + + fi + + [ $CORE_DUMPED -eq 1 ] && \ + MSG="${MSG}\n\rCore dumped: ${ASTERISK_CORE_DIR}/${CORE_TARGET}" + else + MSG="Asterisk terminated with return code: $result" + fi + + # kill left-over tasks + for X in ${ASTERISK_CLEANUP_ON_CRASH}; do + kill -9 "$(pidof "${X}")"; + done + fi + + [ -n "${TTY}" ] \ + && echo "${MSG}" >"${TTY}" \ + || echo "${MSG}" + + + if [ -n "${ASTERISK_NOTIFY_EMAIL}" ] && \ + [ -x /usr/sbin/sendmail ]; then + echo -e -n "Subject: Asterisk crashed\r\n${MSG}\r\n" |\ + /usr/sbin/sendmail "${ASTERISK_NOTIFY_EMAIL}" + fi + sleep "${ASTERISK_RESTART_DELAY}" + echo "Restarting Asterisk..." + done + + echo "Terminating wrapper loop." + return 0 +} + +start() { + local OPTS PID + local tmp x + + local OPTS ARGS + + setup_svc_variables || return $? + + ebegin "Starting ${ast_instancename} PBX" + + eindent + + # filter (redundant) arguments + OPTS="$(echo "${ASTERISK_OPTS}" | sed -re "s:-[cfF]::g")" + + # default options + OPTS="${OPTS} -f" # don't fork / detach breaks wrapper script... + + # ensure that ASTERISK_RESTART_DELAY is integer. + ASTERISK_RESTART_DELAY="$(echo "${ASTERISK_RESTART_DELAY}" | sed -re 's/^([0-9]*).*/\1/')" + [ -z "${ASTERISK_RESTART_DELAY}" ] && ASTERISK_RESTART_DELAY=5 + + if [ -n "${ASTERISK_CORE_SIZE}" ] && + [ "${ASTERISK_CORE_SIZE}" != "0" ]; then + ulimit -c ${ASTERISK_CORE_SIZE} + + if [ -n "${ASTERISK_CORE_DIR}" ] && \ + [ ! -d "${ASTERISK_CORE_DIR}" ] + then + checkpath -d -m 0755 -o ${ast_user}:${ast_group} "${ASTERISK_CORE_DIR}" + fi + ASTERISK_CORE_DIR="${ASTERISK_CORE_DIR:-/tmp}" + + cd "${ASTERISK_CORE_DIR}" + einfo "Core dump size : ${ASTERISK_CORE_SIZE}" + einfo "Core dump location : ${ASTERISK_CORE_DIR}" + + OPTS="${OPTS} -g" + fi + + if [ -n "${ASTERISK_MAX_FD}" ]; then + ulimit -n ${ASTERISK_MAX_FD} + einfo "Max open filedescriptors : ${ASTERISK_MAX_FD}" + fi + + if [ -n "${ASTERISK_NICE}" ]; then + if [ ${ASTERISK_NICE} -ge -20 ] && \ + [ ${ASTERISK_NICE} -le 19 ]; then + einfo "Nice level : ${ASTERISK_NICE}" + NICE="nice -n ${ASTERISK_NICE} --" + else + eerror "Nice value must be between -20 and 19" + return 1 + fi + else + NICE="" + fi + + if [ -n "${ASTERISK_NOTIFY_EMAIL}" ]; then + if [ -x /usr/sbin/sendmail ]; then + einfo "Email notifications go to : ${ASTERISK_NOTIFY_EMAIL}" + else + ewarn "Notifications disabled, /usr/sbin/sendmail doesn't exist or is not executable!" + unset ASTERISK_NOTIFY_EMAIL + fi + fi + + if [ -n "${ASTERISK_TTY}" ]; then + for x in "${ASTERISK_TTY}" \ + "/dev/tty${ASTERISK_TTY}" \ + "/dev/vc/${ASTERISK_TTY}" + do + if [ -c "${x}" ]; then + TTY="${x}" + fi + done + [ -n "${TTY}" ] && \ + einfo "Messages are sent to : ${TTY}" + fi + + if yesno "${ASTERISK_CONSOLE}" && [ -n "${TTY}" ]; then + einfo "Starting Asterisk console : Yes" + OPTS="${OPTS} -c" + fi + + if ! getent passwd "${ast_user}" &>/dev/null; then + eerror "Requested to run asterisk as ${ast_user}, which doesn't exist." + return 1 + fi + OPTS="${OPTS} -U ${ast_user}" + + if [ -n "${ast_group}" ] && ! getent group "${ast_group}" &>/dev/null; then + eerror "Requested to run ${ast_instancename} with group ${ast_group}, which doesn't exist." + return 1 + fi + [ -n "${ast_group}" ] && OPTS="${OPTS} -G ${ast_group}" + + if [ "${ast_user}" = root ]; then + ewarn "Starting asterisk as root is not recommended (SERIOUS SECURITY CONSIDERATIONS)." + elif [ "${ast_group}" = root ]; then + ewarn "Starting asterisk with group root is not recommended (SERIOUS SECURITY CONSIDERATIONS)." + fi + + checkpath -d -m 0755 -o "${ast_user}:${ast_group}" "${ast_logdir}" "${ast_rundir}" + checkpath -d -m 0750 -o "${ast_user}:${ast_group}" "${ast_cachedir}" + + einfo "Starting asterisk as : ${ast_user}:${ast_group:-${ast_pgroup} (+supplementaries)}" + asterisk_run_loop ${OPTS} 2>&1 | logger -t "wrapper:${ast_instancename}" &>/dev/null & + result=$? + + if [ $result -eq 0 ]; then + # 2 seconds should be enough for asterisk to start + sleep 2 + is_running + result=$? + + [ $result -eq 0 ] || wrapperstop + fi + + eoutdent + eend $result + + if [ $result -eq 0 ] && yesno "${ASTERISK_WAITBOOTED}"; then + if [ ! -r "${ast_rundir}/asterisk.ctl" ]; then + # asterisk can crash during startup ... + ebegin "Waiting for ctl file to appear" + while is_running && [ ! -r "${ast_rundir}/asterisk.ctl" ]; do + sleep 1 + done + is_running + result=$? + eend $result + fi + if [ $result -eq 0 ]; then + ebegin "Waiting for ${ast_instancename} to fully boot" + /usr/sbin/asterisk -C "${ast_confdir}/asterisk.conf" -r -x "core waitfullybooted" &>/dev/null + eend $? + fi + fi + + return $result +} + +wrapperstop() { + # Accomodate system upgrades (so a previous version of the wrapper script that still uses a pid file may be running). + if [ -r "${ast_rundir}/wrapper_loop.pid" ]; then + ebegin "Killing ${ast_instancename} wrapper script" + kill "$(cat /var/run/asterisk/wrapper_loop.pid)" + eend $? + fi + + # The new one (due to "hardened" requirements) uses a simpler + # flag to indicate running or shutting down. + if [ -r "${ast_rundir}/wrapper_loop.running" ]; then + ebegin "Signalling ${ast_instancename} wrapper script to terminate" + rm "${ast_rundir}/wrapper_loop.running" + eend $? + fi + + return 0 +} + +forcestop() { + setup_svc_variables || return $? + + # Just to be sure - when we want to forcestop we should make it all tear down. + wrapperstop + + ebegin "Stopping ${ast_instancename} PBX" + start-stop-daemon --stop --pidfile /var/run/asterisk/asterisk.pid + eend $? +} + +stop() { + setup_svc_variables || return $? + + wrapperstop + + if ! is_running; then + eerror "${ast_instancename} is not running!" + return 0 + fi + + ebegin "Stopping ${ast_instancename} PBX ${ast_stop_method}" + /usr/sbin/asterisk -C "${ast_confdir}/asterisk.conf" -r -x "core stop ${ast_stop_method}" &>/dev/null + # Now we have to wait until asterisk has _really_ stopped. + sleep 1 + if is_running; then + einfon "Waiting for ${ast_instancename} to shutdown ." + local cnt=0 + while is_running; do + cnt="$(expr $cnt + 2)" + if [ ${ast_stop_timeout} -gt 0 -a $cnt -gt ${ast_stop_timeout} ] ; then + echo + eend 1 "Failed waiting for ${ast_instancename} to stop." + return 1 + fi + sleep 2 + echo -n "." + done + echo + fi + eend 0 +} + +reload() { + setup_svc_variables || return $? + + if is_running; then + ebegin "Forcing ${ast_instancename} to reload configuration" + /usr/sbin/asterisk -C "${ast_confdir}/asterisk.conf" -r -x "module reload" &>/dev/null + eend $? + else + eerror "${ast_instancename} is not running!" + fi +} diff --git a/net-misc/asterisk/metadata.xml b/net-misc/asterisk/metadata.xml index 9951bd05d61a..730a8e858f29 100644 --- a/net-misc/asterisk/metadata.xml +++ b/net-misc/asterisk/metadata.xml @@ -1,11 +1,11 @@ - + jaco@uls.co.za Jaco Kroon - + proxy-maint@gentoo.org Proxy Maintainers @@ -13,7 +13,8 @@ Utlize -fblocks (only supported by, and required when using, clang/LLVM) Enable high-availability support through the Corosync Cluster Engine Enable Codec2 support in asterisk - Support Digium compatible hardware (formerly known as Zaptel). + Support Digium compatible hardware (formerly known as Zaptel) + Enable deprecated features (eg, app_macro) Enable support for Google Talk services Enable embedded web server Enable the Internet Low Bitrate Codec (iLBC) -- cgit v1.2.3