Makefile 11 KB

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