Makefile 11 KB

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