Fabio Berton | 1464800 | 2015-09-30 21:29:34 -0300 | [diff] [blame^] | 1 | DESCRIPTION = "Asterisk is an Open Source PBX and telephony toolkit." |
| 2 | HOMEPAGE = "http://www.asterisk.org/" |
| 3 | LICENSE = "GPLv2" |
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3aa955c628d43053f8ba9569d173105a" |
| 5 | |
| 6 | DEPENDS += "jansson sqlite3 libedit alsa-lib util-linux" |
| 7 | |
| 8 | SRC_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 | |
| 15 | SRC_URI[md5sum] = "2fb7d247aacdbb9736c82b133053dfdf" |
| 16 | SRC_URI[sha256sum] = "e8b8d071f783edea82de510194dd272070ffbb7cdb2f5f6b020be5d15b67e8b9" |
| 17 | |
| 18 | S = "${WORKDIR}/asterisk-${PV}" |
| 19 | |
| 20 | inherit autotools-brokensep pkgconfig useradd update-rc.d |
| 21 | |
| 22 | USERADD_PACKAGES = "${PN}" |
| 23 | USERADD_PARAM_${PN} = "--system -g asterisk --shell /bin/false asterisk" |
| 24 | GROUPADD_PARAM_${PN} = "--system asterisk" |
| 25 | |
| 26 | PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)}" |
| 27 | # Optional features |
| 28 | PACKAGECONFIG[dev-mode] = "--enable-dev-mode,--disable-dev-mode" |
| 29 | PACKAGECONFIG[coverage] = "--enable-coverage,--disable-coverage" |
| 30 | PACKAGECONFIG[xmldoc] = "--enable-xmldoc,--disable-xmldoc" |
| 31 | PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile" |
| 32 | PACKAGECONFIG[internal-poll] = "--enable-internal-poll,--disable-internal-poll" |
| 33 | PACKAGECONFIG[asteriskssl] = "--enable-asteriskssl,--disable-asteriskssl,openssl" |
| 34 | PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath" |
| 35 | # Optional packages |
| 36 | PACKAGECONFIG[bfd] = "--with-bfd,--without-bfd" |
| 37 | PACKAGECONFIG[bluetooth] = "--with-bluetooth,--without-bluetooth,bluez5" |
| 38 | PACKAGECONFIG[backtrace] = "--with-execinfo,--without-execinfo" |
| 39 | PACKAGECONFIG[cap] = "--with-cap,--without-cap,libcap" |
| 40 | PACKAGECONFIG[corosync] = "--with-cpg,--without-cpg,corosync" |
| 41 | PACKAGECONFIG[curses] = "--with-curses,--without-curses,ncurses" |
| 42 | PACKAGECONFIG[crypt] = "--with-crypt,--without-crypt" |
| 43 | PACKAGECONFIG[crypto] = "--with-crypto,--without-crypto" |
| 44 | PACKAGECONFIG[dahdi] = "--with-dahdi,--without-dahdi,dahdi-tools" |
| 45 | # To enable FFMPEG add LICENSE_FLAGS_WHITELIST = "commercial" to your local.conf |
| 46 | PACKAGECONFIG[ffmpeg] = "--with-avcodec,--without-avcodec,libav" |
| 47 | PACKAGECONFIG[gsm] = "--with-gsm,--without-gsm,libgsm" |
| 48 | PACKAGECONFIG[ilbc] = "--with-ilbc,--without-ilbc" |
| 49 | PACKAGECONFIG[gtk2] = "--with-gtk2,--without-gtk2,gtk+" |
| 50 | PACKAGECONFIG[gmime] = "--with-gmime,--without-gmime" |
| 51 | PACKAGECONFIG[openh323] = "--with-h323,--without-h323" |
| 52 | PACKAGECONFIG[hoard] = "--with-hoard,--without-hoard" |
| 53 | PACKAGECONFIG[ical] = "--with-ical,--without-ical" |
| 54 | PACKAGECONFIG[iconv] = "--with-iconv,--without-iconv,libiconv" |
| 55 | PACKAGECONFIG[iksemel] = "--with-iksemel,--without-iksemel,iksemel" |
| 56 | PACKAGECONFIG[imap_tk] = "--with-imap,--without-imap,uw-imap" |
| 57 | PACKAGECONFIG[inotify] = "--with-inotify,--without-inotify" |
| 58 | PACKAGECONFIG[iodbc] = "--with-iodbc,--without-iodbc" |
| 59 | PACKAGECONFIG[isdnnet] = "--with-isdnnet,--without-isdnnet" |
| 60 | # Jack depends on kqeueu |
| 61 | PACKAGECONFIG[jack] = "--with-jack,--without-jack,jack" |
| 62 | PACKAGECONFIG[uriparser] = "--with-uriparser,--without-uriparser" |
| 63 | PACKAGECONFIG[kqueue] = "--with-kqueue,--without-kqueue" |
| 64 | PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap" |
| 65 | PACKAGECONFIG[libcurl] = "--with-libcurl,--without-libcurl,curl" |
| 66 | PACKAGECONFIG[libxml2] = "--with-libxml2,--without-libxml2,libxml2" |
| 67 | PACKAGECONFIG[libxslt] = "--with-libxslt,--without-libxslt,libxslt" |
| 68 | PACKAGECONFIG[ltdl] = "--with-ltdl,--without-ltdl,libtool" |
| 69 | PACKAGECONFIG[lua] = "--with-lua,--without-lua,lua" |
| 70 | PACKAGECONFIG[misdn] = "--with-misdn,--without-misdn,misdn-utils" |
| 71 | PACKAGECONFIG[mysqlclient] = "--with-mysqlclient,--without-mysqlclient,mariadb" |
| 72 | PACKAGECONFIG[nbs] = "--with-nbs,--without-nbs" |
| 73 | PACKAGECONFIG[ncurses] = "--with-curses,--without-curses,ncurses" |
| 74 | PACKAGECONFIG[neon] = "--with-neon,--without-neon,neon" |
| 75 | PACKAGECONFIG[netsnmp] = "--with-netsnmp,--without-netsnmp,net-snmp" |
| 76 | PACKAGECONFIG[newt] = "--with-newt,--without-newt,libnewt" |
| 77 | PACKAGECONFIG[ogg] = "--with-ogg,--without-ogg,libogg" |
| 78 | PACKAGECONFIG[openr2] = "--with-openr2,--without-openr2" |
| 79 | PACKAGECONFIG[opus] = "--with-opus,--without-opus,libopus" |
| 80 | PACKAGECONFIG[osptk] = "--with-osptk,--without-osptk" |
| 81 | PACKAGECONFIG[oss] = "--with-oss,--without-oss,alsa-oss" |
| 82 | PACKAGECONFIG[pgsql] = "--with-postgres,--without-postgres,postgresql" |
| 83 | PACKAGECONFIG[pjproject] = "--with-pjproject,--without-pjproject,pjproject" |
| 84 | PACKAGECONFIG[popt] = "--with-popt,--without-popt,popt" |
| 85 | PACKAGECONFIG[portaudio] = "--with-portaudio,--without-portaudio,portaudio-v19" |
| 86 | PACKAGECONFIG[pri] = "--with-pri,--without-pri,misdn-utils" |
| 87 | PACKAGECONFIG[pwlib] = "--with-pwlib,--without-pwlib,pwlib" |
| 88 | PACKAGECONFIG[radius] = "--with-radius,--without-radius,radiusclient-ng" |
| 89 | PACKAGECONFIG[resample] = "--with-resample,--without-resample,ncurses" |
| 90 | # Need to enable sdl_images to use sdl |
| 91 | PACKAGECONFIG[sdl] = "--with-sdl,--without-sdl,libsdl" |
| 92 | PACKAGECONFIG[sdl_image] = "--with-SDL_image,--without-SDL_image,libsdl-image" |
| 93 | PACKAGECONFIG[sounds-cache] = "--with-sounds-cache,--without-sounds-cache" |
| 94 | PACKAGECONFIG[spandsp] = "--with-spandsp,--without-spandsp" |
| 95 | PACKAGECONFIG[ss7] = "--with-ss7,--without-ss7" |
| 96 | PACKAGECONFIG[speex] = "--with-speex,--without-speex,speex" |
| 97 | PACKAGECONFIG[speexdsp] = "--with-speexdsp,--without-speexdsp,speexdsp" |
| 98 | PACKAGECONFIG[srtp] = "--with-srtp,--without-srtp" |
| 99 | PACKAGECONFIG[openssl] = "--with-ssl,--without-ssl,openssl" |
| 100 | PACKAGECONFIG[suppserv] = "--with-suppserv,--without-suppserv,misdn-utils" |
| 101 | PACKAGECONFIG[freetds] = "--with-tds,--without-tds" |
| 102 | PACKAGECONFIG[termcap] = "--with-termcap,--without-termcap,libcap" |
| 103 | PACKAGECONFIG[timerfd] = "--with-timerfd,--without-timerfd" |
| 104 | PACKAGECONFIG[tinfo] = "--with-tinfo,--without-tinfo,ncurses" |
| 105 | PACKAGECONFIG[tonezone] = "--with-tonezone,--without-tonezone" |
| 106 | PACKAGECONFIG[unixodbc] = "--with-unixodbc,--without-unixodbc,libodbc" |
| 107 | PACKAGECONFIG[vorbis] = "--with-vorbis,--without-vorbis,libvorbis" |
| 108 | PACKAGECONFIG[vpb] = "--with-vpb,--without-vpb" |
| 109 | PACKAGECONFIG[x11] = "--with-x11,--without-x11,libx11" |
| 110 | PACKAGECONFIG[zlib] = "--with-z,--without-z,zlib" |
| 111 | |
| 112 | EXTRA_OECONF += " \ |
| 113 | --with-libedit=${STAGING_INCDIR} \ |
| 114 | " |
| 115 | |
| 116 | INITSCRIPT_NAME = "asterisk" |
| 117 | INITSCRIPT_PARAMS = "defaults" |
| 118 | |
| 119 | do_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 | |
| 138 | do_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 | |
| 150 | FILES_${PN} += "\ |
| 151 | /run/asterisk \ |
| 152 | ${datadir}/dahdi/* \ |
| 153 | ${libdir}/hotplug/firmware \ |
| 154 | " |
| 155 | FILES_${PN}-dbg += "${libdir}/*/*/.debug" |