Diff asterisk-11.25.3-r1 with a asterisk-13.34.0

/usr/portage/net-misc/asterisk/asterisk-13.34.0.ebuild 2020-07-21 00:09:00.000000000 +0300
1 1
# Copyright 1999-2020 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=6
5
inherit autotools linux-info systemd
4
EAPI=7
6 5

  
7
MY_P="${PN}-${PV/_/-}"
6
inherit autotools linux-info systemd
8 7

  
9 8
DESCRIPTION="Asterisk: A Modular Open Source PBX System"
10
HOMEPAGE="http://www.asterisk.org/"
11
SRC_URI="http://downloads.asterisk.org/pub/telephony/asterisk/releases/${MY_P}.tar.gz
12
	mirror://gentoo/gentoo-asterisk-patchset-3.17.tar.bz2"
9
HOMEPAGE="https://www.asterisk.org/"
10
SRC_URI="https://downloads.asterisk.org/pub/telephony/asterisk/releases/${P}.tar.gz
11
	https://downloads.uls.co.za/gentoo/asterisk/gentoo-asterisk-patchset-4.08.tar.bz2"
13 12
LICENSE="GPL-2"
14 13
SLOT="0"
15
KEYWORDS="amd64 x86"
14
KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86"
16 15

  
17 16
IUSE_VOICEMAIL_STORAGE="
18 17
	+voicemail_storage_file
19 18
	voicemail_storage_odbc
20 19
	voicemail_storage_imap
21 20
"
22
IUSE="${IUSE_VOICEMAIL_STORAGE} alsa bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc xmpp ldap libedit libressl lua mysql newt +samples odbc oss portaudio postgres radius selinux snmp span speex srtp static syslog vorbis"
21
IUSE="${IUSE_VOICEMAIL_STORAGE} alsa bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog vorbis xmpp"
23 22
IUSE_EXPAND="VOICEMAIL_STORAGE"
24 23
REQUIRED_USE="gtalk? ( xmpp )
25 24
	^^ ( ${IUSE_VOICEMAIL_STORAGE/+/} )
26 25
	voicemail_storage_odbc? ( odbc )
27 26
"
28 27

  
29
EPATCH_SUFFIX="patch"
30
PATCHES=( "${WORKDIR}/asterisk-patchset" )
28
PATCHES=(
29
	"${FILESDIR}/${PN}-historic-no-var-run-install.patch"
30
	"${FILESDIR}/${PN}-13.33.0-nossl.patch"
31
)
31 32

  
32
CDEPEND="acct-user/asterisk
33
DEPEND="acct-user/asterisk
33 34
	acct-group/asterisk
34 35
	dev-db/sqlite:3
35 36
	dev-libs/popt
36
	dev-libs/libxml2
37
	!libressl? ( =dev-libs/openssl-1.0*:0= )
38
	libressl? ( dev-libs/libressl:0= )
39
	sys-libs/ncurses:*
37
	dev-libs/jansson
38
	dev-libs/libedit
39
	dev-libs/libxml2:2
40
	dev-libs/libxslt
41
	sys-libs/ncurses:0=
40 42
	sys-libs/zlib
41 43
	alsa? ( media-libs/alsa-lib )
42
	bluetooth? ( net-wireless/bluez )
44
	bluetooth? ( net-wireless/bluez:= )
43 45
	calendar? (
46
		net-libs/neon:=
47
		dev-libs/libical:=
44 48
		dev-libs/iksemel
45
		dev-libs/libical
46
		net-libs/neon
47 49
	)
48 50
	caps? ( sys-libs/libcap )
49 51
	cluster? ( sys-cluster/corosync )
50 52
	curl? ( net-misc/curl )
51
	dahdi? ( >=net-libs/libpri-1.4.12_beta2
52
		net-misc/dahdi-tools )
53
	dahdi? (
54
		net-libs/libpri
55
		net-misc/dahdi-tools
56
	)
53 57
	freetds? ( dev-db/freetds )
54 58
	gtalk? ( dev-libs/iksemel )
55 59
	http? ( dev-libs/gmime:2.6 )
56 60
	iconv? ( virtual/libiconv )
57
	ilbc? ( dev-libs/ilbc-rfc3951 )
58
	xmpp? ( dev-libs/iksemel )
61
	ilbc? ( media-libs/libilbc )
59 62
	ldap? ( net-nds/openldap )
60
	libedit? ( dev-libs/libedit )
61 63
	lua? ( dev-lang/lua:* )
62
	mysql? ( virtual/mysql )
64
	mysql? ( dev-db/mysql-connector-c:= )
63 65
	newt? ( dev-libs/newt )
64 66
	odbc? ( dev-db/unixODBC )
67
	pjproject? ( net-libs/pjproject )
65 68
	portaudio? ( media-libs/portaudio )
66 69
	postgres? ( dev-db/postgresql:* )
67 70
	radius? ( net-dialup/freeradius-client )
68
	snmp? ( net-analyzer/net-snmp )
71
	snmp? ( net-analyzer/net-snmp:= )
69 72
	span? ( media-libs/spandsp )
70
	speex? ( media-libs/speex )
73
	speex? (
74
		media-libs/speex
75
		media-libs/speexdsp
76
	)
71 77
	srtp? ( net-libs/libsrtp:0 )
72
	vorbis? ( media-libs/libvorbis )"
73

  
74
DEPEND="${CDEPEND}
78
	ssl? (
79
		!libressl? ( dev-libs/openssl:0= )
80
		libressl? ( dev-libs/libressl:0= )
81
	)
82
	vorbis? ( media-libs/libvorbis )
75 83
	voicemail_storage_imap? ( virtual/imap-c-client )
76
	virtual/pkgconfig
84
	xmpp? ( dev-libs/iksemel )
77 85
"
78 86

  
79
RDEPEND="${CDEPEND}
87
RDEPEND="${DEPEND}
88
	net-misc/asterisk-core-sounds
89
	net-misc/asterisk-extra-sounds
90
	net-misc/asterisk-moh-opsound
80 91
	selinux? ( sec-policy/selinux-asterisk )
81 92
	syslog? ( virtual/logger )"
82 93

  
83
PDEPEND="net-misc/asterisk-core-sounds
84
	net-misc/asterisk-extra-sounds
85
	net-misc/asterisk-moh-opsound"
94
BDEPEND="virtual/pkgconfig"
86 95

  
87
S="${WORKDIR}/${MY_P}"
96
QA_DT_NEEDED="/usr/lib.*/libasteriskssl[.]so[.][0-9]\+"
88 97

  
89 98
pkg_setup() {
90 99
	CONFIG_CHECK="~!NF_CONNTRACK_SIP"
......
96 105

  
97 106
src_prepare() {
98 107
	default
99
	AT_M4DIR=autoconf eautoreconf
108
	AT_M4DIR="autoconf third-party third-party/pjproject third-party/jansson" eautoreconf
109
}
110

  
111
function menuselect() {
112
	menuselect/menuselect "$@" || die "menuselect $* failed."
100 113
}
101 114

  
102 115
src_configure() {
......
108 121
		--with-crypto \
109 122
		--with-gsm=internal \
110 123
		--with-popt \
111
		--with-ssl \
112 124
		--with-z \
113
		--without-pwlib \
125
		--with-libedit \
114 126
		$(use_with caps cap) \
115 127
		$(use_with http gmime) \
116 128
		$(use_with newt) \
117
		$(use_with portaudio)
129
		$(use_with pjproject) \
130
		$(use_with portaudio) \
131
		$(use_with ssl)
118 132

  
119 133
	# Blank out sounds/sounds.xml file to prevent
120 134
	# asterisk from installing sounds files (we pull them in via
......
125 139
	sed -i 's/NATIVE_ARCH=/NATIVE_ARCH=0/' build_tools/menuselect-deps || die "Unable to squelch noisy build system"
126 140

  
127 141
	# Compile menuselect binary for optional components
128
	emake menuselect.makeopts
142
	emake NOISE_BUILD=yes menuselect.makeopts
143

  
144
	# Disable BUILD_NATIVE (bug #667498)
145
	menuselect --disable build_native menuselect.makeopts
129 146

  
130 147
	# Broken functionality is forcibly disabled (bug #360143)
131
	menuselect/menuselect --disable chan_misdn menuselect.makeopts
132
	menuselect/menuselect --disable chan_ooh323 menuselect.makeopts
148
	menuselect --disable chan_misdn menuselect.makeopts
149
	menuselect --disable chan_ooh323 menuselect.makeopts
133 150

  
134 151
	# Utility set is forcibly enabled (bug #358001)
135
	menuselect/menuselect --enable smsq menuselect.makeopts
136
	menuselect/menuselect --enable streamplayer menuselect.makeopts
137
	menuselect/menuselect --enable aelparse menuselect.makeopts
138
	menuselect/menuselect --enable astman menuselect.makeopts
152
	menuselect --enable smsq menuselect.makeopts
153
	menuselect --enable streamplayer menuselect.makeopts
154
	menuselect --enable aelparse menuselect.makeopts
155
	menuselect --enable astman menuselect.makeopts
139 156

  
140 157
	# this is connected, otherwise it would not find
141 158
	# ast_pktccops_gate_alloc symbol
142
	menuselect/menuselect --enable chan_mgcp menuselect.makeopts
143
	menuselect/menuselect --enable res_pktccops menuselect.makeopts
159
	menuselect --enable chan_mgcp menuselect.makeopts
160
	menuselect --enable res_pktccops menuselect.makeopts
144 161

  
145 162
	# SSL is forcibly enabled, IAX2 & DUNDI are expected to be available
146
	menuselect/menuselect --enable pbx_dundi menuselect.makeopts
147
	menuselect/menuselect --enable func_aes menuselect.makeopts
148
	menuselect/menuselect --enable chan_iax2 menuselect.makeopts
163
	menuselect --enable pbx_dundi menuselect.makeopts
164
	menuselect --enable func_aes menuselect.makeopts
165
	menuselect --enable chan_iax2 menuselect.makeopts
149 166

  
150 167
	# SQlite3 is now the main database backend, enable related features
151
	menuselect/menuselect --enable cdr_sqlite3_custom menuselect.makeopts
152
	menuselect/menuselect --enable cel_sqlite3_custom menuselect.makeopts
168
	menuselect --enable cdr_sqlite3_custom menuselect.makeopts
169
	menuselect --enable cel_sqlite3_custom menuselect.makeopts
153 170

  
154 171
	# The others are based on USE-flag settings
155 172
	use_select() {
......
157 174
		shift # remove use from parameters
158 175

  
159 176
		while [[ -n $1 ]]; do
160
			menuselect/menuselect --${state} "$1" menuselect.makeopts
177
			menuselect --${state} "$1" menuselect.makeopts
161 178
			shift
162 179
		done
163 180
	}
164 181

  
165
	use_select alsa			chan_alsa
166
	use_select bluetooth		chan_mobile
167
	use_select calendar		res_calendar res_calendar_{caldav,ews,exchange,icalendar}
168
	use_select cluster		res_corosync
169
	use_select curl			func_curl res_config_curl res_curl
170
	use_select dahdi		app_dahdibarge app_dahdiras app_meetme chan_dahdi codec_dahdi res_timing_dahdi
171
	use_select freetds		{cdr,cel}_tds
172
	use_select gtalk		chan_motif
173
	use_select http			res_http_post
174
	use_select iconv		func_iconv
175
	use_select xmpp			res_xmpp
176
	use_select ilbc                 codec_ilbc format_ilbc
177
	use_select ldap			res_config_ldap
178
	use_select lua			pbx_lua
179
	use_select mysql		app_mysql cdr_mysql res_config_mysql
180
	use_select odbc			cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
181
	use_select oss			chan_oss
182
	use_select postgres		{cdr,cel}_pgsql res_config_pgsql
183
	use_select radius		{cdr,cel}_radius
184
	use_select snmp			res_snmp
185
	use_select span			res_fax_spandsp
186
	use_select speex		{codec,func}_speex
187
	use_select srtp			res_srtp
188
	use_select syslog		cdr_syslog
189
	use_select vorbis		format_ogg_vorbis
182
	use_select alsa         chan_alsa
183
	use_select bluetooth    chan_mobile
184
	use_select calendar     res_calendar res_calendar_{caldav,ews,exchange,icalendar}
185
	use_select cluster      res_corosync
186
	use_select curl         func_curl res_config_curl res_curl
187
	use_select dahdi        app_dahdiras app_meetme chan_dahdi codec_dahdi res_timing_dahdi
188
	use_select freetds      {cdr,cel}_tds
189
	use_select gtalk        chan_motif
190
	use_select http         res_http_post
191
	use_select iconv        func_iconv
192
	use_select ilbc         codec_ilbc format_ilbc
193
	use_select ldap         res_config_ldap
194
	use_select lua          pbx_lua
195
	use_select mysql        app_mysql cdr_mysql res_config_mysql
196
	use_select odbc         cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
197
	use_select oss          chan_oss
198
	use_select postgres     {cdr,cel}_pgsql res_config_pgsql
199
	use_select radius       {cdr,cel}_radius
200
	use_select snmp         res_snmp
201
	use_select span         res_fax_spandsp
202
	use_select speex        {codec,func}_speex
203
	use_select srtp         res_srtp
204
	use_select statsd       res_statsd res_{endpoint,chan}_stats
205
	use_select syslog       cdr_syslog
206
	use_select vorbis       format_ogg_vorbis
207
	use_select xmpp         res_xmpp
190 208

  
191 209
	# Voicemail storage ...
192 210
	for vmst in ${IUSE_VOICEMAIL_STORAGE/+/}; do
193 211
		if use ${vmst}; then
194
			menuselect/menuselect --enable $(echo ${vmst##*_} | tr '[:lower:]' '[:upper:]')_STORAGE menuselect.makeopts
212
			menuselect --enable $(echo ${vmst##*_} | tr '[:lower:]' '[:upper:]')_STORAGE menuselect.makeopts
195 213
		fi
196 214
	done
197 215

  
198 216
	if use debug; then
199 217
		for o in DONT_OPTIMIZE DEBUG_THREADS BETTER_BACKTRACES; do
200
			menuselect/menuselect --enable $o menuselect.makeopts
218
			menuselect --enable $o menuselect.makeopts
201 219
		done
202 220
	fi
203 221
}
204 222

  
205 223
src_compile() {
206
	ASTLDFLAGS="${LDFLAGS}" emake
224
	emake ASTCFLAGS="${CFLAGS}" ASTLDFLAGS="${LDFLAGS}" NOISY_BUILD=yes
207 225
}
208 226

  
209 227
src_install() {
210
	mkdir -p "${D}"usr/$(get_libdir)/pkgconfig || die
211
	emake DESTDIR="${D}" installdirs
212
	emake DESTDIR="${D}" install
228
	local d
229

  
230
	mkdir -p "${ED}/usr/$(get_libdir)/pkgconfig" || die
231
	emake DESTDIR="${ED}" NOISY_BUILD=yes install
213 232

  
214 233
	if use radius; then
215 234
		insinto /etc/radiusclient/
......
217 236
	fi
218 237
	diropts -m 0750 -o root -g asterisk
219 238
	keepdir	/etc/asterisk
220
	if use samples; then
221
		emake DESTDIR="${D}" samples
222
		for conffile in "${D}"etc/asterisk/*.*
223
		do
224
			chown root:root $conffile
225
			chmod 0644 $conffile
226
		done
227
		einfo "Sample files have been installed"
228
	else
229
		einfo "Skipping installation of sample files..."
230
		rm -f  "${D}"var/lib/asterisk/mohmp3/* || die
231
		rm -f  "${D}"var/lib/asterisk/sounds/demo-* || die
232
		rm -f  "${D}"var/lib/asterisk/agi-bin/* || die
233
		rm -f  "${D}"etc/asterisk/* || die
234
	fi
235
	rm -rf "${D}"var/spool/asterisk/voicemail/default || die
239
	emake NOISY_BUILD=yes DESTDIR="${ED}" CONFIG_SRC=configs/samples CONFIG_EXTEN=.sample install-configs
240
	for conffile in "${ED}/etc/asterisk/"*
241
	do
242
		fowners root:root "${conffile#${ED}}"
243
		fperms 0644 "${conffile#${ED}}"
244
	done
236 245

  
237 246
	# keep directories
238
	diropts -m 0770 -o asterisk asterisk
247
	diropts -m 0750 -o asterisk -g root
239 248
	keepdir /var/lib/asterisk
240 249
	keepdir /var/spool/asterisk
241
	keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
250
	keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail,recording}
242 251
	diropts -m 0750 -o asterisk -g asterisk
243 252
	keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
244 253

  
......
249 258
	systemd_newtmpfilesd "${FILESDIR}"/asterisk.tmpfiles.conf asterisk.conf
250 259
	systemd_install_serviced "${FILESDIR}"/asterisk.service.conf
251 260

  
261
	# Reset diropts else dodoc uses it for doc installations.
262
	diropts -m0755
263

  
252 264
	# install the upgrade documentation
253
	#
254
	dodoc README UPGRADE* BUGS CREDITS
265
	dodoc UPGRADE* BUGS CREDITS
255 266

  
256 267
	# install extra documentation
257
	#
258
	if use doc
259
	then
268
	if use doc; then
260 269
		dodoc doc/*.txt
261 270
		dodoc doc/*.pdf
262 271
	fi
......
265 274
	#
266 275
	insinto /etc/logrotate.d
267 276
	newins "${FILESDIR}/1.6.2/asterisk.logrotate4" asterisk
268
}
269 277

  
270
pkg_postinst() {
271
	#
272
	# Announcements, warnings, reminders...
273
	#
274
	einfo "Asterisk has been installed"
275
	echo
276
	elog "If you want to know more about asterisk, visit these sites:"
277
	elog "http://www.asteriskdocs.org/"
278
	elog "http://www.voip-info.org/wiki-Asterisk"
279
	echo
280
	elog "http://www.automated.it/guidetoasterisk.htm"
281
	echo
282
	elog "Gentoo VoIP IRC Channel:"
283
	elog "#gentoo-voip @ irc.freenode.net"
284
	echo
285
	echo
286
	elog "Please read the Asterisk 11 upgrade document:"
287
	elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+11"
278
	# Asterisk installs a few folders that's empty by design,
279
	# but still required.  This finds them, and marks them for
280
	# portage.
281
	for d in $(find "${ED}"/var -type d -empty || die "Find failed."); do
282
		keepdir "${d#${ED}}"
283
	done
288 284
}
289 285

  
290
pkg_config() {
291
	einfo "Do you want to reset file permissions and ownerships (y/N)?"
292

  
293
	read tmp
294
	tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
295

  
296
	if [[ "$tmp" = "y" ]] ||\
297
		[[ "$tmp" = "yes" ]]
298
	then
299
		einfo "Resetting permissions to defaults..."
300

  
301
		for x in spool run lib log; do
302
			chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
303
			chmod -R u=rwX,g=rwX,o=    "${ROOT}"var/${x}/asterisk
304
		done
305

  
306
		chown -R root:asterisk  "${ROOT}"etc/asterisk
307
		chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
308

  
309
		einfo "done"
310
	else
311
		einfo "skipping"
286
pkg_postinst() {
287
	if [ -z "${REPLACING_VERSIONS}" ]; then
288
		elog "Asterisk Wiki: https://wiki.asterisk.org/wiki/"
289
		elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net"
290
	elif [ "$(ver_cut 1 "${REPLACING_VERSIONS}")" != "$(ver_cut 1)" ]; then
291
		elog "You are updating from Asterisk $(ver_cut 1 "${REPLACING_VERSIONS}") upgrade document:"
292
		elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+$(ver_cut 1)"
293
		elog "Gentoo VoIP IRC Channel: #gentoo-voip @ irc.freenode.net"
312 294
	fi
313 295
}
Thank you!