Makefile 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(TOPDIR)/rules.mk
  4. PKG_NAME:= asterisk
  5. PKG_VERSION:= 1.6.2.10
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 50412a90942ae7306fb8dcc31a05c2ce
  8. PKG_DESCR:= Open Source PBX
  9. PKG_SECTION:= phone
  10. PKG_MULTI:= 1
  11. PKG_NOPARALLEL:= 1
  12. PKG_DEPENDS:= libncurses libpthread libopenssl libcurl
  13. PKG_BUILDDEP+= ncurses openssl zlib curl popt
  14. ifneq ($(ADK_PACKAGE_ASTERISK_CODEC_SPEEX),)
  15. PKG_BUILDDEP+= speex
  16. endif
  17. ifneq ($(ADK_PACKAGE_ASTERISK_PGSQL),)
  18. PKG_BUILDDEP+= postgresql
  19. endif
  20. PKG_URL:= http://www.asterisk.org/
  21. PKG_SITES:= http://downloads.asterisk.org/pub/telephony/asterisk/releases/
  22. PKG_TARGET_DEPENDS:= !foxboard
  23. PKG_DESCR_CHAN_MGCP:= Media Gateway Control Protocol implementation
  24. PKG_DESCR_CHAN_SKINNY:= Skinny Client Control Protocol implementation
  25. PKG_DESCR_CHAN_IAX2:= Support for the Inter Asterisk Protocol
  26. PKG_DESCR_CODEC_SPEEX:= Speex/PCM16 Codec Translator
  27. PKG_DESCR_SOUNDS:= Various soundfiles in GSM format
  28. PKG_DEPENDS_SOUNDS:= ${PKG_DEPENDS} asterisk-codec-gsm
  29. include $(TOPDIR)/mk/package.mk
  30. $(eval $(call PKG_template,ASTERISK,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  31. $(eval $(call PKG_template,ASTERISK_PGSQL,asterisk-pgsql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  32. $(eval $(call PKG_template,ASTERISK_VOICEMAIL,asterisk-voicemail,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  33. $(eval $(call PKG_template,ASTERISK_SOUNDS,asterisk-sounds,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS_SOUNDS},${PKG_DESCR_SOUNDS},${PKG_SECTION}))
  34. $(eval $(call PKG_template,ASTERISK_CHAN_MGCP,asterisk-chan-mgcp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS_MAIN},${PKG_DESCR_CHAN_MGCP},${PKG_SECTION}))
  35. $(eval $(call PKG_template,ASTERISK_CHAN_SKINNY,asterisk-chan-skinny,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS_MAIN},${PKG_DESCR_CHAN_SKINNY},${PKG_SECTION}))
  36. $(eval $(call PKG_template,ASTERISK_CHAN_IAX2,asterisk-chan-iax2,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS_MAIN},${PKG_DESCR_CHAN_IAX2},${PKG_SECTION}))
  37. $(eval $(call PKG_template,ASTERISK_CODEC_SPEEX,asterisk-codec-speex,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS_MAIN},${PKG_DESCR_CODEC_SPEEX},${PKG_SECTION}))
  38. $(eval $(call PKG_template,ASTERISK_CODEC_GSM,asterisk-codec-gsm,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  39. $(eval $(call PKG_template,ASTERISK_PBX_DUNDI,asterisk-pbx-dundi,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  40. $(eval $(call PKG_template,ASTERISK_RES_AGI,asterisk-res-agi,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  41. SUB_INSTALLS-y:=
  42. SUB_INSTALLS-m:=
  43. SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_PGSQL}+= asterisk-pgsql-install
  44. SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_VOICEMAIL}+= asterisk-voicemail-install
  45. SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_SOUNDS}+= asterisk-sounds-install
  46. SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_CHAN_MGCP}+= asterisk-chan-mgcp-install
  47. SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_CHAN_SKINNY}+= asterisk-chan-skinny-install
  48. SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_CHAN_IAX2}+= asterisk-chan-iax2-install
  49. SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_CODEC_SPEEX}+= asterisk-codec-speex-install
  50. SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_CODEC_GSM}+= asterisk-codec-gsm-install
  51. SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_PBX_DUNDI}+= asterisk-pbx-dundi-install
  52. SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_RES_AGI}+= asterisk-res-agi-install
  53. CONFIGURE_ARGS= --with-z=${STAGING_DIR}/usr \
  54. --with-ncurses=${STAGING_DIR}/usr \
  55. --with-ssl=${STAGING_DIR}/usr \
  56. --disable-xmldoc \
  57. --without-tonezone \
  58. --without-asound \
  59. --without-curses \
  60. --without-gtk \
  61. --without-gtk2 \
  62. --without-h323 \
  63. --without-iksemel \
  64. --without-imap \
  65. --without-nbs \
  66. --without-netsnmp \
  67. --without-newt \
  68. --without-osptk \
  69. --without-oss \
  70. --without-popt \
  71. --without-pri \
  72. --without-pwlib \
  73. --without-tds \
  74. --without-termcap \
  75. --without-tinfo \
  76. --without-vpb \
  77. --without-misdn \
  78. --without-isdnnet \
  79. --without-suppserv
  80. ifneq (${ADK_PACKAGE_ASTERISK_CODEC_GSM},)
  81. CONFIGURE_ARGS+= --with-gsm=internal
  82. else
  83. CONFIGURE_ARGS+= --without-gsm
  84. endif
  85. ifneq (${ADK_PACKAGE_ASTERISK_CODEC_SPEEX},)
  86. CONFIGURE_ARGS+= --with-speex=${STAGING_DIR}/usr
  87. EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/speex
  88. endif
  89. ifneq (${ADK_PACKAGE_ASTERISK_FORMAT_VORBIS},)
  90. CONFIGURE_ARGS+= --with-ogg=${STAGING_DIR}/usr \
  91. --with-vorbis=${STAGING_DIR}/usr
  92. TLDFLAGS+= -logg
  93. endif
  94. ifneq (${ADK_PACKAGE_ASTERISK_CURL},)
  95. CONFIGURE_ARGS+= --with-curl=${STAGING_DIR}/usr
  96. else
  97. CONFIGURE_ARGS+= --without-curl
  98. endif
  99. ifneq (${ADK_PACKAGE_ASTERISK_PGSQL},)
  100. CONFIGURE_ARGS+= --with-postgres=${STAGING_DIR}/usr
  101. else
  102. CONFIGURE_ARGS+= --without-postgres
  103. endif
  104. INSTALL_STYLE:= manual
  105. TLDFLAGS+= -lm
  106. MAKE_ENV= ASTCFLAGS="${TCPPFLAGS} -DHAVE_STRTOQ" \
  107. ASTLDFLAGS="${TLDFLAGS}"
  108. MAKE_FLAGS+= DESTDIR="$(WRKINST)" \
  109. OPTIMIZE="${TARGET_OPTIMIZATION}" \
  110. STRIP="${TARGET_CROSS}strip" \
  111. NOISY_BUILD=1
  112. ALL_TARGET:= all install samples
  113. pre-configure:
  114. cd "$(WRKBUILD)/menuselect"; ./configure
  115. pre-build:
  116. $(MAKE) -C $(WRKBUILD)/menuselect
  117. post-build:
  118. cd ${WRKBUILD}/sounds ; \
  119. tar xzf asterisk-core-sounds-en-gsm-1.4.19.tar.gz ; \
  120. rm asterisk-core-sounds-en-gsm-1.4.19.tar.gz
  121. @echo
  122. @echo "---> have to install ${SUB_INSTALLS-m} ${SUB_INSTALLS-y} <---"
  123. @echo
  124. do-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
  125. $(CP) $(WRKINST)/* $(IDIR_ASTERISK)
  126. rm -rf $(IDIR_ASTERISK)/usr/sbin/astgenkey
  127. rm -rf $(IDIR_ASTERISK)/usr/bin
  128. rm -rf $(IDIR_ASTERISK)/usr/share
  129. rm -rf $(IDIR_ASTERISK)/usr/include
  130. rm -rf $(IDIR_ASTERISK)/var
  131. (cd $(IDIR_ASTERISK)/usr/lib/asterisk; \
  132. rm -rf agi-bin; \
  133. rm -rf images; \
  134. rm -rf keys/*; \
  135. rm -rf mohmp3/*.mp3; \
  136. rm -rf sounds/*; \
  137. cd modules; \
  138. rm -rf *adsi* *festival* *modem* *meetme* *oss* \
  139. *phone* *intercom* *mp3* *nbscat* *mysql* \
  140. *postgres* *pgsql* *voicemail* *speex* \
  141. *zapateller* *jpeg*; \
  142. rm -f chan_bluetooth.so ; \
  143. rm -f chan_h323.so ; \
  144. rm -f chan_iax2.so ; \
  145. rm -f chan_mgcp.so ; \
  146. rm -f chan_skinny.so ; \
  147. rm -f {codec,format}_ilbc.so ; \
  148. rm -f codec_gsm.so ; \
  149. rm -f codec_lpc10.so ; \
  150. rm -f pbx_dundi.so ; \
  151. rm -f res_agi.so ; \
  152. )
  153. (cd $(IDIR_ASTERISK)/etc/asterisk; \
  154. rm -f *iax* *odbc* *mysql* *postgres* *pgsql* \
  155. *voicemail* *adsi* *oss* *alsa* \
  156. *festival* *modem* *meetme* *phone* *tds* \
  157. *vofr* *rpt* *vpb* \
  158. *zapata*; \
  159. rm -f bluetooth.conf ; \
  160. rm -f mgcp.conf ; \
  161. rm -f gtalk.conf ; \
  162. rm -f skinny.conf ; \
  163. rm -f dundi.conf ; \
  164. $(SED) '#^astdatadir = /var/#/usr/#' asterisk.conf ; \
  165. )
  166. ${INSTALL_DATA} ./files/modules.conf $(IDIR_ASTERISK)/etc/asterisk/
  167. $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' \
  168. $(WRKINST)/etc/asterisk/musiconhold.conf
  169. asterisk-pgsql-install:
  170. ${INSTALL_DIR} $(IDIR_ASTERISK_PGSQL)/etc/asterisk
  171. ${INSTALL_DATA} $(WRKBUILD)/configs/cdr_pgsql.conf.sample \
  172. $(IDIR_ASTERISK_PGSQL)/etc/asterisk/cdr_pgsql.conf
  173. ${INSTALL_DIR} $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules
  174. ${INSTALL_BIN} $(WRKBUILD)/cdr/cdr_pgsql.so \
  175. $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
  176. asterisk-sounds-install:
  177. ${INSTALL_DIR} $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds
  178. $(CP) $(WRKBUILD)/sounds/* \
  179. $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/
  180. (cd $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds; \
  181. rm -f *.mp3 vm-*; \
  182. rm -f CHANGES* CREDITS* LICENSE* *.txt ; \
  183. rm -f *.tar.gz Makefile ; \
  184. )
  185. asterisk-voicemail-install:
  186. ${INSTALL_DIR} $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk
  187. ${INSTALL_DIR} $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules
  188. ${INSTALL_DATA} $(WRKBUILD)/configs/voicemail.conf.sample \
  189. $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk/voicemail.conf
  190. ${CP} $(WRKBUILD)/apps/*voicemail.so \
  191. $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules/
  192. ${INSTALL_BIN} $(WRKBUILD)/res/res_adsi.so \
  193. $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules/
  194. ${INSTALL_DIR} $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/sounds
  195. $(CP) $(WRKBUILD)/sounds/vm-*.gsm \
  196. $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/sounds/
  197. asterisk-chan-mgcp-install:
  198. ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_MGCP)/etc/asterisk
  199. ${INSTALL_DATA} $(WRKBUILD)/configs/mgcp.conf.sample \
  200. $(IDIR_ASTERISK_CHAN_MGCP)/etc/asterisk/mgcp.conf
  201. ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_MGCP)/usr/lib/asterisk/modules
  202. ${INSTALL_BIN} $(WRKBUILD)/channels/chan_mgcp.so \
  203. $(IDIR_ASTERISK_CHAN_MGCP)/usr/lib/asterisk/modules/
  204. asterisk-chan-skinny-install:
  205. ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_SKINNY)/etc/asterisk
  206. ${INSTALL_DATA} $(WRKBUILD)/configs/skinny.conf.sample \
  207. $(IDIR_ASTERISK_CHAN_SKINNY)/etc/asterisk/skinny.conf
  208. ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_SKINNY)/usr/lib/asterisk/modules
  209. ${INSTALL_BIN} $(WRKBUILD)/channels/chan_skinny.so \
  210. $(IDIR_ASTERISK_CHAN_SKINNY)/usr/lib/asterisk/modules/
  211. asterisk-chan-iax2-install:
  212. ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_IAX2)/etc/asterisk
  213. ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_IAX2)/usr/lib/asterisk/modules
  214. ${INSTALL_DATA} $(WRKBUILD)/configs/iax.conf.sample \
  215. $(IDIR_ASTERISK_CHAN_IAX2)/etc/asterisk/iax.conf
  216. ${INSTALL_DATA} $(WRKBUILD)/configs/iaxprov.conf.sample \
  217. $(IDIR_ASTERISK_CHAN_IAX2)/etc/asterisk/iaxprov.conf
  218. ${INSTALL_BIN} $(WRKBUILD)/channels/chan_iax2.so \
  219. $(IDIR_ASTERISK_CHAN_IAX2)/usr/lib/asterisk/modules/
  220. asterisk-codec-speex-install:
  221. ${INSTALL_DIR} $(IDIR_ASTERISK_CODEC_SPEEX)/usr/lib/asterisk/modules
  222. ${INSTALL_BIN} $(WRKBUILD)/codecs/codec_speex.so \
  223. $(IDIR_ASTERISK_CODEC_SPEEX)/usr/lib/asterisk/modules/
  224. asterisk-codec-gsm-install:
  225. ${INSTALL_DIR} $(IDIR_ASTERISK_CODEC_GSM)/usr/lib/asterisk/modules/
  226. ${INSTALL_BIN} $(WRKBUILD)/codecs/codec_gsm.so \
  227. $(IDIR_ASTERISK_CODEC_GSM)/usr/lib/asterisk/modules/
  228. asterisk-pbx-dundi-install:
  229. ${INSTALL_DIR} $(IDIR_ASTERISK_PBX_DUNDI)/etc/asterisk
  230. ${INSTALL_DATA} $(WRKBUILD)/configs/dundi.conf.sample \
  231. $(IDIR_ASTERISK_PBX_DUNDI)/etc/asterisk/dundi.conf
  232. ${INSTALL_DIR} $(IDIR_ASTERISK_PBX_DUNDI)/usr/lib/asterisk/modules
  233. ${INSTALL_BIN} $(WRKBUILD)/pbx/pbx_dundi.so \
  234. $(IDIR_ASTERISK_PBX_DUNDI)/usr/lib/asterisk/modules/
  235. asterisk-res-agi-install:
  236. ${INSTALL_DIR} $(IDIR_ASTERISK_RES_AGI)/usr/lib/asterisk/agi-bin
  237. ${INSTALL_DIR} $(IDIR_ASTERISK_RES_AGI)/usr/lib/asterisk/modules
  238. ${INSTALL_BIN} $(WRKBUILD)/res/res_agi.so \
  239. $(IDIR_ASTERISK_RES_AGI)/usr/lib/asterisk/modules/
  240. asterisk-meetme-install:
  241. ${INSTALL_DIR} ${IDIR_ASTERISK_MEETME}/etc/asterisk/
  242. ${INSTALL_DIR} ${IDIR_ASTERISK_MEETME}/usr/lib/asterisk/modules
  243. ${INSTALL_DATA} ${WRKBUILD}/configs/meetme.conf.sample \
  244. ${IDIR_ASTERISK_MEETME}/etc/asterisk/meetme.conf
  245. ${INSTALL_BIN} ${WRKBUILD}/apps/app_meetme.so \
  246. ${IDIR_ASTERISK_MEETME}/usr/lib/asterisk/modules
  247. include ${TOPDIR}/mk/pkg-bottom.mk