Makefile 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 $(ADK_TOPDIR)/rules.mk
  4. PKG_NAME:= opensips
  5. PKG_VERSION:= 1.11.1
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 34d30e9ce870988970dff5f8a9abd239
  8. PKG_DESCR:= high-performance, configurable, free sip server
  9. PKG_SECTION:= net/voip
  10. PKG_DEPENDS:= libopenssl
  11. PKG_BUILDDEP:= openssl
  12. PKG_URL:= http://opensips.org/
  13. PKG_SITES:= http://opensips.org/pub/opensips/$(PKG_VERSION)/src/
  14. PKG_SUBPKGS:= OPENSIPS OPENSIPS_MOD_ACCOUNTING OPENSIPS_MOD_AUTH
  15. PKG_SUBPKGS+= OPENSIPS_MOD_AUTH_DB OPENSIPS_MOD_AVPOPS OPENSIPS_MOD_DISPATCHER
  16. PKG_SUBPKGS+= OPENSIPS_MOD_DIVERSION OPENSIPS_MOD_FLATSTORE OPENSIPS_MOD_GFLAGS
  17. PKG_SUBPKGS+= OPENSIPS_MOD_GROUP OPENSIPS_MOD_MEDIAPROXY OPENSIPS_MOD_MSILO
  18. PKG_SUBPKGS+= OPENSIPS_MOD_NATHELPER OPENSIPS_MOD_OPTIONS OPENSIPS_MOD_PDT
  19. PKG_SUBPKGS+= OPENSIPS_MOD_PERMISSIONS OPENSIPS_MOD_PIKE OPENSIPS_MOD_SMS
  20. PKG_SUBPKGS+= OPENSIPS_MOD_UAC OPENSIPS_MOD_UAC_REDIRECT OPENSIPS_MOD_URI
  21. PKGSD_OPENSIPS_MOD_ACCOUNTING:= accounting support
  22. PKGSN_OPENSIPS_MOD_ACCOUNTING:= opensips
  23. PKGSD_OPENSIPS_MOD_AUTH:= authentication support
  24. PKGSN_OPENSIPS_MOD_AUTH:= opensips
  25. PKGSD_OPENSIPS_MOD_AUTH_DB:= authentication database support
  26. PKGSN_OPENSIPS_MOD_AUTH_DB:= opensips
  27. PKGSD_OPENSIPS_MOD_AVPOPS:= avpops support
  28. PKGSN_OPENSIPS_MOD_AVPOPS:= opensips
  29. PKGSD_OPENSIPS_MOD_DISPATCHER:= dispatcher support
  30. PKGSN_OPENSIPS_MOD_DISPATCHER:= opensips
  31. PKGSD_OPENSIPS_MOD_DIVERSION:= diversion support
  32. PKGSN_OPENSIPS_MOD_DIVERSION:= opensips
  33. PKGSD_OPENSIPS_MOD_FLATSTORE:= flatstore support
  34. PKGSN_OPENSIPS_MOD_FLATSTORE:= opensips
  35. PKGSD_OPENSIPS_MOD_GFLAGS:= gflags support
  36. PKGSN_OPENSIPS_MOD_GFLAGS:= opensips
  37. PKGSD_OPENSIPS_MOD_GROUP:= group support
  38. PKGSN_OPENSIPS_MOD_GROUP:= opensips
  39. PKGSD_OPENSIPS_MOD_MEDIAPROXY:= mediaproxy support
  40. PKGSN_OPENSIPS_MOD_MEDIAPROXY:= opensips
  41. PKGSD_OPENSIPS_MOD_MSILO:= msilo support
  42. PKGSN_OPENSIPS_MOD_MSILO:= opensips
  43. PKGSD_OPENSIPS_MOD_NATHELPER:= nathelper support
  44. PKGSN_OPENSIPS_MOD_NATHELPER:= opensips
  45. PKGSD_OPENSIPS_MOD_OPTIONS:= options support
  46. PKGSN_OPENSIPS_MOD_OPTIONS:= opensips
  47. PKGSD_OPENSIPS_MOD_PDT:= pdt support
  48. PKGSN_OPENSIPS_MOD_PDT:= opensips
  49. PKGSD_OPENSIPS_MOD_PERMISSIONS:= permissions support
  50. PKGSN_OPENSIPS_MOD_PERMISSIONS:= opensips
  51. PKGSD_OPENSIPS_MOD_PIKE:= pike support
  52. PKGSN_OPENSIPS_MOD_PIKE:= opensips
  53. PKGSD_OPENSIPS_MOD_SMS:= sms support
  54. PKGSN_OPENSIPS_MOD_SMS:= opensips
  55. PKGSD_OPENSIPS_MOD_UAC:= uac support
  56. PKGSN_OPENSIPS_MOD_UAC:= opensips
  57. PKGSD_OPENSIPS_MOD_UAC_REDIRECT:= uac redirect support
  58. PKGSN_OPENSIPS_MOD_UAC_REDIRECT:= opensips
  59. PKGSD_OPENSIPS_MOD_URI:= uri support
  60. PKGSN_OPENSIPS_MOD_URI:= opensips
  61. DISTFILES:= $(PKG_NAME)-$(PKG_VERSION)_src.tar.gz
  62. WRKDIST= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-tls
  63. include $(ADK_TOPDIR)/mk/package.mk
  64. define PKG_mod_template
  65. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  66. ${2}-install:
  67. [ -z "$(2)" ] || install -d -m 0755 $$(IDIR_$(1))/usr/lib/opensips/modules/
  68. $(CP) $(WRKBUILD)/modules/$(2)/$(2).so \
  69. $$(IDIR_$(1))/usr/lib/opensips/modules/
  70. endef
  71. $(eval $(call PKG_template,OPENSIPS,opensips,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  72. $(eval $(call PKG_template,OPENSIPS_MOD_ACCOUNTING,opensips-mod-acc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  73. $(eval $(call PKG_template,OPENSIPS_MOD_AUTH,opensips-mod-auth,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  74. $(eval $(call PKG_template,OPENSIPS_MOD_AUTH_DB,opensips-mod-auth-db,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  75. $(eval $(call PKG_template,OPENSIPS_MOD_AVPOPS,opensips-mod-avpops,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  76. $(eval $(call PKG_template,OPENSIPS_MOD_DISPATCHER,opensips-mod-dispatcher,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  77. $(eval $(call PKG_template,OPENSIPS_MOD_DIVERSION,opensips-mod-diversion,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  78. $(eval $(call PKG_template,OPENSIPS_MOD_FLATSTORE,opensips-mod-flatstore,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  79. $(eval $(call PKG_template,OPENSIPS_MOD_GFLAGS,opensips-mod-gflags,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  80. $(eval $(call PKG_template,OPENSIPS_MOD_GROUP,opensips-mod-group,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  81. $(eval $(call PKG_template,OPENSIPS_MOD_MEDIAPROXY,opensips-mod-mediaproxy,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  82. $(eval $(call PKG_template,OPENSIPS_MOD_MSILO,opensips-mod-msilo,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  83. $(eval $(call PKG_template,OPENSIPS_MOD_NATHELPER,opensips-mod-nathelper,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  84. $(eval $(call PKG_template,OPENSIPS_MOD_OPTIONS,opensips-mod-options,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  85. $(eval $(call PKG_template,OPENSIPS_MOD_PDT,opensips-mod-pdt,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  86. $(eval $(call PKG_template,OPENSIPS_MOD_PERMISSIONS,opensips-mod-permissions,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  87. $(eval $(call PKG_template,OPENSIPS_MOD_PIKE,opensips-mod-pike,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  88. $(eval $(call PKG_template,OPENSIPS_MOD_SMS,opensips-mod-sms,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  89. $(eval $(call PKG_template,OPENSIPS_MOD_UAC,opensips-mod-uac,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  90. $(eval $(call PKG_template,OPENSIPS_MOD_UAC_REDIRECT,opensips-mod-uac-redirect,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  91. $(eval $(call PKG_template,OPENSIPS_MOD_URI,opensips-mod-uri,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  92. $(eval $(call PKG_mod_template,OPENSIPS_MOD_ACCOUNTING,acc))
  93. $(eval $(call PKG_mod_template,OPENSIPS_MOD_AUTH,auth))
  94. $(eval $(call PKG_mod_template,OPENSIPS_MOD_AUTH_DB,auth_db))
  95. $(eval $(call PKG_mod_template,OPENSIPS_MOD_AVPOPS,avpops))
  96. $(eval $(call PKG_mod_template,OPENSIPS_MOD_DISPATCHER,dispatcher))
  97. $(eval $(call PKG_mod_template,OPENSIPS_MOD_DIVERSION,diversion))
  98. $(eval $(call PKG_mod_template,OPENSIPS_MOD_FLATSTORE,db_flatstore))
  99. $(eval $(call PKG_mod_template,OPENSIPS_MOD_GFLAGS,gflags))
  100. $(eval $(call PKG_mod_template,OPENSIPS_MOD_GROUP,group))
  101. $(eval $(call PKG_mod_template,OPENSIPS_MOD_MEDIAPROXY,mediaproxy))
  102. $(eval $(call PKG_mod_template,OPENSIPS_MOD_MSILO,msilo))
  103. $(eval $(call PKG_mod_template,OPENSIPS_MOD_NATHELPER,nathelper))
  104. $(eval $(call PKG_mod_template,OPENSIPS_MOD_OPTIONS,options))
  105. $(eval $(call PKG_mod_template,OPENSIPS_MOD_PDT,pdt))
  106. $(eval $(call PKG_mod_template,OPENSIPS_MOD_PERMISSIONS,permissions))
  107. $(eval $(call PKG_mod_template,OPENSIPS_MOD_PIKE,pike))
  108. $(eval $(call PKG_mod_template,OPENSIPS_MOD_SMS,sms))
  109. $(eval $(call PKG_mod_template,OPENSIPS_MOD_SPEEDIAL,speeddial))
  110. $(eval $(call PKG_mod_template,OPENSIPS_MOD_UAC,uac))
  111. $(eval $(call PKG_mod_template,OPENSIPS_MOD_UAC_REDIRECT,uac_redirect))
  112. $(eval $(call PKG_mod_template,OPENSIPS_MOD_URI,uri))
  113. # Select here the modules for the main package
  114. OPENSIPS_MODULES:= sl tm rr maxfwd usrloc registrar db_text textops exec mi_fifo signaling
  115. OPENSIPS_MODULE_FILES:= $(foreach module,$(OPENSIPS_MODULES),modules/$(module)/$(module).so)
  116. OPENSIPS_MODULES:= $(patsubst %,modules/%,$(OPENSIPS_MODULES))
  117. CONFIG_STYLE:= manual
  118. BUILD_STYLE:= manual
  119. INSTALL_STYLE:= manual
  120. do-build:
  121. $(MAKE) -C $(WRKBUILD) \
  122. prefix=/ \
  123. extra_defs="-DUSE_PTHREAD_MUTEX" \
  124. TLS=1 \
  125. NO_EPOLL=1 \
  126. CC="$(TARGET_CC)" \
  127. OS="linux" \
  128. ARCH="$(ADK_TARGET_ARCH)" \
  129. CFLAGS="$(TARGET_CFLAGS) -fPIC" \
  130. LOCALBASE="$(STAGING_TARGET_DIR)/usr" \
  131. SYSBASE="$(STAGING_TARGET_DIR)/usr" \
  132. all modules
  133. do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  134. ${INSTALL_DIR} $(IDIR_OPENSIPS)/etc/opensips
  135. ${INSTALL_DIR} $(IDIR_OPENSIPS)/usr/sbin
  136. ${INSTALL_DIR} $(IDIR_OPENSIPS)/usr/lib/opensips/modules
  137. $(CP) $(WRKBUILD)/$(PKG_NAME) $(IDIR_OPENSIPS)/usr/sbin/
  138. (cd $(WRKBUILD);\
  139. $(CP) $(OPENSIPS_MODULE_FILES) \
  140. $(IDIR_OPENSIPS)/usr/lib/opensips/modules/; \
  141. )
  142. $(CP) ./files/opensips.cfg $(IDIR_OPENSIPS)/etc/opensips/
  143. include ${ADK_TOPDIR}/mk/pkg-bottom.mk