blob: c912b3d1dde13c18f1068ce7280237199b9e9594 [file] [log] [blame]
Fabio Berton14648002015-09-30 21:29:34 -03001DESCRIPTION = "Asterisk is an Open Source PBX and telephony toolkit."
2HOMEPAGE = "http://www.asterisk.org/"
3LICENSE = "GPLv2"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=3aa955c628d43053f8ba9569d173105a"
5
6DEPENDS += "jansson sqlite3 libedit alsa-lib util-linux"
7
8SRC_URI = "\
9 http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${PV}.tar.gz \
10 file://0001-Use-pkgconfig-to-find-sdl.patch \
11 file://0002-Use-pkgconfig-to-find-libxml2.patch \
12 file://asterisk.init.d \
13"
14
15SRC_URI[md5sum] = "2fb7d247aacdbb9736c82b133053dfdf"
16SRC_URI[sha256sum] = "e8b8d071f783edea82de510194dd272070ffbb7cdb2f5f6b020be5d15b67e8b9"
17
18S = "${WORKDIR}/asterisk-${PV}"
19
Holger Hans Peter Freyther30f21182017-08-03 18:29:21 +080020inherit autotools-brokensep pkgconfig useradd update-rc.d
Fabio Berton14648002015-09-30 21:29:34 -030021
22USERADD_PACKAGES = "${PN}"
23USERADD_PARAM_${PN} = "--system -g asterisk --shell /bin/false asterisk"
24GROUPADD_PARAM_${PN} = "--system asterisk"
25
26PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)}"
27# Optional features
28PACKAGECONFIG[dev-mode] = "--enable-dev-mode,--disable-dev-mode"
29PACKAGECONFIG[coverage] = "--enable-coverage,--disable-coverage"
30PACKAGECONFIG[xmldoc] = "--enable-xmldoc,--disable-xmldoc"
31PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile"
32PACKAGECONFIG[internal-poll] = "--enable-internal-poll,--disable-internal-poll"
33PACKAGECONFIG[asteriskssl] = "--enable-asteriskssl,--disable-asteriskssl,openssl"
34PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath"
35# Optional packages
36PACKAGECONFIG[bfd] = "--with-bfd,--without-bfd"
37PACKAGECONFIG[bluetooth] = "--with-bluetooth,--without-bluetooth,bluez5"
38PACKAGECONFIG[backtrace] = "--with-execinfo,--without-execinfo"
39PACKAGECONFIG[cap] = "--with-cap,--without-cap,libcap"
40PACKAGECONFIG[corosync] = "--with-cpg,--without-cpg,corosync"
41PACKAGECONFIG[curses] = "--with-curses,--without-curses,ncurses"
42PACKAGECONFIG[crypt] = "--with-crypt,--without-crypt"
43PACKAGECONFIG[crypto] = "--with-crypto,--without-crypto"
44PACKAGECONFIG[dahdi] = "--with-dahdi,--without-dahdi,dahdi-tools"
45# To enable FFMPEG add LICENSE_FLAGS_WHITELIST = "commercial" to your local.conf
46PACKAGECONFIG[ffmpeg] = "--with-avcodec,--without-avcodec,libav"
47PACKAGECONFIG[gsm] = "--with-gsm,--without-gsm,libgsm"
48PACKAGECONFIG[ilbc] = "--with-ilbc,--without-ilbc"
49PACKAGECONFIG[gtk2] = "--with-gtk2,--without-gtk2,gtk+"
50PACKAGECONFIG[gmime] = "--with-gmime,--without-gmime"
51PACKAGECONFIG[openh323] = "--with-h323,--without-h323"
52PACKAGECONFIG[hoard] = "--with-hoard,--without-hoard"
53PACKAGECONFIG[ical] = "--with-ical,--without-ical"
54PACKAGECONFIG[iconv] = "--with-iconv,--without-iconv,libiconv"
55PACKAGECONFIG[iksemel] = "--with-iksemel,--without-iksemel,iksemel"
56PACKAGECONFIG[imap_tk] = "--with-imap,--without-imap,uw-imap"
57PACKAGECONFIG[inotify] = "--with-inotify,--without-inotify"
58PACKAGECONFIG[iodbc] = "--with-iodbc,--without-iodbc"
59PACKAGECONFIG[isdnnet] = "--with-isdnnet,--without-isdnnet"
60# Jack depends on kqeueu
61PACKAGECONFIG[jack] = "--with-jack,--without-jack,jack"
62PACKAGECONFIG[uriparser] = "--with-uriparser,--without-uriparser"
63PACKAGECONFIG[kqueue] = "--with-kqueue,--without-kqueue"
64PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
65PACKAGECONFIG[libcurl] = "--with-libcurl,--without-libcurl,curl"
66PACKAGECONFIG[libxml2] = "--with-libxml2,--without-libxml2,libxml2"
67PACKAGECONFIG[libxslt] = "--with-libxslt,--without-libxslt,libxslt"
68PACKAGECONFIG[ltdl] = "--with-ltdl,--without-ltdl,libtool"
69PACKAGECONFIG[lua] = "--with-lua,--without-lua,lua"
70PACKAGECONFIG[misdn] = "--with-misdn,--without-misdn,misdn-utils"
71PACKAGECONFIG[mysqlclient] = "--with-mysqlclient,--without-mysqlclient,mariadb"
72PACKAGECONFIG[nbs] = "--with-nbs,--without-nbs"
73PACKAGECONFIG[ncurses] = "--with-curses,--without-curses,ncurses"
74PACKAGECONFIG[neon] = "--with-neon,--without-neon,neon"
75PACKAGECONFIG[netsnmp] = "--with-netsnmp,--without-netsnmp,net-snmp"
76PACKAGECONFIG[newt] = "--with-newt,--without-newt,libnewt"
77PACKAGECONFIG[ogg] = "--with-ogg,--without-ogg,libogg"
78PACKAGECONFIG[openr2] = "--with-openr2,--without-openr2"
79PACKAGECONFIG[opus] = "--with-opus,--without-opus,libopus"
80PACKAGECONFIG[osptk] = "--with-osptk,--without-osptk"
81PACKAGECONFIG[oss] = "--with-oss,--without-oss,alsa-oss"
82PACKAGECONFIG[pgsql] = "--with-postgres,--without-postgres,postgresql"
83PACKAGECONFIG[pjproject] = "--with-pjproject,--without-pjproject,pjproject"
84PACKAGECONFIG[popt] = "--with-popt,--without-popt,popt"
85PACKAGECONFIG[portaudio] = "--with-portaudio,--without-portaudio,portaudio-v19"
86PACKAGECONFIG[pri] = "--with-pri,--without-pri,misdn-utils"
87PACKAGECONFIG[pwlib] = "--with-pwlib,--without-pwlib,pwlib"
88PACKAGECONFIG[radius] = "--with-radius,--without-radius,radiusclient-ng"
89PACKAGECONFIG[resample] = "--with-resample,--without-resample,ncurses"
90# Need to enable sdl_images to use sdl
91PACKAGECONFIG[sdl] = "--with-sdl,--without-sdl,libsdl"
92PACKAGECONFIG[sdl_image] = "--with-SDL_image,--without-SDL_image,libsdl-image"
93PACKAGECONFIG[sounds-cache] = "--with-sounds-cache,--without-sounds-cache"
94PACKAGECONFIG[spandsp] = "--with-spandsp,--without-spandsp"
95PACKAGECONFIG[ss7] = "--with-ss7,--without-ss7"
96PACKAGECONFIG[speex] = "--with-speex,--without-speex,speex"
97PACKAGECONFIG[speexdsp] = "--with-speexdsp,--without-speexdsp,speexdsp"
98PACKAGECONFIG[srtp] = "--with-srtp,--without-srtp"
99PACKAGECONFIG[openssl] = "--with-ssl,--without-ssl,openssl"
100PACKAGECONFIG[suppserv] = "--with-suppserv,--without-suppserv,misdn-utils"
101PACKAGECONFIG[freetds] = "--with-tds,--without-tds"
102PACKAGECONFIG[termcap] = "--with-termcap,--without-termcap,libcap"
103PACKAGECONFIG[timerfd] = "--with-timerfd,--without-timerfd"
104PACKAGECONFIG[tinfo] = "--with-tinfo,--without-tinfo,ncurses"
105PACKAGECONFIG[tonezone] = "--with-tonezone,--without-tonezone"
106PACKAGECONFIG[unixodbc] = "--with-unixodbc,--without-unixodbc,libodbc"
107PACKAGECONFIG[vorbis] = "--with-vorbis,--without-vorbis,libvorbis"
108PACKAGECONFIG[vpb] = "--with-vpb,--without-vpb"
109PACKAGECONFIG[x11] = "--with-x11,--without-x11,libx11"
110PACKAGECONFIG[zlib] = "--with-z,--without-z,zlib"
111
112EXTRA_OECONF += " \
113 --with-libedit=${STAGING_INCDIR} \
114"
115
116INITSCRIPT_NAME = "asterisk"
117INITSCRIPT_PARAMS = "defaults"
118
119do_configure_append() {
120 echo "Regenerate the configure scripts"
121 for d in ${S}/menuselect; do
122 echo " - $d"
123 (cd $d; autoreconf -I ${S}/autoconf)
124 done
125
126 echo "Starting the build of menuselect"
127 cd ${B}/menuselect
128 CC="${HOST_CC}" \
129 CXX="${HOST_CXX}" \
130 LD="" \
131 AR="" \
132 RANLIB="" \
133 CFLAGS="${HOST_CFLAGS}" \
134 LDFLAGS="${HOST_LDFLAGS}" \
135 ./configure
136}
137
138do_install_append() {
139 oe_runmake DESTDIR=${D} samples
140 install -Dm 0755 ${WORKDIR}/asterisk.init.d ${D}${sysconfdir}/init.d/asterisk
141 # Set file permissions and ownerships
142 chown -R root:asterisk ${D}${sysconfdir}/asterisk
143 chmod -R u=rwX,g=rwX,o= ${D}${sysconfdir}/asterisk
144 for x in spool run lib log; do
145 chown -R asterisk:asterisk ${D}${localstatedir}/${x}/asterisk
146 chmod -R u=rwX,g=rwX,o= ${D}${localstatedir}/${x}/asterisk
147 done
148}
149
150FILES_${PN} += "\
151 /run/asterisk \
152 ${datadir}/dahdi/* \
153 ${libdir}/hotplug/firmware \
154"
155FILES_${PN}-dbg += "${libdir}/*/*/.debug"