1
0

Makefile 10 KB

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