Makefile 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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:= opensips
  5. PKG_VERSION:= 1.6.1
  6. PKG_RELEASE:= 1
  7. PKG_VARIANT:= tls
  8. PKG_MD5SUM:= e7e59910183ca8a213c76a7a80789ea1
  9. PKG_DESCR:= a high-performance, configurable, free SIP server
  10. PKG_SECTION:= phone
  11. PKG_DEPENDS:= libopenssl
  12. PKG_BUILDDEP:= openssl
  13. PKG_URL:= http://opensips.org/
  14. PKG_SITES:= http://opensips.org/pub/opensips/$(PKG_VERSION)/src/
  15. PKG_MULTI:= 1
  16. PKG_SUBPKGS:= OPENSIPS OPENSIPS_MOD_ACCOUNTING OPENSIPS_MOD_AUTH
  17. PKG_SUBPKGS+= OPENSIPS_MOD_AUTH_DB OPENSIPS_MOD_AVPOPS OPENSIPS_MOD_DISPATCHER
  18. PKG_SUBPKGS+= OPENSIPS_MOD_DIVERSION OPENSIPS_MOD_FLATSTORE OPENSIPS_MOD_GFLAGS
  19. PKG_SUBPKGS+= OPENSIPS_MOD_GROUP OPENSIPS_MOD_MEDIAPROXY OPENSIPS_MOD_MSILO
  20. PKG_SUBPKGS+= OPENSIPS_MOD_NATHELPER OPENSIPS_MOD_OPTIONS OPENSIPS_MOD_PDT
  21. PKG_SUBPKGS+= OPENSIPS_MOD_PERMISSIONS OPENSIPS_MOD_PIKE OPENSIPS_MOD_SMS
  22. PKG_SUBPKGS+= OPENSIPS_MOD_UAC OPENSIPS_MOD_UAC_REDIRECT OPENSIPS_MOD_URI
  23. PKG_SUBPKGS+= OPENSIPS_MOD_XLOG
  24. DISTFILES:= $(PKG_NAME)-$(PKG_VERSION)-$(PKG_VARIANT)_src.tar.gz
  25. WRKDIST= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_VARIANT)
  26. include $(TOPDIR)/mk/package.mk
  27. define PKG_mod_template
  28. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  29. ${2}-install:
  30. [ -z "$(2)" ] || install -d -m 0755 $$(IDIR_$(1))/usr/lib/opensips/modules/
  31. $(CP) $(WRKBUILD)/modules/$(2)/$(2).so \
  32. $$(IDIR_$(1))/usr/lib/opensips/modules/
  33. endef
  34. $(eval $(call PKG_template,OPENSIPS,opensips,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  35. $(eval $(call PKG_template,OPENSIPS_MOD_ACCOUNTING,opensips-mod-acc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  36. $(eval $(call PKG_template,OPENSIPS_MOD_AUTH,opensips-mod-auth,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  37. $(eval $(call PKG_template,OPENSIPS_MOD_AUTH_DB,opensips-mod-auth-db,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  38. $(eval $(call PKG_template,OPENSIPS_MOD_AVPOPS,opensips-mod-avpops,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  39. $(eval $(call PKG_template,OPENSIPS_MOD_DISPATCHER,opensips-mod-dispatcher,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  40. $(eval $(call PKG_template,OPENSIPS_MOD_DIVERSION,opensips-mod-diversion,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  41. $(eval $(call PKG_template,OPENSIPS_MOD_FLATSTORE,opensips-mod-flatstore,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  42. $(eval $(call PKG_template,OPENSIPS_MOD_GFLAGS,opensips-mod-gflags,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  43. $(eval $(call PKG_template,OPENSIPS_MOD_GROUP,opensips-mod-group,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  44. $(eval $(call PKG_template,OPENSIPS_MOD_MEDIAPROXY,opensips-mod-mediaproxy,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  45. $(eval $(call PKG_template,OPENSIPS_MOD_MSILO,opensips-mod-msilo,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  46. $(eval $(call PKG_template,OPENSIPS_MOD_NATHELPER,opensips-mod-nathelper,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  47. $(eval $(call PKG_template,OPENSIPS_MOD_OPTIONS,opensips-mod-options,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  48. $(eval $(call PKG_template,OPENSIPS_MOD_PDT,opensips-mod-pdt,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  49. $(eval $(call PKG_template,OPENSIPS_MOD_PERMISSIONS,opensips-mod-permissions,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  50. $(eval $(call PKG_template,OPENSIPS_MOD_PIKE,opensips-mod-pike,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  51. $(eval $(call PKG_template,OPENSIPS_MOD_SMS,opensips-mod-sms,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  52. $(eval $(call PKG_template,OPENSIPS_MOD_UAC,opensips-mod-uac,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  53. $(eval $(call PKG_template,OPENSIPS_MOD_UAC_REDIRECT,opensips-mod-uac-redirect,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  54. $(eval $(call PKG_template,OPENSIPS_MOD_URI,opensips-mod-uri,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  55. $(eval $(call PKG_template,OPENSIPS_MOD_XLOG,opensips-mod-xlog,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  56. $(eval $(call PKG_mod_template,OPENSIPS_MOD_ACCOUNTING,acc))
  57. $(eval $(call PKG_mod_template,OPENSIPS_MOD_AUTH,auth))
  58. $(eval $(call PKG_mod_template,OPENSIPS_MOD_AUTH_DB,auth_db))
  59. $(eval $(call PKG_mod_template,OPENSIPS_MOD_AVPOPS,avpops))
  60. $(eval $(call PKG_mod_template,OPENSIPS_MOD_DISPATCHER,dispatcher))
  61. $(eval $(call PKG_mod_template,OPENSIPS_MOD_DIVERSION,diversion))
  62. $(eval $(call PKG_mod_template,OPENSIPS_MOD_FLATSTORE,db_flatstore))
  63. $(eval $(call PKG_mod_template,OPENSIPS_MOD_GFLAGS,gflags))
  64. $(eval $(call PKG_mod_template,OPENSIPS_MOD_GROUP,group))
  65. $(eval $(call PKG_mod_template,OPENSIPS_MOD_MEDIAPROXY,mediaproxy))
  66. $(eval $(call PKG_mod_template,OPENSIPS_MOD_MSILO,msilo))
  67. $(eval $(call PKG_mod_template,OPENSIPS_MOD_NATHELPER,nathelper))
  68. $(eval $(call PKG_mod_template,OPENSIPS_MOD_OPTIONS,options))
  69. $(eval $(call PKG_mod_template,OPENSIPS_MOD_PDT,pdt))
  70. $(eval $(call PKG_mod_template,OPENSIPS_MOD_PERMISSIONS,permissions))
  71. $(eval $(call PKG_mod_template,OPENSIPS_MOD_PIKE,pike))
  72. $(eval $(call PKG_mod_template,OPENSIPS_MOD_SMS,sms))
  73. $(eval $(call PKG_mod_template,OPENSIPS_MOD_SPEEDIAL,speeddial))
  74. $(eval $(call PKG_mod_template,OPENSIPS_MOD_UAC,uac))
  75. $(eval $(call PKG_mod_template,OPENSIPS_MOD_UAC_REDIRECT,uac_redirect))
  76. $(eval $(call PKG_mod_template,OPENSIPS_MOD_URI,uri))
  77. $(eval $(call PKG_mod_template,OPENSIPS_MOD_XLOG,xlog))
  78. # Select here the modules for the main package
  79. OPENSIPS_MODULES:= sl tm rr maxfwd usrloc registrar db_text textops exec mi_fifo signaling
  80. OPENSIPS_MODULE_FILES:= $(foreach module,$(OPENSIPS_MODULES),modules/$(module)/$(module).so)
  81. OPENSIPS_MODULES:= $(patsubst %,modules/%,$(OPENSIPS_MODULES))
  82. CONFIG_STYLE:= manual
  83. BUILD_STYLE:= manual
  84. INSTALL_STYLE:= manual
  85. do-build:
  86. $(MAKE) -C $(WRKBUILD) \
  87. prefix=/ \
  88. extra_defs="-DUSE_PTHREAD_MUTEX" \
  89. TLS=1 \
  90. NO_EPOLL=1 \
  91. CC="$(TARGET_CC)" \
  92. OS="linux" \
  93. ARCH="$(ARCH)" \
  94. CFLAGS="$(TARGET_CFLAGS) -fPIC" \
  95. LOCALBASE="$(STAGING_TARGET_DIR)/usr" \
  96. SYSBASE="$(STAGING_TARGET_DIR)/usr" \
  97. all modules
  98. do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  99. ${INSTALL_DIR} $(IDIR_OPENSIPS)/etc/opensips
  100. ${INSTALL_DIR} $(IDIR_OPENSIPS)/usr/sbin
  101. ${INSTALL_DIR} $(IDIR_OPENSIPS)/usr/lib/opensips/modules
  102. $(CP) $(WRKBUILD)/$(PKG_NAME) $(IDIR_OPENSIPS)/usr/sbin/
  103. (cd $(WRKBUILD);\
  104. $(CP) $(OPENSIPS_MODULE_FILES) \
  105. $(IDIR_OPENSIPS)/usr/lib/opensips/modules/; \
  106. )
  107. $(CP) ./files/opensips.cfg $(IDIR_OPENSIPS)/etc/opensips/
  108. include ${TOPDIR}/mk/pkg-bottom.mk