summaryrefslogtreecommitdiff
path: root/net-misc
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/Manifest.gzbin54756 -> 54755 bytes
-rw-r--r--net-misc/asterisk/Manifest6
-rw-r--r--net-misc/asterisk/asterisk-18.20.2.ebuild362
-rw-r--r--net-misc/asterisk/asterisk-20.5.2.ebuild358
-rw-r--r--net-misc/asterisk/asterisk-21.0.2.ebuild345
-rw-r--r--net-misc/curl/Manifest12
-rw-r--r--net-misc/curl/curl-8.5.0-r1.ebuild (renamed from net-misc/curl/curl-8.3.0-r2.ebuild)34
-rw-r--r--net-misc/curl/curl-8.5.0-r2.ebuild367
-rw-r--r--net-misc/curl/curl-9999.ebuild3
-rw-r--r--net-misc/curl/files/curl-8.3.0-CVE-2023-38545.patch136
-rw-r--r--net-misc/curl/files/curl-8.3.0-CVE-2023-38546.patch131
-rw-r--r--net-misc/curl/files/curl-8.3.0-tests-arm-musl.patch115
-rw-r--r--net-misc/curl/files/curl-8.5.0-ipv6-configure-c99.patch31
-rw-r--r--net-misc/curl/files/curl-8.5.0-mpd-stream-http-adjust_pollset.patch69
-rw-r--r--net-misc/rsync/Manifest2
-rw-r--r--net-misc/rsync/files/rsync-3.2.7-ipv6-configure-c99.patch32
-rw-r--r--net-misc/rsync/rsync-3.2.7-r4.ebuild205
17 files changed, 1802 insertions, 406 deletions
diff --git a/net-misc/Manifest.gz b/net-misc/Manifest.gz
index 0a4b2f0ab0b6..2c2f2e176136 100644
--- a/net-misc/Manifest.gz
+++ b/net-misc/Manifest.gz
Binary files differ
diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest
index 90776044fd04..4861df13b200 100644
--- a/net-misc/asterisk/Manifest
+++ b/net-misc/asterisk/Manifest
@@ -15,13 +15,19 @@ DIST asterisk-16.30.1.tar.gz 28234979 BLAKE2B a9cd732feb00408876f90328d7f14dbfe4
DIST asterisk-18.17.0.tar.gz 28293243 BLAKE2B 8a162d7cac92df2b6dd430fedc1446a302b1b9c1061ddd4a236fd5797e8be17d53d7179d23a7c8bd4260c73d34dea2db2b9ebffd4eebb2ed714a286838bc5ddf SHA512 1a5dd9715811a8b699d49b057ef42f68ddc88cc22a568836a6a778f6ff22d3923f81840aef425819bb59f28bb27e321154ef9e1d3deba5ed7d39c7eca562e40e
DIST asterisk-18.18.0.tar.gz 28407407 BLAKE2B 2e49da8b93651268e2aa2f7f5e2b8ffb2f74c39eb74a4514593be39826912774584c4c33f3839a951ec068218e8db43153fee0a543a9adb94a90cc9338ad40c3 SHA512 bf3d73ef5b6a196d599771c913ae95596b0bfae8fc35cdf66181d7b56ffb4bd78078e25627e271c62988ed6342e69162a1f120cae6049dda6f1596d0759bee59
DIST asterisk-18.18.1.tar.gz 28407009 BLAKE2B b3c3325a8958fa25364c735508357e35e4ad3ea2390b4f83d7b132c4263b2b0b56a65abab60f337e55cbc3edd4df580f3904164ba76abd4198ce1be112c93d38 SHA512 d5058399beffd2f74a17b0fdcc97720e08540383facb2f3691376cb2086e3d2f8df5b0c9110699d09cffe1ed6b2fbdfe9926d0698af0fce39c6c0a9bb4643d30
+DIST asterisk-18.20.2.tar.gz 28448635 BLAKE2B 9949033f93d770673e80a86cd48a084da853d0cbb51aa50159e813653bb39efd062772331aeb5d127f0c1c58724d9c6d748d45a2e0803f276e83bc804b942c2c SHA512 3ee44047a2d9823550b031933b709e8fd7d6a2a0a4cfb2221187da0983f8d22e411b93fde22934753ae9a7272390c7feebc8addabf7e0943eb57ae7f2fa71b3c
DIST asterisk-20.3.0.tar.gz 28176546 BLAKE2B 488cfe449c040c282afe438847d14f6cc20d1fb034fbb33555f8e43803b481d3f2b890ac01cc7d43278b41040093f8cedfc609c025cfab73fd8b9d23a0f67016 SHA512 332c24c089abca7059d80794b37a4f5dc34f0468a07f5534b0df26c5103e0508c9c5f3f35a02826ed6b33973c26503be2829fd51fa23a8056a58fa2b50b17730
DIST asterisk-20.3.1.tar.gz 28176262 BLAKE2B 9ee75ee297dc4df37f51f75444d46af083b794cb444ae77b601f17308889db22240939edf04761eb3d41e74e2a67a3329d427861a5a5d34fec6016d6660793bd SHA512 4e34de731211aebe916d19948c41aff370187bfadc1202837a96ebc7f218e5bd7c3936b5b4e34ba6e79c079f77eb5ed038239c903800d5a56ceda2f342218613
+DIST asterisk-20.5.2.tar.gz 28215394 BLAKE2B d9baddc5b2134fd8d7c23dc1407abc37ee937f4dc3ac6dacca43126e0f3ee45b5eca1b8a66834e267d8bb02eb35c8b2e73d854b0a234a85f2dc4048b9d1c4a99 SHA512 ff2d6ddd5b6031b6e4fcb15c82149c3272031b617bf5bca87af1d085464fcd9af6bd373e9431077ce58a558b50c6b2c9cd4d94e739ecc312371cd605e4746a84
+DIST asterisk-21.0.2.tar.gz 26280477 BLAKE2B 4bcf2f42bf75b869e2279780c4bb3999786d844e57d48eb5fd8570e0f4ecea0de73d71077e5a5fe6ce64c1c36ef694c987872281fd30e9434bc67d91a3ce1249 SHA512 419d8c2abfa680bb1a812fcbea939f2505dc9f95f860c263c303731fb4e0870060e433787b344136832ccf9d0e34dc64da25240ab3651fb499f416ec3098a711
EBUILD asterisk-16.30.0.ebuild 11876 BLAKE2B f26e339dab2fd90cecafe8b0c075dcef4ae75a3602a1c7adb22ec9792166cbb3c3639349f718a7a895b5071876af76982163896bde31245b1e614d830461cb0a SHA512 57624034782f857b181fda0c92ffcbe502ec1ef94a45e1f2f5c27b2863000fee46661d47acd79658450a37dc331b90f8439e9a5bb66999216abda86fbd48b852
EBUILD asterisk-16.30.1.ebuild 11357 BLAKE2B 6e983a41609ccc98942edb6807c733fcec1afddbdd70a4eeb06e16fe0b8696b33857bd5dd41df8a65e8f98a56dab3b45e2d2ce524c414fd6e4b50025ad5fb546 SHA512 2052282ab24303ccba66f4160bccfaedbeb6bcac0b7be6213e2a2b9d1f5bc4d04e83ecb9444d06896ba3ee9cfaffcd71b3f4440258d8eb19fa7247c0bed6973b
EBUILD asterisk-18.17.0.ebuild 11772 BLAKE2B 516b9c98aa80a7dfaed5f7ba375110cfa39c288d9c22dbb754b46f8ddf62f6ef75198fd1ea8a76e71e319a26e7e34111bca0a9768b40a37b081affed53368981 SHA512 56af8b4d9ede9c4c9a2edd94b9ffaaeffeb07c94c24a633e150ded3423141867dcd83f1ba2072f97431f3a6c0411d9bdaa81c82500c691b9ecd6da2ec7208f76
EBUILD asterisk-18.18.0.ebuild 11893 BLAKE2B e279eb21e2093e64b4f5169d05de382abb3d408cd07c5d4c4a65b58241cf15b8fd87af8e09624cc1e3dc2aac260cd68ae0a8cf0a6ece035161ef5d7ff9ae6f15 SHA512 cff623204429a910877a18217f9e166adcbf9175991dd006e44b994b6ed140d91ce984489776f50fe6b9efdeeec2e5eeefde205f25013f10bf8d560d321d397d
EBUILD asterisk-18.18.1.ebuild 11374 BLAKE2B bb29f1a7e36c060658cc94d3f9f6b36c7f06f03ae561b13d8d628b7b6220ffbccd22370e5158c6cf769f06685c73b50e3889138e273e2be0f13e7bfe4ceb32db SHA512 1408d7b81c53ce77897bb846c6d0b39245514e5016fbb8db379ac162ffc63d476dae2ae7f514db6460fa9e435377d4ab1a4d39e30f1c988fa836577e36639e98
+EBUILD asterisk-18.20.2.ebuild 11278 BLAKE2B 64e1b08570ff3df53d961f9cece7fcde636c3fd695f60a92fc7bb0879e530e409a6281c58de8a1f4f1d42d84c93e49dbfe1b6fc3f20d90d41babecd629aab82f SHA512 8512b2953cfa8bcac176603c4579064cded7d8af6acdc3e2faba33f8889ff29f9618777742b1d4911ddcc553111a83602917350eb27adeaf77e7e95c8feb2ce6
EBUILD asterisk-20.3.0.ebuild 11716 BLAKE2B e36fa8e3fc140dbc04838127a792b6693c662feee0111b09e5753563ae099789266e5d70239e234b2ec4d8b9d1ed33d11de21dc3e24592ae4a75aacac92ef49d SHA512 458434726c5a5418c99a9c8b6bfee6067e38ef4053b78593dc6eed5807801e1080c559d55e644c0ec3f78ed0181489a639588cda154f050826e276bf3a0ddf3c
EBUILD asterisk-20.3.1.ebuild 11199 BLAKE2B 4a50600903a51d2b079ed0cbf88b9a526fa47dd6bef3f92cb94d6cc95825a508b031c9714c771cc9f0cb89c4a185280b74ab5511bfb26ccb435b52ec2e829309 SHA512 a7b948d4defe650fb0c52c979cf866f1775cd9eaa9b6eb4d5b0b90ecda6af3554d65869649e6ea853bae92d4b05df2880fcaf994a276f7feeb27b0210fdf2da7
+EBUILD asterisk-20.5.2.ebuild 11101 BLAKE2B a0dcabcf10a436065df31de075844ab2ff75c8e8546a6e5ce036d189090038ca9b402121856b2fd6190c2bcd93885bb1f5286ddaa788770d2a80d0c141326b86 SHA512 66616bcfaad2ead989e4bc9d7ea4a0e491d66821f1c025e9920d6366296dd818cb0ac000f5bb590eb33cc24b285100db240199fbcd1c5aa05238072cee95978b
+EBUILD asterisk-21.0.2.ebuild 10547 BLAKE2B a83eaa202f1925c37f2ae21e7325ae071613f85a66868e6925f28f63e14b3fce29534caf76ee4ae745d7647b208ebb2a4f743f6663b8569c28d2e10403d183dc SHA512 466278aa19f68c7074f1e2c83289e7a7fac6c6222b6a1c581948075cdf734ff2a99c808fba9219a2103f039fe2e23a1f603038dbb946d1fab7117aaea3ff3782
MISC metadata.xml 1565 BLAKE2B c41d24677c65e3006de867263e723e2530cae9185e260235576df5245e64c49244db82bb2febeb30935b38b5ec1eb5d26f3756f2559868248e766084fe6abcd8 SHA512 465a0a71dbafc0144a2bef2d3cdfe35dbc8e070a8bdd8cfed75c53971a6d9334ca81b4dc575d676cbb43a77f7004a92f992cf9eab3c8bfdd5c8c976dee0d210e
diff --git a/net-misc/asterisk/asterisk-18.20.2.ebuild b/net-misc/asterisk/asterisk-18.20.2.ebuild
new file mode 100644
index 000000000000..a16cf2d20212
--- /dev/null
+++ b/net-misc/asterisk/asterisk-18.20.2.ebuild
@@ -0,0 +1,362 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-{1..4} )
+
+inherit autotools linux-info lua-single toolchain-funcs
+
+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 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}/asterisk-16.16.2-no-var-run-install.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
+ virtual/libcrypt:=
+ 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.12:= )
+ 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? (
+ dev-libs/openssl:0=
+ )
+ systemd? ( sys-apps/systemd )
+ !systemd? ( !sys-apps/systemd )
+ unbound? ( net-dns/unbound )
+ vorbis? (
+ media-libs/libogg
+ media-libs/libvorbis
+ )
+ voicemail_storage_imap? ( net-libs/c-client[ssl=] )
+ 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 )"
+PDEPEND="net-misc/asterisk-base"
+
+BDEPEND="dev-libs/libxml2:2
+ virtual/pkgconfig"
+
+QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+"
+
+_make_args=(
+ "NOISY_BUILD=yes"
+ "ASTDBDIR=\$(ASTDATADIR)/astdb"
+ "ASTVARRUNDIR=/run/asterisk"
+ "ASTCACHEDIR=/var/cache/asterisk"
+ "OPTIMIZE="
+ "DEBUG="
+ "DESTDIR=${D}"
+ "CONFIG_SRC=configs/samples"
+ "CONFIG_EXTEN=.sample"
+ "AST_FORTIFY_SOURCE="
+)
+
+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" \
+ AC_CONFIG_SUBDIRS=menuselect 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 astdb2* tools. We've been on sqlite long enough
+ # that this should really no longer be a problem (bug #https://bugs.gentoo.org/872194)
+ _menuselect --disable astdb2sqlite3 menuselect.makeopts
+ _menuselect --disable astdb2bdb 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
+
+ # Disable conversion tools (which fails to compile in some cases).
+ _menuselect --disable astdb2bdb 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,outgoing}
+ diropts -m 0750 -o asterisk -g asterisk
+ keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
+
+ # 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}
+
+ # Asterisk installs a few folders that's empty by design,
+ # but still required. This finds them, and marks them for
+ # portage.
+ while read d <&3; do
+ keepdir "${d#${ED}}"
+ done 3< <(find "${ED}"/var -type d -empty || die "Find failed.")
+}
+
+pkg_postinst() {
+ if [ -z "${REPLACING_VERSIONS}" ]; then
+ elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/"
+ elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.libera.chat"
+ 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.libera.chat"
+ 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-20.5.2.ebuild b/net-misc/asterisk/asterisk-20.5.2.ebuild
new file mode 100644
index 000000000000..53593c91aac6
--- /dev/null
+++ b/net-misc/asterisk/asterisk-20.5.2.ebuild
@@ -0,0 +1,358 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-{1..4} )
+
+inherit autotools linux-info lua-single toolchain-funcs
+
+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 lua mysql newt odbc pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd systemd unbound vorbis xmpp"
+IUSE_EXPAND="VOICEMAIL_STORAGE"
+REQUIRED_USE="gtalk? ( xmpp )
+ lua? ( ${LUA_REQUIRED_USE} )
+ voicemail_storage_odbc? ( odbc )
+"
+
+PATCHES=(
+ "${FILESDIR}/asterisk-16.16.2-no-var-run-install.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
+ virtual/libcrypt:=
+ 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.12:= )
+ 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? (
+ dev-libs/openssl:0=
+ )
+ systemd? ( sys-apps/systemd )
+ !systemd? ( !sys-apps/systemd )
+ unbound? ( net-dns/unbound )
+ vorbis? (
+ media-libs/libogg
+ media-libs/libvorbis
+ )
+ voicemail_storage_imap? ( net-libs/c-client[ssl=] )
+ 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 )"
+PDEPEND="net-misc/asterisk-base"
+
+BDEPEND="dev-libs/libxml2:2
+ virtual/pkgconfig"
+
+QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+"
+
+_make_args=(
+ "NOISY_BUILD=yes"
+ "ASTDBDIR=\$(ASTDATADIR)/astdb"
+ "ASTVARRUNDIR=/run/asterisk"
+ "ASTCACHEDIR=/var/cache/asterisk"
+ "OPTIMIZE="
+ "DEBUG="
+ "DESTDIR=${D}"
+ "CONFIG_SRC=configs/samples"
+ "CONFIG_EXTEN=.sample"
+ "AST_FORTIFY_SOURCE="
+)
+
+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" \
+ AC_CONFIG_SUBDIRS=menuselect 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 astdb2* tools. We've been on sqlite long enough
+ # that this should really no longer be a problem (bug #https://bugs.gentoo.org/872194)
+ _menuselect --disable astdb2sqlite3 menuselect.makeopts
+ _menuselect --disable astdb2bdb menuselect.makeopts
+
+ # Disable BUILD_NATIVE (bug #667498)
+ _menuselect --disable build_native menuselect.makeopts
+
+ # Broken functionality is forcibly disabled (bug #360143)
+ _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
+
+ # Disable conversion tools (which fails to compile in some cases).
+ _menuselect --disable astdb2bdb 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_meetme chan_dahdi codec_dahdi res_timing_dahdi
+ _use_select deprecated app_macro chan_sip res_monitor
+ _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 res_config_mysql
+ _use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
+ _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 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,outgoing}
+ diropts -m 0750 -o asterisk -g asterisk
+ keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
+
+ # 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}
+
+ # Asterisk installs a few folders that's empty by design,
+ # but still required. This finds them, and marks them for
+ # portage.
+ while read d <&3; do
+ keepdir "${d#${ED}}"
+ done 3< <(find "${ED}"/var -type d -empty || die "Find failed.")
+}
+
+pkg_postinst() {
+ if [ -z "${REPLACING_VERSIONS}" ]; then
+ elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/"
+ elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.libera.chat"
+ 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.libera.chat"
+ 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-21.0.2.ebuild b/net-misc/asterisk/asterisk-21.0.2.ebuild
new file mode 100644
index 000000000000..e77fa9ed35d9
--- /dev/null
+++ b/net-misc/asterisk/asterisk-21.0.2.ebuild
@@ -0,0 +1,345 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-{1..4} )
+
+inherit autotools linux-info lua-single toolchain-funcs
+
+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[*]} blocks bluetooth calendar +caps cluster codec2 curl dahdi debug doc freetds gtalk http iconv ilbc ldap lua mysql newt odbc pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd systemd unbound vorbis xmpp"
+IUSE_EXPAND="VOICEMAIL_STORAGE"
+REQUIRED_USE="gtalk? ( xmpp )
+ lua? ( ${LUA_REQUIRED_USE} )
+ voicemail_storage_odbc? ( odbc )
+"
+
+PATCHES=(
+ "${FILESDIR}/asterisk-16.16.2-no-var-run-install.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
+ virtual/libcrypt:=
+ 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.12:= )
+ 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? (
+ dev-libs/openssl:0=
+ )
+ systemd? ( sys-apps/systemd )
+ !systemd? ( !sys-apps/systemd )
+ unbound? ( net-dns/unbound )
+ vorbis? (
+ media-libs/libogg
+ media-libs/libvorbis
+ )
+ voicemail_storage_imap? ( net-libs/c-client[ssl=] )
+ 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 )"
+PDEPEND="net-misc/asterisk-base"
+
+BDEPEND="dev-libs/libxml2:2
+ virtual/pkgconfig"
+
+QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+"
+
+_make_args=(
+ "NOISY_BUILD=yes"
+ "ASTDBDIR=\$(ASTDATADIR)/astdb"
+ "ASTVARRUNDIR=/run/asterisk"
+ "ASTCACHEDIR=/var/cache/asterisk"
+ "OPTIMIZE="
+ "DEBUG="
+ "DESTDIR=${D}"
+ "CONFIG_SRC=configs/samples"
+ "CONFIG_EXTEN=.sample"
+ "AST_FORTIFY_SOURCE="
+)
+
+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" \
+ AC_CONFIG_SUBDIRS=menuselect 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 astdb2* tools. We've been on sqlite long enough
+ # that this should really no longer be a problem (bug #https://bugs.gentoo.org/872194)
+ _menuselect --disable astdb2sqlite3 menuselect.makeopts
+ _menuselect --disable astdb2bdb menuselect.makeopts
+
+ # Disable BUILD_NATIVE (bug #667498)
+ _menuselect --disable build_native menuselect.makeopts
+
+ # Broken functionality is forcibly disabled (bug #360143)
+ _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
+
+ # 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
+
+ # Disable conversion tools (which fails to compile in some cases).
+ _menuselect --disable astdb2bdb menuselect.makeopts
+
+ # The others are based on USE-flag settings
+ _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_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 res_config_mysql
+ _use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
+ _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 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,outgoing}
+ diropts -m 0750 -o asterisk -g asterisk
+ keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
+
+ # 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}
+
+ # Asterisk installs a few folders that's empty by design,
+ # but still required. This finds them, and marks them for
+ # portage.
+ while read d <&3; do
+ keepdir "${d#${ED}}"
+ done 3< <(find "${ED}"/var -type d -empty || die "Find failed.")
+}
+
+pkg_postinst() {
+ if [ -z "${REPLACING_VERSIONS}" ]; then
+ elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/"
+ elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.libera.chat"
+ 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.libera.chat"
+ 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/curl/Manifest b/net-misc/curl/Manifest
index 22f427e2d4f1..8a3e4c859d6c 100644
--- a/net-misc/curl/Manifest
+++ b/net-misc/curl/Manifest
@@ -1,16 +1,14 @@
-AUX curl-8.3.0-CVE-2023-38545.patch 4345 BLAKE2B b3519d1fdccecf40e9a49cd96bf61e53c2a8ab44b2ca05543ea431da6a00125ccc9b6f7cdde0371db30e741b19a8c86cc90038987750744d2f02a0b1c1f0bec0 SHA512 1b0d3f4d4475bf4d579d4a99504a1e488b4a64e956497dc9558206234f67c60a6006ec9c93df89dc5b18c8d60312877838564adbcb834af5d6389f2f7be856d8
-AUX curl-8.3.0-CVE-2023-38546.patch 4852 BLAKE2B 316a6ca5a05c55ffa029aa97ad9c23844bf9dce2a0220cdce324c678baa8f1bfef6dcb21a6460c80345d2fe81e7738055d207a76e3d0c920c6bbb827869b02c5 SHA512 1a0d047c9c661d39caf4f4f47177aa804b8b8689f68f1f14e83163ce311b5783b58ae3d216e84dbec6bf93b6b0ba7a838831121282702e613ab4c00c1874730d
-AUX curl-8.3.0-tests-arm-musl.patch 3472 BLAKE2B 6722ff38b03191a9c26b90b9a2d4dc9d439cfb0d7227e10f1f100bec4a4d8709878bfab89ef9cfa854955dd44462eef66b8eb3a31db75b4555d9eccaa4457729 SHA512 3beaf54c017c9c13e023bdcaa7e187b1689f988ff2837c2e9a998ed9e7beb850e8baf9dafb0a506b60018b853c8039763d59f2849f1772a8bc8b63843111d769
+AUX curl-8.5.0-ipv6-configure-c99.patch 749 BLAKE2B b9d94d4ec5c310f8d3985eb6e4a17cd12b8aec696c015c41e94fe7eee2cced4d6ed1f192f3dbe4877a33f5102522844b63a11039fd285371472f282065cf2894 SHA512 cc04189480055a82fc264fcf3b70a3a748bccaec5f263340c41aabde600ea020fd2bce46461d4f75f5ed7708cfc5a0afcf95e6f1d098333c3968b75169a27a93
+AUX curl-8.5.0-mpd-stream-http-adjust_pollset.patch 2979 BLAKE2B da34eb58eb8b706916657279bc071ab97145e33e7e7eb553ffe924be7a97e3d784d5e2fc8270363e95e815687201b6fae1b374dc666093441c5177bfe76eb835 SHA512 11ed5f8482d985aab4e7ab07f0e8821d76a494d0147a61ce7901379cd1f36f577c544627f5ad61a38b70e9e4659fc050c5b9e0be4247ab410f55850a946872d1
AUX curl-prefix.patch 880 BLAKE2B 5b7552a8339014221864a585d174b02a96ec7dd7fe8762d331d1981834044f8ec4db64d527a4ded3f5f4cccc86f281576668de092439eb19f5477d5fcf8369cf SHA512 c7cd13b9ccbd12ed01ea121ffece9c23b898a5b34698bae59ae1dd23b1cf2445180b84d80c4a640981f16dba5018df944f405dd5c660addab54ca21e0e673b7f
AUX curl-respect-cflags-3.patch 406 BLAKE2B 1b533144858aff5566150c4a2648ad2e48e8ff29849ae285592edfee4b3332d06e750395dea7190ee6a01d2b5ee2c2c42c10400c2e5defa09963a90a1a10417d SHA512 3219e4e67d534e35012909243fc8d69d58989462db44dd507c502e7aaa299f1d9a01392e2c83797cc2bdb53d503470c5d6e7bf94572a6ccc6e5eafcc0466bc54
-DIST curl-8.3.0.tar.xz 2641764 BLAKE2B 6875b20e27ed86f9b6ab256210d85e9fb3b39645e8be710b2e6fe29fba40220f870e06bc21e8a92244670fed0a08c7716e4806a267ede49c4ed6d66e03f5fcd4 SHA512 6404b4c74fe1185cb482631ca3a143996cb7298d0d8a76bfafd7696e7729c00559999a069bdba782dee3f3eb273fb678a4438cb27d3deca54022878cdff83a51
-DIST curl-8.3.0.tar.xz.asc 488 BLAKE2B ef5a749e579710d45db9f73da0cbcb58d77a9dfe73be622536496997fa792fe5cbd0331a31f01e21cbdb36c6384dca44baa647c9f3d20effabb5bfc275b1b491 SHA512 b7d45722640ac50181b20a6d663168ec6eec6691c5604ddfe9c7177f07da598cb2de688c631043dc428c311774d781ccd16bd1e2fb4f038be651e3bee383aec4
DIST curl-8.4.0.tar.xz 2658376 BLAKE2B ea5ebecc3c1aeac3ae8fd0cf7d8ff3298149b9c4c556fb85ed8d9310e3613228eb6fca133b0dfb9268988f93d694779fab8d53510cfa5710c1320bb6638f05eb SHA512 7027dbf3b759b39d6ec9c4da58fadd254e84bb93bff599541b3bc3135bad4c2955c6237d7ddd60973f9f1a6948bc32d7e312985fb50658bc958b9f22fee74f2b
DIST curl-8.4.0.tar.xz.asc 488 BLAKE2B 0fd4ea46a0942b9bc440e91e8f9323bba6d0eb02fbc87c227004c90e5be14cc644446bc235ab67f857b617975cdeada6ce38a647da9e0bd783e57d58f354cdb4 SHA512 b8b7a5b76be816e7b1552354f267f335fdc608cdadbd2c40ab44faf6450c6bbd2853b6de5c2746a1292aad33a8ee1c367380d32bb1a8282540b38c3b985a320e
DIST curl-8.5.0.tar.xz 2658520 BLAKE2B cfd591f9703b9c63712dbe74494b05a80ce5a4fc4f8fc0fbf57058578eed5f33d71277f688d5d9f409bcd82e3a4cacaa5615a44f2a7c554559c6be7dd5188893 SHA512 acffa2cf61d9b8e4188575a1b40227da8d722df2e5fe8bb82a222b4eb2fd64bf8aebd90852ce050c79fb5e517d5cee2546bf7de92ede1dd394263e231cb741a3
DIST curl-8.5.0.tar.xz.asc 488 BLAKE2B d706c401aecf345398411b94c87b8f1ecc752d73d24e1a578c8c0e62732e8e476333a2a4772428c6425eb0d124b1ceee8e377cf41d60a54b6f2df5cccc0b9f23 SHA512 9c6a2e61860878cd731d951fac1bb52cd314db20439a5173a95b48da1742737e02bfb9978d65e25de6535f839e281235203599a29f252e78e0d7a83769727329
-EBUILD curl-8.3.0-r2.ebuild 10601 BLAKE2B 19cc1441f2cf23684095b159430a1e407e351f112aa38849b01af269ae151b45b0751709b8d4202b60f605ea7e060f2bfa054f6650a0de310a31786c808b6d89 SHA512 65248f611a2608b9d965bd8abc2cd8497cc331a112842ab18a230df74942eb79da54cd5f8fc4a0fdd562209b824ad3f560388bf2e1aac80163a4d2e73bf94e04
EBUILD curl-8.4.0.ebuild 10695 BLAKE2B 66b7a3a2ed719bd945d67eb8cbe53f97526cbb0e4408045ea99c16996dc547576ffbfa6bef459b128dd2fc96ef734507eefc50f34d588ca489ad7e8d139c498a SHA512 c3abc0f3e4297aa84054c5fe6717610359afcb027ab2040b5d540d65b6552cb530cd37f85ef3e6522d35995494b2b3c29aa7a443d50ec8af0f637081314f26cc
+EBUILD curl-8.5.0-r1.ebuild 10830 BLAKE2B e15b3b6ffc9c3456bf47d5ec3bb8ca66694e8f7210d929735af8c582b2e22002c20962f16e4ac696b2ede20c29972b35a4d2f015c8d86800ce98723efbacc01c SHA512 e62419df12f59390ccdb40cd07b0175dba320ad06b1f9fa382bdcb380b81fef7af46560d153afe518f703f790002a830247fb49ce93511a1cae573b008caa7c9
+EBUILD curl-8.5.0-r2.ebuild 10898 BLAKE2B 6a0d2e82197a206cb2a47c676e66a7d7915e84b873248c099a099131b27ed5a0dd8f8b9bb20ecff4b862b56311d65e6e7aaac0cc179814db3b9e82e46a439f73 SHA512 da6cc63f5bb332967a67e00f393a225c0141bc045931bcd9c59343b32d27ac8ec82d25ded6af0632a40b09a9a901cb2b924dce83afbb071621279836c23a9640
EBUILD curl-8.5.0.ebuild 10785 BLAKE2B 9266873c95d46451519a1cdb8adaad8f47848ebe56600fa235ab378120a53cea11c2016234f8410befdedcb7477284e884e3a100be693e1fd76ab682a59db3c2 SHA512 53d310df6d1acd7dc3a1bef493181f15639809d7e6ad3bd8f0a542ccf10015425e16a7224ddde188186b4bd2036f1ba8d578a8e8f2688a0d6e3cde17dad91109
-EBUILD curl-9999.ebuild 10703 BLAKE2B 9e6ae064999854a7344c1190f2984ede98dd57bf5ca3138ecaf85e30f264dce2e3f4d735a59d3c2cadcea1476fce5bc1f4132089bb26c0472a122329f7927605 SHA512 5078dabb7e2763330cba648b81395482a0592aad948caa958a1048eb484d9cb4c84eece2b93132a1cb9aed403a9a1567e1ac61f6eaf8c2c2bf5d96e88e1c7545
+EBUILD curl-9999.ebuild 10714 BLAKE2B 0c584c3706885a6b4e1c12ed9983884efb1edecfc530c4fa18466fd36d27ee6cd25904504499de7a284a3707e6c3100b76f7f432cb7da0b4559bfb0d1fc9b70e SHA512 75f4920f88357be1d44993befcfd7c6fc5258c425df17614d7e404956f1ff1fadf6afd9d8af1cff809231b0f7eaacf898ed3320f5278dfab5aa5b83c1a57bdca
MISC metadata.xml 2040 BLAKE2B 53dc2ea93f6843d71228f0d1a2315ee9e5d8567e1147b4c240f66b3e3a4d12bb514b94df1890b64b345053fe7d35c5c062417ce47e8a2ae36bad08b51b79cdb5 SHA512 6299919b704f1830f186cd0591503936d89388ebb87e9e9d255f715123829663b1e81432ee870a7d10eaed4f6fa73b8aaeab1b2f061bce00800283b66e42dc73
diff --git a/net-misc/curl/curl-8.3.0-r2.ebuild b/net-misc/curl/curl-8.5.0-r1.ebuild
index 350d4acf5b7c..8c9e7ec34d3f 100644
--- a/net-misc/curl/curl-8.3.0-r2.ebuild
+++ b/net-misc/curl/curl-8.5.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -17,15 +17,15 @@ else
https://curl.se/download/${P}.tar.xz
verify-sig? ( https://curl.se/download/${P}.tar.xz.asc )
"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
LICENSE="BSD curl ISC test? ( BSD-4 )"
SLOT="0"
-IUSE="+adns alt-svc brotli +ftp gnutls gopher hsts +http2 idn +imap kerberos ldap mbedtls +openssl +pop3 +progress-meter rtmp rustls samba +smtp ssh ssl sslv3 static-libs test telnet +tftp websockets zstd"
+IUSE="+adns +alt-svc brotli +ftp gnutls gopher +hsts +http2 idn +imap kerberos ldap mbedtls nghttp3 +openssl +pop3"
+IUSE+=" +progress-meter rtmp rustls samba +smtp ssh ssl sslv3 static-libs test telnet +tftp websockets zstd"
# These select the default SSL implementation
IUSE+=" curl_ssl_gnutls curl_ssl_mbedtls +curl_ssl_openssl curl_ssl_rustls"
-IUSE+=" nghttp3"
RESTRICT="!test? ( test )"
# Only one default ssl provider can be enabled
@@ -44,34 +44,37 @@ REQUIRED_USE="
curl_ssl_mbedtls? ( mbedtls )
curl_ssl_openssl? ( openssl )
curl_ssl_rustls? ( rustls )
- nghttp3? ( !openssl )
+ nghttp3? (
+ !openssl
+ alt-svc )
"
# cURL's docs and CI/CD are great resources for confirming supported versions
# particulary for fast-moving targets like HTTP/2 and TCP/2 e.g.:
-# - https://github.com/curl/curl/blob/master/docs/HTTP3.md
-# - https://github.com/curl/curl/blob/master/.github/workflows/quiche-linux.yml
+# - https://github.com/curl/curl/blob/master/docs/INTERNALS.md (core dependencies + minimum versions)
+# - https://github.com/curl/curl/blob/master/docs/HTTP3.md (example of a feature that moves quickly)
+# - https://github.com/curl/curl/blob/master/.github/workflows/quiche-linux.yml (CI/CD for TCP/2)
# However 'supported' vs 'works' are two entirely different things; be sane but
# don't be afraid to require a later version.
RDEPEND="
- sys-libs/zlib[${MULTILIB_USEDEP}]
+ >=sys-libs/zlib-1.1.4[${MULTILIB_USEDEP}]
adns? ( net-dns/c-ares:=[${MULTILIB_USEDEP}] )
brotli? ( app-arch/brotli:=[${MULTILIB_USEDEP}] )
http2? ( >=net-libs/nghttp2-1.12.0:=[${MULTILIB_USEDEP}] )
idn? ( net-dns/libidn2:=[static-libs?,${MULTILIB_USEDEP}] )
kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
- ldap? ( net-nds/openldap:=[static-libs?,${MULTILIB_USEDEP}] )
+ ldap? ( >=net-nds/openldap-2.0.0:=[static-libs?,${MULTILIB_USEDEP}] )
nghttp3? (
>=net-libs/nghttp3-0.15.0[${MULTILIB_USEDEP}]
>=net-libs/ngtcp2-0.19.1[gnutls,ssl,-openssl,${MULTILIB_USEDEP}]
)
rtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] )
- ssh? ( net-libs/libssh2[${MULTILIB_USEDEP}] )
+ ssh? ( >=net-libs/libssh2-1.0.0[${MULTILIB_USEDEP}] )
ssl? (
gnutls? (
app-misc/ca-certificates
- net-libs/gnutls:=[static-libs?,${MULTILIB_USEDEP}]
+ >=net-libs/gnutls-3.1.10:=[static-libs?,${MULTILIB_USEDEP}]
dev-libs/nettle:=[${MULTILIB_USEDEP}]
)
mbedtls? (
@@ -79,7 +82,7 @@ RDEPEND="
net-libs/mbedtls:=[${MULTILIB_USEDEP}]
)
openssl? (
- dev-libs/openssl:=[sslv3(-)=,static-libs?,${MULTILIB_USEDEP}]
+ >=dev-libs/openssl-0.9.7:=[sslv3(-)=,static-libs?,${MULTILIB_USEDEP}]
)
rustls? (
net-libs/rustls-ffi:=[${MULTILIB_USEDEP}]
@@ -125,9 +128,7 @@ QA_CONFIG_IMPL_DECL_SKIP=(
PATCHES=(
"${FILESDIR}"/${PN}-prefix.patch
"${FILESDIR}"/${PN}-respect-cflags-3.patch
- "${FILESDIR}"/${P}-tests-arm-musl.patch
- "${FILESDIR}"/${P}-CVE-2023-38545.patch
- "${FILESDIR}"/${P}-CVE-2023-38546.patch
+ "${FILESDIR}"/${P}-ipv6-configure-c99.patch
)
src_prepare() {
@@ -344,7 +345,8 @@ multilib_src_test() {
# this ends up breaking when nproc is huge (like -j80).
# The network sandbox causes tests 241 and 1083 to fail; these are typically skipped
# as most gentoo users don't have an 'ip6-localhost'
- multilib_is_native_abi && emake test TFLAGS="-n -v -a -k -am -p -j$((2*$(makeopts_jobs))) !241 !1083"
+ # Required deps for 1477 are not included in the release tarball for 8.5.0
+ multilib_is_native_abi && emake test TFLAGS="-n -v -a -k -am -p -j$((2*$(makeopts_jobs))) !241 !1083 !1477"
}
multilib_src_install() {
diff --git a/net-misc/curl/curl-8.5.0-r2.ebuild b/net-misc/curl/curl-8.5.0-r2.ebuild
new file mode 100644
index 000000000000..03cc7f61ebca
--- /dev/null
+++ b/net-misc/curl/curl-8.5.0-r2.ebuild
@@ -0,0 +1,367 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/danielstenberg.asc
+inherit autotools multilib-minimal multiprocessing prefix toolchain-funcs verify-sig
+
+DESCRIPTION="A Client that groks URLs"
+HOMEPAGE="https://curl.se/"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/curl/curl.git"
+else
+ SRC_URI="
+ https://curl.se/download/${P}.tar.xz
+ verify-sig? ( https://curl.se/download/${P}.tar.xz.asc )
+ "
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+
+LICENSE="BSD curl ISC test? ( BSD-4 )"
+SLOT="0"
+IUSE="+adns +alt-svc brotli +ftp gnutls gopher +hsts +http2 idn +imap kerberos ldap mbedtls nghttp3 +openssl +pop3"
+IUSE+=" +progress-meter rtmp rustls samba +smtp ssh ssl sslv3 static-libs test telnet +tftp websockets zstd"
+# These select the default SSL implementation
+IUSE+=" curl_ssl_gnutls curl_ssl_mbedtls +curl_ssl_openssl curl_ssl_rustls"
+RESTRICT="!test? ( test )"
+
+# Only one default ssl provider can be enabled
+# The default ssl provider needs its USE satisfied
+# nghttp3 = https://bugs.gentoo.org/912029
+REQUIRED_USE="
+ ssl? (
+ ^^ (
+ curl_ssl_gnutls
+ curl_ssl_mbedtls
+ curl_ssl_openssl
+ curl_ssl_rustls
+ )
+ )
+ curl_ssl_gnutls? ( gnutls )
+ curl_ssl_mbedtls? ( mbedtls )
+ curl_ssl_openssl? ( openssl )
+ curl_ssl_rustls? ( rustls )
+ nghttp3? (
+ !openssl
+ alt-svc )
+"
+
+# cURL's docs and CI/CD are great resources for confirming supported versions
+# particulary for fast-moving targets like HTTP/2 and TCP/2 e.g.:
+# - https://github.com/curl/curl/blob/master/docs/INTERNALS.md (core dependencies + minimum versions)
+# - https://github.com/curl/curl/blob/master/docs/HTTP3.md (example of a feature that moves quickly)
+# - https://github.com/curl/curl/blob/master/.github/workflows/quiche-linux.yml (CI/CD for TCP/2)
+# However 'supported' vs 'works' are two entirely different things; be sane but
+# don't be afraid to require a later version.
+
+RDEPEND="
+ >=sys-libs/zlib-1.1.4[${MULTILIB_USEDEP}]
+ adns? ( net-dns/c-ares:=[${MULTILIB_USEDEP}] )
+ brotli? ( app-arch/brotli:=[${MULTILIB_USEDEP}] )
+ http2? ( >=net-libs/nghttp2-1.12.0:=[${MULTILIB_USEDEP}] )
+ idn? ( net-dns/libidn2:=[static-libs?,${MULTILIB_USEDEP}] )
+ kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
+ ldap? ( >=net-nds/openldap-2.0.0:=[static-libs?,${MULTILIB_USEDEP}] )
+ nghttp3? (
+ >=net-libs/nghttp3-0.15.0[${MULTILIB_USEDEP}]
+ >=net-libs/ngtcp2-0.19.1[gnutls,ssl,-openssl,${MULTILIB_USEDEP}]
+ )
+ rtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] )
+ ssh? ( >=net-libs/libssh2-1.0.0[${MULTILIB_USEDEP}] )
+ ssl? (
+ gnutls? (
+ app-misc/ca-certificates
+ >=net-libs/gnutls-3.1.10:=[static-libs?,${MULTILIB_USEDEP}]
+ dev-libs/nettle:=[${MULTILIB_USEDEP}]
+ )
+ mbedtls? (
+ app-misc/ca-certificates
+ net-libs/mbedtls:=[${MULTILIB_USEDEP}]
+ )
+ openssl? (
+ >=dev-libs/openssl-0.9.7:=[sslv3(-)=,static-libs?,${MULTILIB_USEDEP}]
+ )
+ rustls? (
+ net-libs/rustls-ffi:=[${MULTILIB_USEDEP}]
+ )
+ )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="${RDEPEND}"
+
+BDEPEND="
+ dev-lang/perl
+ virtual/pkgconfig
+ test? (
+ sys-apps/diffutils
+ http2? ( >=net-libs/nghttp2-1.15.0:=[utils,${MULTILIB_USEDEP}] )
+ nghttp3? ( net-libs/nghttp2:=[utils,${MULTILIB_USEDEP}] )
+ )
+ verify-sig? ( sec-keys/openpgp-keys-danielstenberg )
+"
+
+DOCS=( CHANGES README docs/{FEATURES.md,INTERNALS.md,FAQ,BUGS.md,CONTRIBUTE.md} )
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/curl/curlbuild.h
+)
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/curl-config
+)
+
+QA_CONFIG_IMPL_DECL_SKIP=(
+ __builtin_available
+ closesocket
+ CloseSocket
+ getpass_r
+ ioctlsocket
+ IoctlSocket
+ mach_absolute_time
+ setmode
+ _fseeki64
+)
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-prefix.patch
+ "${FILESDIR}"/${PN}-respect-cflags-3.patch
+ "${FILESDIR}"/${P}-ipv6-configure-c99.patch
+ "${FILESDIR}"/${P}-mpd-stream-http-adjust_pollset.patch
+)
+
+src_prepare() {
+ default
+
+ eprefixify curl-config.in
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # We make use of the fact that later flags override earlier ones
+ # So start with all ssl providers off until proven otherwise
+ # TODO: in the future, we may want to add wolfssl (https://www.wolfssl.com/)
+ local myconf=()
+
+ myconf+=( --without-ca-fallback --with-ca-bundle="${EPREFIX}"/etc/ssl/certs/ca-certificates.crt )
+ if use ssl; then
+ myconf+=( --without-gnutls --without-mbedtls --without-rustls )
+
+ if use gnutls; then
+ multilib_is_native_abi && einfo "SSL provided by gnutls"
+ myconf+=( --with-gnutls )
+ fi
+ if use mbedtls; then
+ multilib_is_native_abi && einfo "SSL provided by mbedtls"
+ myconf+=( --with-mbedtls )
+ fi
+ if use openssl; then
+ multilib_is_native_abi && einfo "SSL provided by openssl"
+ myconf+=( --with-ssl --with-ca-path="${EPREFIX}"/etc/ssl/certs )
+ fi
+ if use rustls; then
+ multilib_is_native_abi && einfo "SSL provided by rustls"
+ myconf+=( --with-rustls )
+ fi
+ if use curl_ssl_gnutls; then
+ multilib_is_native_abi && einfo "Default SSL provided by gnutls"
+ myconf+=( --with-default-ssl-backend=gnutls )
+ elif use curl_ssl_mbedtls; then
+ multilib_is_native_abi && einfo "Default SSL provided by mbedtls"
+ myconf+=( --with-default-ssl-backend=mbedtls )
+ elif use curl_ssl_openssl; then
+ multilib_is_native_abi && einfo "Default SSL provided by openssl"
+ myconf+=( --with-default-ssl-backend=openssl )
+ elif use curl_ssl_rustls; then
+ multilib_is_native_abi && einfo "Default SSL provided by rustls"
+ myconf+=( --with-default-ssl-backend=rustls )
+ else
+ eerror "We can't be here because of REQUIRED_USE."
+ die "Please file a bug, hit impossible condition w/ USE=ssl handling."
+ fi
+
+ else
+ myconf+=( --without-ssl )
+ einfo "SSL disabled"
+ fi
+
+ # These configuration options are organized alphabetically
+ # within each category. This should make it easier if we
+ # ever decide to make any of them contingent on USE flags:
+ # 1) protocols first. To see them all do
+ # 'grep SUPPORT_PROTOCOLS configure.ac'
+ # 2) --enable/disable options second.
+ # 'grep -- --enable configure | grep Check | awk '{ print $4 }' | sort
+ # 3) --with/without options third.
+ # grep -- --with configure | grep Check | awk '{ print $4 }' | sort
+
+ myconf+=(
+ $(use_enable alt-svc)
+ --enable-basic-auth
+ --enable-bearer-auth
+ --enable-digest-auth
+ --enable-kerberos-auth
+ --enable-negotiate-auth
+ --enable-aws
+ --enable-dict
+ --disable-ech
+ --enable-file
+ $(use_enable ftp)
+ $(use_enable gopher)
+ $(use_enable hsts)
+ --enable-http
+ $(use_enable imap)
+ $(use_enable ldap)
+ $(use_enable ldap ldaps)
+ --enable-ntlm
+ --disable-ntlm-wb
+ $(use_enable pop3)
+ --enable-rt
+ --enable-rtsp
+ $(use_enable samba smb)
+ $(use_with ssh libssh2)
+ $(use_enable smtp)
+ $(use_enable telnet)
+ $(use_enable tftp)
+ --enable-tls-srp
+ $(use_enable adns ares)
+ --enable-cookies
+ --enable-dateparse
+ --enable-dnsshuffle
+ --enable-doh
+ --enable-symbol-hiding
+ --enable-http-auth
+ --enable-ipv6
+ --enable-largefile
+ --enable-manual
+ --enable-mime
+ --enable-netrc
+ $(use_enable progress-meter)
+ --enable-proxy
+ --enable-socketpair
+ --disable-sspi
+ $(use_enable static-libs static)
+ --enable-pthreads
+ --enable-threaded-resolver
+ --disable-versioned-symbols
+ --without-amissl
+ --without-bearssl
+ $(use_with brotli)
+ --with-fish-functions-dir="${EPREFIX}"/usr/share/fish/vendor_completions.d
+ $(use_with http2 nghttp2)
+ --without-hyper
+ $(use_with idn libidn2)
+ $(use_with kerberos gssapi "${EPREFIX}"/usr)
+ --without-libgsasl
+ --without-libpsl
+ --without-msh3
+ $(use_with nghttp3)
+ $(use_with nghttp3 ngtcp2)
+ --without-quiche
+ $(use_with rtmp librtmp)
+ --without-schannel
+ --without-secure-transport
+ --without-test-caddy
+ --without-test-httpd
+ --without-test-nghttpx
+ $(use_enable websockets)
+ --without-winidn
+ --without-wolfssl
+ --with-zlib
+ $(use_with zstd)
+ --with-zsh-functions-dir="${EPREFIX}"/usr/share/zsh/site-functions
+ )
+
+ if use test && multilib_is_native_abi && ( use http2 || use nghttp3 ); then
+ myconf+=(
+ --with-test-nghttpx="${BROOT}/usr/bin/nghttpx"
+ )
+ fi
+
+ if [[ ${CHOST} == *mingw* ]] ; then
+ myconf+=(
+ --disable-pthreads
+ )
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+
+ if ! multilib_is_native_abi; then
+ # Avoid building the client (we just want libcurl for multilib)
+ sed -i -e '/SUBDIRS/s:src::' Makefile || die
+ sed -i -e '/SUBDIRS/s:scripts::' Makefile || die
+ fi
+
+ # Fix up the pkg-config file to be more robust.
+ # https://github.com/curl/curl/issues/864
+ local priv=() libs=()
+ # We always enable zlib.
+ libs+=( "-lz" )
+ priv+=( "zlib" )
+ if use http2; then
+ libs+=( "-lnghttp2" )
+ priv+=( "libnghttp2" )
+ fi
+ if use nghttp3; then
+ libs+=( "-lnghttp3" "-lngtcp2" )
+ priv+=( "libnghttp3" "libngtcp2" )
+ fi
+ if use ssl && use curl_ssl_openssl; then
+ libs+=( "-lssl" "-lcrypto" )
+ priv+=( "openssl" )
+ fi
+ grep -q Requires.private libcurl.pc && die "need to update ebuild"
+ libs=$(printf '|%s' "${libs[@]}")
+ sed -i -r \
+ -e "/^Libs.private/s:(${libs#|})( |$)::g" \
+ libcurl.pc || die
+ echo "Requires.private: ${priv[*]}" >> libcurl.pc || die
+}
+
+multilib_src_compile() {
+ default
+
+ if multilib_is_native_abi; then
+ # Shell completions
+ ! tc-is-cross-compiler && emake -C scripts
+ fi
+}
+
+# There is also a pytest harness that tests for bugs in some very specific
+# situations; we can rely on upstream for this rather than adding additional test deps.
+multilib_src_test() {
+ # See https://github.com/curl/curl/blob/master/tests/runtests.pl#L5721
+ # -n: no valgrind (unreliable in sandbox and doesn't work correctly on all arches)
+ # -v: verbose
+ # -a: keep going on failure (so we see everything which breaks, not just 1st test)
+ # -k: keep test files after completion
+ # -am: automake style TAP output
+ # -p: print logs if test fails
+ # Note: if needed, we can skip specific tests. See e.g. Fedora's packaging
+ # or just read https://github.com/curl/curl/tree/master/tests#run.
+ # Note: we don't run the testsuite for cross-compilation.
+ # Upstream recommend 7*nproc as a starting point for parallel tests, but
+ # this ends up breaking when nproc is huge (like -j80).
+ # The network sandbox causes tests 241 and 1083 to fail; these are typically skipped
+ # as most gentoo users don't have an 'ip6-localhost'
+ # Required deps for 1477 are not included in the release tarball for 8.5.0
+ multilib_is_native_abi && emake test TFLAGS="-n -v -a -k -am -p -j$((2*$(makeopts_jobs))) !241 !1083 !1477"
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+
+ if multilib_is_native_abi; then
+ # Shell completions
+ ! tc-is-cross-compiler && emake -C scripts DESTDIR="${D}" install
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ find "${ED}" -type f -name '*.la' -delete || die
+ rm -rf "${ED}"/etc/ || die
+}
diff --git a/net-misc/curl/curl-9999.ebuild b/net-misc/curl/curl-9999.ebuild
index 7d87477bc1f1..5127f29241f5 100644
--- a/net-misc/curl/curl-9999.ebuild
+++ b/net-misc/curl/curl-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -123,6 +123,7 @@ QA_CONFIG_IMPL_DECL_SKIP=(
IoctlSocket
mach_absolute_time
setmode
+ _fseeki64
)
PATCHES=(
diff --git a/net-misc/curl/files/curl-8.3.0-CVE-2023-38545.patch b/net-misc/curl/files/curl-8.3.0-CVE-2023-38545.patch
deleted file mode 100644
index 04603a8c01dc..000000000000
--- a/net-misc/curl/files/curl-8.3.0-CVE-2023-38545.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-https://bugs.gentoo.org/915195
-
-From 1e1f915b73ab0895a68348ad1f96a5283a44ffd7 Mon Sep 17 00:00:00 2001
-From: Jay Satiro <raysatiro@yahoo.com>
-Date: Mon, 9 Oct 2023 17:45:07 -0400
-Subject: [PATCH] socks: return error if hostname too long for remote resolve
-
-Prior to this change the state machine attempted to change the remote
-resolve to a local resolve if the hostname was longer than 255
-characters. Unfortunately that did not work as intended and caused a
-security issue.
-
-This patch applies to curl versions 8.2.0 - 8.3.0. Other versions
-that are affected take a different patch. Refer to the CVE advisory
-for more information.
-
-Bug: https://curl.se/docs/CVE-2023-38545.html
----
- lib/socks.c | 8 +++----
- tests/data/Makefile.inc | 2 +-
- tests/data/test728 | 64 +++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 69 insertions(+), 5 deletions(-)
- create mode 100644 tests/data/test728
-
-diff --git a/lib/socks.c b/lib/socks.c
-index 25a3578..3d41c93 100644
---- a/lib/socks.c
-+++ b/lib/socks.c
-@@ -588,9 +588,9 @@ static CURLproxycode do_SOCKS5(struct Curl_cfilter *cf,
-
- /* RFC1928 chapter 5 specifies max 255 chars for domain name in packet */
- if(!socks5_resolve_local && hostname_len > 255) {
-- infof(data, "SOCKS5: server resolving disabled for hostnames of "
-- "length > 255 [actual len=%zu]", hostname_len);
-- socks5_resolve_local = TRUE;
-+ failf(data, "SOCKS5: the destination hostname is too long to be "
-+ "resolved remotely by the proxy.");
-+ return CURLPX_LONG_HOSTNAME;
- }
-
- if(auth & ~(CURLAUTH_BASIC | CURLAUTH_GSSAPI))
-@@ -904,7 +904,7 @@ CONNECT_RESOLVE_REMOTE:
- }
- else {
- socksreq[len++] = 3;
-- socksreq[len++] = (char) hostname_len; /* one byte address length */
-+ socksreq[len++] = (unsigned char) hostname_len; /* one byte length */
- memcpy(&socksreq[len], sx->hostname, hostname_len); /* w/o NULL */
- len += hostname_len;
- }
-diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
-index 8ee1394..3e2094e 100644
---- a/tests/data/Makefile.inc
-+++ b/tests/data/Makefile.inc
-@@ -100,7 +100,7 @@ test679 test680 test681 test682 test683 test684 test685 test686 \
- \
- test700 test701 test702 test703 test704 test705 test706 test707 test708 \
- test709 test710 test711 test712 test713 test714 test715 test716 test717 \
--test718 test719 test720 test721 \
-+test718 test719 test720 test721 test728 \
- \
- test799 test800 test801 test802 test803 test804 test805 test806 test807 \
- test808 test809 test810 test811 test812 test813 test814 test815 test816 \
-diff --git a/tests/data/test728 b/tests/data/test728
-new file mode 100644
-index 0000000..05bcf28
---- /dev/null
-+++ b/tests/data/test728
-@@ -0,0 +1,64 @@
-+<testcase>
-+<info>
-+<keywords>
-+HTTP
-+HTTP GET
-+SOCKS5
-+SOCKS5h
-+followlocation
-+</keywords>
-+</info>
-+
-+#
-+# Server-side
-+<reply>
-+# The hostname in this redirect is 256 characters and too long (> 255) for
-+# SOCKS5 remote resolve. curl must return error CURLE_PROXY in this case.
-+<data>
-+HTTP/1.1 301 Moved Permanently
-+Location: http://AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/
-+Content-Length: 0
-+Connection: close
-+
-+</data>
-+</reply>
-+
-+#
-+# Client-side
-+<client>
-+<features>
-+proxy
-+</features>
-+<server>
-+http
-+socks5
-+</server>
-+ <name>
-+SOCKS5h with HTTP redirect to hostname too long
-+ </name>
-+ <command>
-+--no-progress-meter --location --proxy socks5h://%HOSTIP:%SOCKSPORT http://%HOSTIP:%HTTPPORT/%TESTNUMBER
-+</command>
-+</client>
-+
-+#
-+# Verify data after the test has been "shot"
-+<verify>
-+<protocol crlf="yes">
-+GET /%TESTNUMBER HTTP/1.1
-+Host: %HOSTIP:%HTTPPORT
-+User-Agent: curl/%VERSION
-+Accept: */*
-+
-+</protocol>
-+<errorcode>
-+97
-+</errorcode>
-+# the error message is verified because error code CURLE_PROXY (97) may be
-+# returned for any number of reasons and we need to make sure it is
-+# specifically for the reason below so that we know the check is working.
-+<stderr mode="text">
-+curl: (97) SOCKS5: the destination hostname is too long to be resolved remotely by the proxy.
-+</stderr>
-+</verify>
-+</testcase>
---
-2.7.4
-
diff --git a/net-misc/curl/files/curl-8.3.0-CVE-2023-38546.patch b/net-misc/curl/files/curl-8.3.0-CVE-2023-38546.patch
deleted file mode 100644
index 615ab26cb2a8..000000000000
--- a/net-misc/curl/files/curl-8.3.0-CVE-2023-38546.patch
+++ /dev/null
@@ -1,131 +0,0 @@
-https://bugs.gentoo.org/915195
-https://github.com/curl/curl/commit/61275672b46d9abb3285740467b882e22ed75da8
-
-From 61275672b46d9abb3285740467b882e22ed75da8 Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg <daniel@haxx.se>
-Date: Thu, 14 Sep 2023 23:28:32 +0200
-Subject: [PATCH] cookie: remove unnecessary struct fields
-
-Plus: reduce the hash table size from 256 to 63. It seems unlikely to
-make much of a speed difference for most use cases but saves 1.5KB of
-data per instance.
-
-Closes #11862
----
- lib/cookie.c | 13 +------------
- lib/cookie.h | 13 ++++---------
- lib/easy.c | 4 +---
- 3 files changed, 6 insertions(+), 24 deletions(-)
-
-diff --git a/lib/cookie.c b/lib/cookie.c
-index 4345a84c6fd9d..e39c89a94a960 100644
---- a/lib/cookie.c
-+++ b/lib/cookie.c
-@@ -119,7 +119,6 @@ static void freecookie(struct Cookie *co)
- free(co->name);
- free(co->value);
- free(co->maxage);
-- free(co->version);
- free(co);
- }
-
-@@ -718,11 +717,7 @@ Curl_cookie_add(struct Curl_easy *data,
- }
- }
- else if((nlen == 7) && strncasecompare("version", namep, 7)) {
-- strstore(&co->version, valuep, vlen);
-- if(!co->version) {
-- badcookie = TRUE;
-- break;
-- }
-+ /* just ignore */
- }
- else if((nlen == 7) && strncasecompare("max-age", namep, 7)) {
- /*
-@@ -1160,7 +1155,6 @@ Curl_cookie_add(struct Curl_easy *data,
- free(clist->path);
- free(clist->spath);
- free(clist->expirestr);
-- free(clist->version);
- free(clist->maxage);
-
- *clist = *co; /* then store all the new data */
-@@ -1224,9 +1218,6 @@ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
- c = calloc(1, sizeof(struct CookieInfo));
- if(!c)
- return NULL; /* failed to get memory */
-- c->filename = strdup(file?file:"none"); /* copy the name just in case */
-- if(!c->filename)
-- goto fail; /* failed to get memory */
- /*
- * Initialize the next_expiration time to signal that we don't have enough
- * information yet.
-@@ -1378,7 +1369,6 @@ static struct Cookie *dup_cookie(struct Cookie *src)
- CLONE(name);
- CLONE(value);
- CLONE(maxage);
-- CLONE(version);
- d->expires = src->expires;
- d->tailmatch = src->tailmatch;
- d->secure = src->secure;
-@@ -1595,7 +1585,6 @@ void Curl_cookie_cleanup(struct CookieInfo *c)
- {
- if(c) {
- unsigned int i;
-- free(c->filename);
- for(i = 0; i < COOKIE_HASH_SIZE; i++)
- Curl_cookie_freelist(c->cookies[i]);
- free(c); /* free the base struct as well */
-diff --git a/lib/cookie.h b/lib/cookie.h
-index b3c0063b2cfb2..41e9e7a6914e0 100644
---- a/lib/cookie.h
-+++ b/lib/cookie.h
-@@ -36,11 +36,7 @@ struct Cookie {
- char *domain; /* domain = <this> */
- curl_off_t expires; /* expires = <this> */
- char *expirestr; /* the plain text version */
--
-- /* RFC 2109 keywords. Version=1 means 2109-compliant cookie sending */
-- char *version; /* Version = <value> */
- char *maxage; /* Max-Age = <value> */
--
- bool tailmatch; /* whether we do tail-matching of the domain name */
- bool secure; /* whether the 'secure' keyword was used */
- bool livecookie; /* updated from a server, not a stored file */
-@@ -56,17 +52,16 @@ struct Cookie {
- #define COOKIE_PREFIX__SECURE (1<<0)
- #define COOKIE_PREFIX__HOST (1<<1)
-
--#define COOKIE_HASH_SIZE 256
-+#define COOKIE_HASH_SIZE 63
-
- struct CookieInfo {
- /* linked list of cookies we know of */
- struct Cookie *cookies[COOKIE_HASH_SIZE];
-- char *filename; /* file we read from/write to */
-- long numcookies; /* number of cookies in the "jar" */
-+ curl_off_t next_expiration; /* the next time at which expiration happens */
-+ int numcookies; /* number of cookies in the "jar" */
-+ int lastct; /* last creation-time used in the jar */
- bool running; /* state info, for cookie adding information */
- bool newsession; /* new session, discard session cookies on load */
-- int lastct; /* last creation-time used in the jar */
-- curl_off_t next_expiration; /* the next time at which expiration happens */
- };
-
- /* The maximum sizes we accept for cookies. RFC 6265 section 6.1 says
-diff --git a/lib/easy.c b/lib/easy.c
-index 16bbd35251d40..03195481f9780 100644
---- a/lib/easy.c
-+++ b/lib/easy.c
-@@ -925,9 +925,7 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data)
- if(data->cookies) {
- /* If cookies are enabled in the parent handle, we enable them
- in the clone as well! */
-- outcurl->cookies = Curl_cookie_init(data,
-- data->cookies->filename,
-- outcurl->cookies,
-+ outcurl->cookies = Curl_cookie_init(data, NULL, outcurl->cookies,
- data->set.cookiesession);
- if(!outcurl->cookies)
- goto fail;
diff --git a/net-misc/curl/files/curl-8.3.0-tests-arm-musl.patch b/net-misc/curl/files/curl-8.3.0-tests-arm-musl.patch
deleted file mode 100644
index e07c13a04766..000000000000
--- a/net-misc/curl/files/curl-8.3.0-tests-arm-musl.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-https://github.com/curl/curl/issues/11900
-https://github.com/curl/curl/commit/b226bd679a68b8bf94cbb6d58837f00251560e63
-https://github.com/curl/curl/commit/9c7165e96a3a9a2d0b7059c87c699b5ca8cdae93
-
-From b226bd679a68b8bf94cbb6d58837f00251560e63 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Mon, 25 Sep 2023 13:03:26 +0200
-Subject: [PATCH] configure: sort AC_CHECK_FUNCS
-
-No functional changes.
----
- configure.ac | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 2fc9f2f01783c..a6f9066a133a4 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -3583,8 +3583,10 @@ AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Se
- #include <sys/types.h>]])
-
-
--AC_CHECK_FUNCS([fnmatch \
-+AC_CHECK_FUNCS([\
-+ arc4random \
- fchmod \
-+ fnmatch \
- fork \
- geteuid \
- getpass_r \
-@@ -3604,7 +3606,6 @@ AC_CHECK_FUNCS([fnmatch \
- snprintf \
- utime \
- utimes \
-- arc4random
- ],[
- ],[
- func="$ac_func"
-
-From 9c7165e96a3a9a2d0b7059c87c699b5ca8cdae93 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Fri, 22 Sep 2023 13:58:49 +0000
-Subject: [PATCH] lib: use wrapper for curl_mime_data fseek callback
-
-fseek uses long offset which does not match with curl_off_t. This leads
-to undefined behavior when calling the callback and caused failure on
-arm 32 bit.
-
-Use a wrapper to solve this and use fseeko which uses off_t instead of
-long.
-
-Thanks to the nice people at Libera IRC #musl for helping finding this
-out.
-
-Fixes #11882
-Fixes #11900
-Closes #11918
----
- configure.ac | 2 ++
- lib/formdata.c | 17 +++++++++++++++--
- 3 files changed, 20 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index a6f9066a133a4..5fa7c45c47430 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -3584,10 +3584,12 @@ AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Se
-
-
- AC_CHECK_FUNCS([\
-+ _fseeki64 \
- arc4random \
- fchmod \
- fnmatch \
- fork \
-+ fseeko \
- geteuid \
- getpass_r \
- getppid \
-diff --git a/lib/formdata.c b/lib/formdata.c
-index 8984b63223cc0..f370ce6854b5f 100644
---- a/lib/formdata.c
-+++ b/lib/formdata.c
-@@ -789,6 +789,20 @@ static CURLcode setname(curl_mimepart *part, const char *name, size_t len)
- return res;
- }
-
-+/* wrap call to fseeko so it matches the calling convetion of callback */
-+static int fseeko_wrapper(void *stream, curl_off_t offset, int whence)
-+{
-+#if defined(HAVE_FSEEKO)
-+ return fseeko(stream, (off_t)offset, whence);
-+#elif defined(HAVE__FSEEKI64)
-+ return _fseeki64(stream, (__int64)offset, whence);
-+#else
-+ if(offset > LONG_MAX)
-+ return -1;
-+ return fseek(stream, (long)offset, whence);
-+#endif
-+}
-+
- /*
- * Curl_getformdata() converts a linked list of "meta data" into a mime
- * structure. The input list is in 'post', while the output is stored in
-@@ -874,8 +888,7 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
- compatibility: use of "-" pseudo file name should be avoided. */
- result = curl_mime_data_cb(part, (curl_off_t) -1,
- (curl_read_callback) fread,
-- CURLX_FUNCTION_CAST(curl_seek_callback,
-- fseek),
-+ fseeko_wrapper,
- NULL, (void *) stdin);
- }
- else
-
diff --git a/net-misc/curl/files/curl-8.5.0-ipv6-configure-c99.patch b/net-misc/curl/files/curl-8.5.0-ipv6-configure-c99.patch
new file mode 100644
index 000000000000..68830f8f4717
--- /dev/null
+++ b/net-misc/curl/files/curl-8.5.0-ipv6-configure-c99.patch
@@ -0,0 +1,31 @@
+https://github.com/curl/curl/commit/ae75db3527461248b0a7b1686df52200d28d83b9
+
+From ae75db3527461248b0a7b1686df52200d28d83b9 Mon Sep 17 00:00:00 2001
+From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com>
+Date: Fri, 29 Dec 2023 05:43:33 +0000
+Subject: [PATCH] configure: fix no default int compile error in ipv6 detection
+
+Closes #12607
+--- a/configure.ac
++++ b/configure.ac
+@@ -1655,15 +1655,12 @@ AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
+ # include <netinet/in6.h>
+ #endif
+ #endif
+-#include <stdlib.h> /* for exit() */
+-main()
++
++int main(void)
+ {
+ struct sockaddr_in6 s;
+ (void)s;
+- if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
+- exit(1);
+- else
+- exit(0);
++ return socket(AF_INET6, SOCK_STREAM, 0) < 0;
+ }
+ ]])
+ ],
+
+
diff --git a/net-misc/curl/files/curl-8.5.0-mpd-stream-http-adjust_pollset.patch b/net-misc/curl/files/curl-8.5.0-mpd-stream-http-adjust_pollset.patch
new file mode 100644
index 000000000000..79a16a2cc7b4
--- /dev/null
+++ b/net-misc/curl/files/curl-8.5.0-mpd-stream-http-adjust_pollset.patch
@@ -0,0 +1,69 @@
+https://github.com/MusicPlayerDaemon/MPD/issues/1952
+https://github.com/curl/curl/issues/12632
+https://github.com/curl/curl/commit/8e2d7b9fa4264b94bd1d9838c84d16e4cd33fbea
+
+From 8e2d7b9fa4264b94bd1d9838c84d16e4cd33fbea Mon Sep 17 00:00:00 2001
+From: Stefan Eissing <stefan@eissing.org>
+Date: Thu, 4 Jan 2024 10:06:17 +0100
+Subject: [PATCH] http: adjust_pollset fix
+
+do not add a socket for POLLIN when the transfer does not want to send
+(for example is paused).
+
+Follow-up to 47f5b1a
+
+Reported-by: bubbleguuum on github
+Fixes #12632
+Closes #12633
+--- a/lib/cf-socket.c
++++ b/lib/cf-socket.c
+@@ -1243,7 +1243,7 @@ static void cf_socket_adjust_pollset(struct Curl_cfilter *cf,
+ if(ctx->sock != CURL_SOCKET_BAD) {
+ if(!cf->connected)
+ Curl_pollset_set_out_only(data, ps, ctx->sock);
+- else
++ else if(CURL_WANT_RECV(data))
+ Curl_pollset_add_in(data, ps, ctx->sock);
+ CURL_TRC_CF(data, cf, "adjust_pollset -> %d socks", ps->num);
+ }
+--- a/lib/http2.c
++++ b/lib/http2.c
+@@ -2341,8 +2341,8 @@ static void cf_h2_adjust_pollset(struct Curl_cfilter *cf,
+ bool c_exhaust, s_exhaust;
+
+ CF_DATA_SAVE(save, cf, data);
+- c_exhaust = !nghttp2_session_get_remote_window_size(ctx->h2);
+- s_exhaust = stream && stream->id >= 0 &&
++ c_exhaust = want_send && !nghttp2_session_get_remote_window_size(ctx->h2);
++ s_exhaust = want_send && stream && stream->id >= 0 &&
+ !nghttp2_session_get_stream_remote_window_size(ctx->h2,
+ stream->id);
+ want_recv = (want_recv || c_exhaust || s_exhaust);
+--- a/lib/vquic/curl_ngtcp2.c
++++ b/lib/vquic/curl_ngtcp2.c
+@@ -1166,9 +1166,10 @@ static void cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf,
+ bool c_exhaust, s_exhaust;
+
+ CF_DATA_SAVE(save, cf, data);
+- c_exhaust = !ngtcp2_conn_get_cwnd_left(ctx->qconn) ||
+- !ngtcp2_conn_get_max_data_left(ctx->qconn);
+- s_exhaust = stream && stream->id >= 0 && stream->quic_flow_blocked;
++ c_exhaust = want_send && (!ngtcp2_conn_get_cwnd_left(ctx->qconn) ||
++ !ngtcp2_conn_get_max_data_left(ctx->qconn));
++ s_exhaust = want_send && stream && stream->id >= 0 &&
++ stream->quic_flow_blocked;
+ want_recv = (want_recv || c_exhaust || s_exhaust);
+ want_send = (!s_exhaust && want_send) ||
+ !Curl_bufq_is_empty(&ctx->q.sendbuf);
+--- a/lib/vquic/curl_quiche.c
++++ b/lib/vquic/curl_quiche.c
+@@ -1189,7 +1189,7 @@ static void cf_quiche_adjust_pollset(struct Curl_cfilter *cf,
+
+ c_exhaust = FALSE; /* Have not found any call in quiche that tells
+ us if the connection itself is blocked */
+- s_exhaust = stream && stream->id >= 0 &&
++ s_exhaust = want_send && stream && stream->id >= 0 &&
+ (stream->quic_flow_blocked || !stream_is_writeable(cf, data));
+ want_recv = (want_recv || c_exhaust || s_exhaust);
+ want_send = (!s_exhaust && want_send) ||
+
diff --git a/net-misc/rsync/Manifest b/net-misc/rsync/Manifest
index 7d58bbf6f999..79492edd8765 100644
--- a/net-misc/rsync/Manifest
+++ b/net-misc/rsync/Manifest
@@ -3,6 +3,7 @@ AUX rsync-3.2.4-strlcpy.patch 1715 BLAKE2B 4159391589cc6eba7c6719b15d32d33e68ff5
AUX rsync-3.2.4-unsigned-char-checksum.patch 610 BLAKE2B eb6803c673bb38907738e5475e9469c07555d96769cc86baad43f806cd6a823c5aa9d890c63096b5c229402315cdd90d76d93687ddc1a7d17360ff739afc9596 SHA512 a8f8eb0568139893e2f3f36feb1cebfb5fcf3b1fd807459bce635d61f2582e960c55b0bb4c8914a6579ad0eb7e4322d2ce3480598d425e256fb6a73efbc9315e
AUX rsync-3.2.7-flist-memcmp-ub.patch 773 BLAKE2B 9a30609a0bf09298dc2b1daeae7dcf3ba173d1d2431c077d612be03a3a531bf59b16d1846a8f7c467ef2ca576e01f0fe512067a04f834a9ca3d387e389b5d6e8 SHA512 4212d704d9b4b1a0d2d2cfca48ae91d29b90111ce4256ec8f9779d0778fe2bbb4a33b95e8a32ef181e1ab0ac2d1ea330e724a46f078826b39d2e09d374be6730
AUX rsync-3.2.7-fortify-source-3.patch 1947 BLAKE2B c907e4ddc07693d8a6292f32782831953eee8711148c2e9aa5623dc5615474b59f25e309302c103a6c4a4177b18291a00983a62fa77c7faee04731114634c65d SHA512 b2bd012f318b1816a299a766c28a64cfc86307e4e1b047098f2a0334d775513f83724cdfa33ce567120c9b4fbbf9f6b8e0bbad0d434ac2444afff39fb5fa41da
+AUX rsync-3.2.7-ipv6-configure-c99.patch 1001 BLAKE2B 1ddb96eecef82a056af00ae221b9f5bc26284863a1ce63ae423e0b14979cfd57eb18f966f7572315e495ae25e4762da4115def7f04e32fe90cbc2b7a522805c0 SHA512 19a10798b8460741b8a3341a210d1828e1daeae707ad8cc910e4aa003e8bba405466a6cc64465294bd4eda81f1f876410a395e5012c3872cfce025f7ed0eec94
AUX rsyncd.conf-3.0.9-r1 462 BLAKE2B 45a7dde876368e7392ee7a05edf593f55cf6b3b4dc913745f4322ebd75f97bcdf1a24240a54e11469bd659fd565fc74cd8eeaa9490434d88444b5a076803cea7 SHA512 5c57f633aa3daa6513b5d35a1157a50308559ad993257374ce4eea0269f6bf384938f95bed749acb19538e8c4672355351fcee5cef9607153463b19227d343d7
AUX rsyncd.conf.d 149 BLAKE2B fd2556d0c270c2baa83d4d474d44ab1d16e35f112279a339f179f9af693d977cc0863bf4cd7139363c58e4e6a1a18a24c06474ecc248167224261dbaf04ae0a8 SHA512 8ea9a2f1fea508fa132313fa16513eac84a9ed3ce75741c42769b56bbcd3f1bd2eb8bfdfe40a6c7f619e4281e8fc8d95d1bd84096d0b64aaacf606cd614ae5b3
AUX rsyncd.init.d-r1 247 BLAKE2B ec4f7a875a51bae10cff7e15df18d285b01dddaa99a03127ba242ec535b7c8a3af3ad4489661ba7b5f6b074e2af38b12da394c0f8992bd28328d807a89757bb0 SHA512 df2ef4d9e65fa72daa9a7d91d69a06027d0e0fbc48f9ebd485e2d51990c8d00985b7ccf41314f984975e8073e2075bbdfe5543754718381497c334dc7d96451a
@@ -15,5 +16,6 @@ DIST rsync-3.2.7.tar.gz.asc 195 BLAKE2B d2bca9276d9a0c96a9156a8da60e391f58eceb2e
EBUILD rsync-3.2.4-r3.ebuild 4750 BLAKE2B e743c73dae35b841ad484d3a1dc0359ced3ee95d4357949bf1d8a805f170a46039de35275406cc051cf2475f89333f9c8593f08ea6a2de0ab8eaae1702755d8b SHA512 7bcda7d6e51a17fe8ad3a609128934d6859f6b6eecd308a5939199efec0f9726bdb78a726c37541c85e506db55e455b30f050a6b9e615810f4647b79f986941d
EBUILD rsync-3.2.7-r2.ebuild 5420 BLAKE2B 2116751f4b399612a3869a59d7e361025ddeb179df10a37fc99792e8d33f4cb4fadfc9b143d26b116cfd08753bd181c92055b048ae7b803495840b8ff00c9f1b SHA512 cc714464c0ca82f1ed6b62fbee7c348551b35fdffaaeb1208fa4092be91b05c83b48f19e4ae187242135e34f09beea2bc311969fffe311219aab9604597d2b51
EBUILD rsync-3.2.7-r3.ebuild 5471 BLAKE2B 6f4ab5a7ff10565fb8adfde3af75e381b164591561fa4c40adae208fd987299bd59560121ea39e92e4b1a81016f93ac36899cfa54e0cd1cf81e6d2fc419208e2 SHA512 c7c5162e82305ab50c1437285476ae726064897fe549bbca1a3d2c79b2e7abc563d1d0ee48ebcf71c7331d52a1417d9eba2fcb791732202fab182db81c1ec871
+EBUILD rsync-3.2.7-r4.ebuild 5522 BLAKE2B ef0954603b116c33ff9115ba8d2309751e04539f04eaf467681142aab4a9a169c3533f89831757227819f51e4608304b410f744546433aed3c97fd95a6ddf051 SHA512 773974e80a1159a6051cc57164e0be1c64ed422d41199f3ea0b5d9e4dea0b76029502158acfbbcc4293ea2e3130bc2472419e1908568a1bbb6deaca3ef844f52
EBUILD rsync-9999.ebuild 5428 BLAKE2B 45d968a8a88ecade2dc75a3427d074f0afeb9f4f909ac1a20943a5f89ecd8a1865634dbc26f1327e83b1d7b68ddf2d01380b0e25abe7b77bc78a05f1d991741e SHA512 aa68bb7a0f1ccea651e7e0a55af44346144cb5af1f176d0bc4efd00835498db694afd9bb31eac40d13d12ec624b9ba6e47059df123e9a19d8f211c649322819a
MISC metadata.xml 880 BLAKE2B b079b9b9cb5dcc93b50d49fa50723729b7c57c34ad0cdfd946821089a1f9788a460818cef8d6a4e9f603ad066f6b3a0c22c7becb950abc1eac8e2923adf18bac SHA512 215f0df65f53e2aca8d519c85111f87e95d592454b8a297f69058c1d87ff5650f32f3c937715c8a83dc9bef1ca1e70589cd3797ca595688806c1067462717c14
diff --git a/net-misc/rsync/files/rsync-3.2.7-ipv6-configure-c99.patch b/net-misc/rsync/files/rsync-3.2.7-ipv6-configure-c99.patch
new file mode 100644
index 000000000000..1b99dc61088b
--- /dev/null
+++ b/net-misc/rsync/files/rsync-3.2.7-ipv6-configure-c99.patch
@@ -0,0 +1,32 @@
+https://github.com/WayneD/rsync/pull/558
+
+From d869bcd3850b9a80f27f5aee4d41725f39d84ea7 Mon Sep 17 00:00:00 2001
+From: Ivan Babrou <github@ivan.computer>
+Date: Mon, 1 Jan 2024 19:31:01 -0800
+Subject: [PATCH] configure.ac: fix failing IPv6 check due to missing return
+ type
+
+Fixing this warning escalated to an error, resuting in no IPv6 support:
+
+```
+configure.sh:7679: checking whether to enable ipv6
+configure.sh:7718: clang -o conftest -g -O2 -DHAVE_CONFIG_H -Wall -W conftest.c >&5
+conftest.c:73:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
+main()
+^
+int
+1 error generated.
+configure.sh:7718: $? = 1
+configure.sh: program exited with status 1
+```
+--- a/configure.ac
++++ b/configure.ac
+@@ -392,7 +392,7 @@ AS_HELP_STRING([--disable-ipv6],[disable to omit ipv6 support]),
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+-main()
++int main()
+ {
+ if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
+ exit(1);
diff --git a/net-misc/rsync/rsync-3.2.7-r4.ebuild b/net-misc/rsync/rsync-3.2.7-r4.ebuild
new file mode 100644
index 000000000000..b3788a1dce17
--- /dev/null
+++ b/net-misc/rsync/rsync-3.2.7-r4.ebuild
@@ -0,0 +1,205 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Uncomment when introducing a patch which touches configure
+RSYNC_NEEDS_AUTOCONF=1
+PYTHON_COMPAT=( python3_{9..11} )
+inherit flag-o-matic prefix python-single-r1 systemd
+
+DESCRIPTION="File transfer program to keep remote files into sync"
+HOMEPAGE="https://rsync.samba.org/"
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/WayneD/rsync.git"
+ inherit autotools git-r3
+
+ REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+else
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/waynedavison.asc
+ inherit verify-sig
+
+ if [[ -n ${RSYNC_NEEDS_AUTOCONF} ]] ; then
+ inherit autotools
+ fi
+
+ if [[ ${PV} == *_pre* ]] ; then
+ SRC_DIR="src-previews"
+ else
+ SRC_DIR="src"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+ fi
+
+ SRC_URI="https://rsync.samba.org/ftp/rsync/${SRC_DIR}/${P/_/}.tar.gz
+ verify-sig? ( https://rsync.samba.org/ftp/rsync/${SRC_DIR}/${P/_/}.tar.gz.asc )"
+ S="${WORKDIR}"/${P/_/}
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="acl examples iconv lz4 rrsync ssl stunnel system-zlib xattr xxhash zstd"
+REQUIRED_USE+=" examples? ( ${PYTHON_REQUIRED_USE} )"
+REQUIRED_USE+=" rrsync? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ >=dev-libs/popt-1.5
+ acl? ( virtual/acl )
+ examples? (
+ ${PYTHON_DEPS}
+ dev-lang/perl
+ )
+ lz4? ( app-arch/lz4:= )
+ rrsync? (
+ ${PYTHON_DEPS}
+ $(python_gen_cond_dep '
+ dev-python/bracex[${PYTHON_USEDEP}]
+ ')
+ )
+ ssl? ( dev-libs/openssl:= )
+ system-zlib? ( sys-libs/zlib )
+ xattr? ( kernel_linux? ( sys-apps/attr ) )
+ xxhash? ( >=dev-libs/xxhash-0.8 )
+ zstd? ( >=app-arch/zstd-1.4:= )
+ iconv? ( virtual/libiconv )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ examples? ( ${PYTHON_DEPS} )
+ rrsync? ( ${PYTHON_DEPS} )
+"
+
+if [[ ${PV} == *9999 ]] ; then
+ BDEPEND+=" ${PYTHON_DEPS}
+ $(python_gen_cond_dep '
+ dev-python/commonmark[${PYTHON_USEDEP}]
+ ')"
+else
+ BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-waynedavison )"
+fi
+
+PATCHES=(
+ "${FILESDIR}"/${P}-flist-memcmp-ub.patch
+ "${FILESDIR}"/${P}-fortify-source-3.patch
+ "${FILESDIR}"/${PN}-3.2.7-ipv6-configure-c99.patch
+)
+
+pkg_setup() {
+ # - USE=examples needs Python itself at runtime, but nothing else
+ # - 9999 needs commonmark at build time
+ if [[ ${PV} == *9999 ]] || use examples || use rrsync; then
+ python-single-r1_pkg_setup
+ fi
+}
+
+src_prepare() {
+ default
+
+ if [[ ${PV} == *9999 || -n ${RSYNC_NEEDS_AUTOCONF} ]] ; then
+ eaclocal -I m4
+ eautoconf -o configure.sh
+ eautoheader && touch config.h.in
+ fi
+
+ if use examples || use rrsync; then
+ python_fix_shebang support/
+ fi
+
+ if [[ -f rrsync.1 ]]; then
+ # If the pre-build rrsync.1 man page exists, then link to it
+ # from support/rrsync.1 to avoid rsync's build system attempting
+ # re-creating the man page (bug #883049).
+ ln -s ../rrsync.1 support/rrsync.1 || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --with-rsyncd-conf="${EPREFIX}"/etc/rsyncd.conf
+ --without-included-popt
+ --enable-ipv6
+ $(use_enable acl acl-support)
+ $(use_enable iconv)
+ $(use_enable lz4)
+ $(use_with rrsync)
+ $(use_enable ssl openssl)
+ $(use_with !system-zlib included-zlib)
+ $(use_enable xattr xattr-support)
+ $(use_enable xxhash)
+ $(use_enable zstd)
+ )
+
+ # https://github.com/WayneD/rsync/pull/428
+ if is-flagq -fsanitize=undefined ; then
+ sed -E -i \
+ -e 's:#define CAREFUL_ALIGNMENT (0|1):#define CAREFUL_ALIGNMENT 1:' \
+ byteorder.h || die
+ append-flags -DCAREFUL_ALIGNMENT
+ fi
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ newconfd "${FILESDIR}"/rsyncd.conf.d rsyncd
+ newinitd "${FILESDIR}"/rsyncd.init.d-r1 rsyncd
+
+ dodoc NEWS.md README.md TODO tech_report.tex
+
+ insinto /etc
+ newins "${FILESDIR}"/rsyncd.conf-3.0.9-r1 rsyncd.conf
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/rsyncd.logrotate rsyncd
+
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}"/rsyncd.xinetd-3.0.9-r1 rsyncd
+
+ # Install stunnel helpers
+ if use stunnel ; then
+ emake DESTDIR="${D}" install-ssl-daemon
+ fi
+
+ # Install the useful contrib scripts
+ if use examples ; then
+ # The 'rrsync' script is installed conditionally via the 'rrysnc'
+ # USE flag, and not via the 'examples' USE flag.
+ rm support/rrsync* || die
+
+ exeinto /usr/share/rsync
+ doexe support/*
+
+ rm -f "${ED}"/usr/share/rsync/{Makefile*,*.c}
+ fi
+
+ eprefixify "${ED}"/etc/{,xinetd.d}/rsyncd*
+
+ systemd_newunit packaging/systemd/rsync.service rsyncd.service
+}
+
+pkg_postinst() {
+ if grep -Eqis '^[[:space:]]use chroot[[:space:]]*=[[:space:]]*(no|0|false)' \
+ "${EROOT}"/etc/rsyncd.conf "${EROOT}"/etc/rsync/rsyncd.conf ; then
+ ewarn "You have disabled chroot support in your rsyncd.conf. This"
+ ewarn "is a security risk which you should fix. Please check your"
+ ewarn "/etc/rsyncd.conf file and fix the setting 'use chroot'."
+ fi
+
+ if use stunnel ; then
+ einfo "Please install \">=net-misc/stunnel-4\" in order to use stunnel feature."
+ einfo
+ einfo "You maybe have to update the certificates configured in"
+ einfo "${EROOT}/etc/stunnel/rsync.conf"
+ fi
+
+ if use system-zlib ; then
+ ewarn "Using system-zlib is incompatible with <rsync-3.1.1 when"
+ ewarn "using the --compress option."
+ ewarn
+ ewarn "When syncing with >=rsync-3.1.1 built with bundled zlib,"
+ ewarn "and the --compress option, add --new-compress (-zz)."
+ ewarn
+ ewarn "For syncing the portage tree, add:"
+ ewarn "PORTAGE_RSYNC_EXTRA_OPTS=\"--new-compress\" to make.conf"
+ fi
+}