1
0

Makefile 10 KB

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