|
| 1 | +DESCRIPTION = "Asterisk is an Open Source PBX and telephony toolkit." |
| 2 | +LICENSE = "GPLv2" |
| 3 | + |
| 4 | +S = "${WORKDIR}/git" |
| 5 | + |
| 6 | +DEPENDS += "util-linux libxml2-native ncurses-native" |
| 7 | + |
| 8 | +inherit autotools-brokensep pkgconfig useradd systemd |
| 9 | + |
| 10 | +EXTRA_AUTORECONF += "\ |
| 11 | + -I ${S}/third-party/jansson \ |
| 12 | + -I ${S}/third-party/pjproject \ |
| 13 | +" |
| 14 | + |
| 15 | +PACKAGECONFIG ?= "\ |
| 16 | + ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \ |
| 17 | + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ |
| 18 | + ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \ |
| 19 | + libxml2 \ |
| 20 | + jansson \ |
| 21 | + sqlite3 \ |
| 22 | + libedit \ |
| 23 | + pjproject \ |
| 24 | +\ |
| 25 | + timerfd \ |
| 26 | + zlib \ |
| 27 | + ncurses \ |
| 28 | + asteriskssl openssl crypto \ |
| 29 | + gsm \ |
| 30 | +" |
| 31 | +# Optional features |
| 32 | +PACKAGECONFIG[jansson] = "--with-jansson,--without-jansson,jansson" |
| 33 | +PACKAGECONFIG[sqlite3] = "--with-sqlite3,--without-sqlite3,sqlite3" |
| 34 | +PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit" |
| 35 | +PACKAGECONFIG[dev-mode] = "--enable-dev-mode,--disable-dev-mode" |
| 36 | +PACKAGECONFIG[coverage] = "--enable-coverage,--disable-coverage" |
| 37 | +PACKAGECONFIG[xmldoc] = "--enable-xmldoc,--disable-xmldoc" |
| 38 | +PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile" |
| 39 | +PACKAGECONFIG[internal-poll] = "--enable-internal-poll,--disable-internal-poll" |
| 40 | +PACKAGECONFIG[asteriskssl] = "--enable-asteriskssl,--disable-asteriskssl,openssl" |
| 41 | +PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath" |
| 42 | +# Optional packages |
| 43 | +PACKAGECONFIG[bfd] = "--with-bfd,--without-bfd" |
| 44 | +PACKAGECONFIG[bluetooth] = "--with-bluetooth,--without-bluetooth,bluez5" |
| 45 | +PACKAGECONFIG[backtrace] = "--with-execinfo,--without-execinfo" |
| 46 | +PACKAGECONFIG[cap] = "--with-cap,--without-cap,libcap" |
| 47 | +PACKAGECONFIG[corosync] = "--with-cpg,--without-cpg,corosync" |
| 48 | +PACKAGECONFIG[curses] = "--with-curses,--without-curses,ncurses" |
| 49 | +PACKAGECONFIG[crypt] = "--with-crypt,--without-crypt" |
| 50 | +PACKAGECONFIG[crypto] = "--with-crypto,--without-crypto" |
| 51 | +PACKAGECONFIG[dahdi] = "--with-dahdi,--without-dahdi,dahdi-tools" |
| 52 | +# To enable FFMPEG add LICENSE_FLAGS_WHITELIST = "commercial" to your local.conf |
| 53 | +PACKAGECONFIG[ffmpeg] = "--with-avcodec,--without-avcodec,libav" |
| 54 | +PACKAGECONFIG[gsm] = "--with-gsm,--without-gsm,libgsm" |
| 55 | +PACKAGECONFIG[ilbc] = "--with-ilbc,--without-ilbc" |
| 56 | +PACKAGECONFIG[gtk2] = "--with-gtk2,--without-gtk2,gtk+" |
| 57 | +PACKAGECONFIG[gmime] = "--with-gmime,--without-gmime" |
| 58 | +PACKAGECONFIG[openh323] = "--with-h323,--without-h323" |
| 59 | +PACKAGECONFIG[hoard] = "--with-hoard,--without-hoard" |
| 60 | +PACKAGECONFIG[ical] = "--with-ical,--without-ical" |
| 61 | +PACKAGECONFIG[iconv] = "--with-iconv,--without-iconv,libiconv" |
| 62 | +PACKAGECONFIG[iksemel] = "--with-iksemel,--without-iksemel,iksemel" |
| 63 | +PACKAGECONFIG[imap_tk] = "--with-imap,--without-imap,uw-imap" |
| 64 | +PACKAGECONFIG[inotify] = "--with-inotify,--without-inotify" |
| 65 | +PACKAGECONFIG[iodbc] = "--with-iodbc,--without-iodbc" |
| 66 | +PACKAGECONFIG[isdnnet] = "--with-isdnnet,--without-isdnnet" |
| 67 | +# Jack depends on kqeueu |
| 68 | +PACKAGECONFIG[jack] = "--with-jack,--without-jack,jack" |
| 69 | +PACKAGECONFIG[uriparser] = "--with-uriparser,--without-uriparser" |
| 70 | +PACKAGECONFIG[kqueue] = "--with-kqueue,--without-kqueue" |
| 71 | +PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap" |
| 72 | +PACKAGECONFIG[libcurl] = "--with-libcurl,--without-libcurl,curl" |
| 73 | +PACKAGECONFIG[libxml2] = "--with-libxml2,--without-libxml2,libxml2" |
| 74 | +PACKAGECONFIG[libxslt] = "--with-libxslt,--without-libxslt,libxslt" |
| 75 | +PACKAGECONFIG[ltdl] = "--with-ltdl,--without-ltdl,libtool" |
| 76 | +PACKAGECONFIG[lua] = "--with-lua,--without-lua,lua" |
| 77 | +PACKAGECONFIG[misdn] = "--with-misdn,--without-misdn,misdn-utils" |
| 78 | +PACKAGECONFIG[mysqlclient] = "--with-mysqlclient,--without-mysqlclient,mariadb" |
| 79 | +PACKAGECONFIG[nbs] = "--with-nbs,--without-nbs" |
| 80 | +PACKAGECONFIG[ncurses] = "--with-curses,--without-curses,ncurses" |
| 81 | +PACKAGECONFIG[neon] = "--with-neon,--without-neon,neon" |
| 82 | +PACKAGECONFIG[netsnmp] = "--with-netsnmp,--without-netsnmp,net-snmp" |
| 83 | +PACKAGECONFIG[newt] = "--with-newt,--without-newt,libnewt" |
| 84 | +PACKAGECONFIG[ogg] = "--with-ogg,--without-ogg,libogg" |
| 85 | +PACKAGECONFIG[openr2] = "--with-openr2,--without-openr2" |
| 86 | +PACKAGECONFIG[opus] = "--with-opus,--without-opus,libopus" |
| 87 | +PACKAGECONFIG[osptk] = "--with-osptk,--without-osptk" |
| 88 | +PACKAGECONFIG[oss] = "--with-oss,--without-oss,alsa-oss" |
| 89 | +PACKAGECONFIG[pgsql] = "--with-postgres,--without-postgres,postgresql" |
| 90 | +PACKAGECONFIG[pjproject] = "--with-pjproject --with-pjproject-bundled=no,--without-pjproject,pjproject" |
| 91 | +PACKAGECONFIG[popt] = "--with-popt,--without-popt,popt" |
| 92 | +PACKAGECONFIG[portaudio] = "--with-portaudio,--without-portaudio,portaudio-v19" |
| 93 | +PACKAGECONFIG[pri] = "--with-pri,--without-pri,misdn-utils" |
| 94 | +PACKAGECONFIG[pwlib] = "--with-pwlib,--without-pwlib,pwlib" |
| 95 | +PACKAGECONFIG[radius] = "--with-radius,--without-radius,radiusclient-ng" |
| 96 | +PACKAGECONFIG[resample] = "--with-resample,--without-resample,ncurses" |
| 97 | +# Need to enable sdl_images to use sdl |
| 98 | +PACKAGECONFIG[sdl] = "--with-sdl,--without-sdl,libsdl" |
| 99 | +PACKAGECONFIG[sdl_image] = "--with-SDL_image,--without-SDL_image,libsdl-image" |
| 100 | +PACKAGECONFIG[sounds-cache] = "--with-sounds-cache,--without-sounds-cache" |
| 101 | +PACKAGECONFIG[spandsp] = "--with-spandsp,--without-spandsp" |
| 102 | +PACKAGECONFIG[ss7] = "--with-ss7,--without-ss7" |
| 103 | +PACKAGECONFIG[speex] = "--with-speex,--without-speex,speex" |
| 104 | +PACKAGECONFIG[speexdsp] = "--with-speexdsp,--without-speexdsp,speexdsp" |
| 105 | +PACKAGECONFIG[srtp] = "--with-srtp,--without-srtp" |
| 106 | +PACKAGECONFIG[openssl] = "--with-ssl,--without-ssl,openssl" |
| 107 | +PACKAGECONFIG[suppserv] = "--with-suppserv,--without-suppserv,misdn-utils" |
| 108 | +PACKAGECONFIG[freetds] = "--with-tds,--without-tds" |
| 109 | +PACKAGECONFIG[termcap] = "--with-termcap,--without-termcap,libcap" |
| 110 | +PACKAGECONFIG[timerfd] = "--with-timerfd,--without-timerfd" |
| 111 | +PACKAGECONFIG[tinfo] = "--with-tinfo,--without-tinfo,ncurses" |
| 112 | +PACKAGECONFIG[tonezone] = "--with-tonezone,--without-tonezone" |
| 113 | +PACKAGECONFIG[unixodbc] = "--with-unixodbc,--without-unixodbc,libodbc" |
| 114 | +PACKAGECONFIG[vorbis] = "--with-vorbis,--without-vorbis,libvorbis" |
| 115 | +PACKAGECONFIG[vpb] = "--with-vpb,--without-vpb" |
| 116 | +PACKAGECONFIG[x11] = "--with-x11,--without-x11,libx11" |
| 117 | +PACKAGECONFIG[zlib] = "--with-z,--without-z,zlib" |
| 118 | +PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd" |
| 119 | + |
| 120 | +EXTRA_OECONF += "\ |
| 121 | + ac_cv_file_bridges_bridge_softmix_include_hrirs_h=no \ |
| 122 | + " |
| 123 | + |
| 124 | +MENUSELECT_OECONF = "\ |
| 125 | + CC='${BUILD_CC}' \ |
| 126 | + CXX='${BUILD_CXX}' \ |
| 127 | + CFLAGS='${BUILD_CFLAGS}' \ |
| 128 | + CXXFLAGS='${BUILD_CXXFLAGS}' \ |
| 129 | + LDFLAGS='${BUILD_LDFLAGS}' \ |
| 130 | +" |
| 131 | + |
| 132 | +do_configure_menuselect[dirs] = "${B}/menuselect" |
| 133 | +do_configure_menuselect() { |
| 134 | + ./configure ${MENUSELECT_OECONF} |
| 135 | +} |
| 136 | +addtask do_configure_menuselect after do_configure before do_compile |
| 137 | + |
| 138 | +do_install:append() { |
| 139 | + install -D -p -m 0644 ${WORKDIR}/asterisk.tmpfiles ${D}${libdir}/tmpfiles.d/asterisk.conf |
| 140 | + install -D -p -m 0644 ${WORKDIR}/asterisk.socket ${D}${systemd_system_unitdir}/asterisk.socket |
| 141 | + install -D -p -m 0644 ${WORKDIR}/asterisk.service ${D}${systemd_system_unitdir}/asterisk.service |
| 142 | + |
| 143 | + rm -rf ${D}/var/run |
| 144 | + rm -rf ${D}/var/log |
| 145 | + rm -rf ${D}/tmp |
| 146 | +} |
| 147 | + |
| 148 | +FILES:${PN} += "\ |
| 149 | + ${systemd_system_unitdir}/asterisk*.* \ |
| 150 | + ${libdir}/tmpfiles.d/asterisk.conf \ |
| 151 | +" |
| 152 | +RDEPENDS:${PN} += "bash" |
| 153 | + |
| 154 | +USERADD_PACKAGES = "${PN}" |
| 155 | +USERADD_PARAM:${PN} = "--system --home-dir /var/lib/asterisk -g asterisk --shell /bin/false asterisk" |
| 156 | +GROUPADD_PARAM:${PN} = "--system asterisk" |
| 157 | + |
| 158 | +SYSTEMD_SERVICE:${PN} = "${PN}.service" |
| 159 | + |
| 160 | +PACKAGES =+ "${PN}-sounds-en" |
| 161 | +FILES:${PN}-sounds-en = "${datadir}/asterisk/sounds/en" |
0 commit comments