Makefile 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # $Id$
  2. #-
  3. # This file is part of the OpenADK project. OpenADK is copyrighted
  4. # material, please see the LICENCE file in the top-level directory.
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:= opensips
  7. PKG_VERSION:= 1.4.2
  8. PKG_RELEASE:= 1
  9. PKG_MD5SUM:= d7f0c867d797525635f157b65bb45129
  10. PKG_VARIANT:= tls
  11. MASTER_SITES:= http://opensips.org/pub/opensips/$(PKG_VERSION)/src/
  12. DISTFILES:= $(PKG_NAME)-$(PKG_VERSION)-$(PKG_VARIANT)_src.tar.gz
  13. WRKDIST= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_VARIANT)
  14. include $(TOPDIR)/mk/package.mk
  15. define PKG_mod_template
  16. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  17. ${2}-install:
  18. [ -z "$(2)" ] || install -d -m 0755 $$(IDIR_$(1))/usr/lib/opensips/modules/
  19. $(CP) $(WRKBUILD)/modules/$(2)/$(2).so \
  20. $$(IDIR_$(1))/usr/lib/opensips/modules/
  21. endef
  22. $(eval $(call PKG_template,OPENSIPS,opensips,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  23. $(eval $(call PKG_template,OPENSIPS_MOD_ACCOUNTING,opensips-mod-acc,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  24. $(eval $(call PKG_template,OPENSIPS_MOD_AUTH,opensips-mod-auth,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  25. $(eval $(call PKG_template,OPENSIPS_MOD_AUTH_DB,opensips-mod-auth-db,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  26. $(eval $(call PKG_template,OPENSIPS_MOD_AVPOPS,opensips-mod-avpops,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  27. $(eval $(call PKG_template,OPENSIPS_MOD_DISPATCHER,opensips-mod-dispatcher,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  28. $(eval $(call PKG_template,OPENSIPS_MOD_DIVERSION,opensips-mod-diversion,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  29. $(eval $(call PKG_template,OPENSIPS_MOD_FLATSTORE,opensips-mod-flatstore,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  30. $(eval $(call PKG_template,OPENSIPS_MOD_GFLAGS,opensips-mod-gflags,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  31. $(eval $(call PKG_template,OPENSIPS_MOD_GROUP,opensips-mod-group,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  32. $(eval $(call PKG_template,OPENSIPS_MOD_MEDIAPROXY,opensips-mod-mediaproxy,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  33. $(eval $(call PKG_template,OPENSIPS_MOD_MSILO,opensips-mod-msilo,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  34. $(eval $(call PKG_template,OPENSIPS_MOD_NATHELPER,opensips-mod-nathelper,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  35. $(eval $(call PKG_template,OPENSIPS_MOD_OPTIONS,opensips-mod-options,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  36. $(eval $(call PKG_template,OPENSIPS_MOD_PDT,opensips-mod-pdt,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  37. $(eval $(call PKG_template,OPENSIPS_MOD_PERMISSIONS,opensips-mod-permissions,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  38. $(eval $(call PKG_template,OPENSIPS_MOD_PIKE,opensips-mod-pike,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  39. $(eval $(call PKG_template,OPENSIPS_MOD_SMS,opensips-mod-sms,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  40. $(eval $(call PKG_template,OPENSIPS_MOD_UAC,opensips-mod-uac,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  41. $(eval $(call PKG_template,OPENSIPS_MOD_UAC_REDIRECT,opensips-mod-uac-redirect,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  42. $(eval $(call PKG_template,OPENSIPS_MOD_URI,opensips-mod-uri,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  43. $(eval $(call PKG_template,OPENSIPS_MOD_URI_DB,opensips-mod-uri-db,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  44. $(eval $(call PKG_template,OPENSIPS_MOD_XLOG,opensips-mod-xlog,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
  45. $(eval $(call PKG_mod_template,OPENSIPS_MOD_ACCOUNTING,acc))
  46. $(eval $(call PKG_mod_template,OPENSIPS_MOD_AUTH,auth))
  47. $(eval $(call PKG_mod_template,OPENSIPS_MOD_AUTH_DB,auth_db))
  48. $(eval $(call PKG_mod_template,OPENSIPS_MOD_AVPOPS,avpops))
  49. $(eval $(call PKG_mod_template,OPENSIPS_MOD_DISPATCHER,dispatcher))
  50. $(eval $(call PKG_mod_template,OPENSIPS_MOD_DIVERSION,diversion))
  51. $(eval $(call PKG_mod_template,OPENSIPS_MOD_FLATSTORE,db_flatstore))
  52. $(eval $(call PKG_mod_template,OPENSIPS_MOD_GFLAGS,gflags))
  53. $(eval $(call PKG_mod_template,OPENSIPS_MOD_GROUP,group))
  54. $(eval $(call PKG_mod_template,OPENSIPS_MOD_MEDIAPROXY,mediaproxy))
  55. $(eval $(call PKG_mod_template,OPENSIPS_MOD_MSILO,msilo))
  56. $(eval $(call PKG_mod_template,OPENSIPS_MOD_NATHELPER,nathelper))
  57. $(eval $(call PKG_mod_template,OPENSIPS_MOD_OPTIONS,options))
  58. $(eval $(call PKG_mod_template,OPENSIPS_MOD_PDT,pdt))
  59. $(eval $(call PKG_mod_template,OPENSIPS_MOD_PERMISSIONS,permissions))
  60. $(eval $(call PKG_mod_template,OPENSIPS_MOD_PIKE,pike))
  61. $(eval $(call PKG_mod_template,OPENSIPS_MOD_SMS,sms))
  62. $(eval $(call PKG_mod_template,OPENSIPS_MOD_SPEEDIAL,speeddial))
  63. $(eval $(call PKG_mod_template,OPENSIPS_MOD_UAC,uac))
  64. $(eval $(call PKG_mod_template,OPENSIPS_MOD_UAC_REDIRECT,uac_redirect))
  65. $(eval $(call PKG_mod_template,OPENSIPS_MOD_URI,uri))
  66. $(eval $(call PKG_mod_template,OPENSIPS_MOD_URI_DB,uri_db))
  67. $(eval $(call PKG_mod_template,OPENSIPS_MOD_XLOG,xlog))
  68. # Select here the modules for the ipk package
  69. OPENSIPS_MODULES:= sl tm rr maxfwd usrloc registrar db_text textops exec mi_fifo
  70. OPENSIPS_MODULE_FILES:= $(foreach module,$(OPENSIPS_MODULES),modules/$(module)/$(module).so)
  71. OPENSIPS_MODULES:= $(patsubst %,modules/%,$(OPENSIPS_MODULES))
  72. post-extract:
  73. @rm -f ${WRKDIST}/modules/dialog/dlg_handlers.c.rej
  74. do-build:
  75. $(MAKE) -C $(WRKBUILD) \
  76. prefix=/ \
  77. extra_defs="-DUSE_PTHREAD_MUTEX" \
  78. TLS=1 \
  79. NO_EPOLL=1 \
  80. CC="$(TARGET_CC)" \
  81. ARCH="$(ARCH)" \
  82. CFLAGS="$(TARGET_CFLAGS)" \
  83. LOCALBASE="$(STAGING_DIR)/usr" \
  84. all modules
  85. do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  86. ${INSTALL_DIR} $(IDIR_OPENSIPS)/etc/init.d
  87. ${INSTALL_DIR} $(IDIR_OPENSIPS)/etc/opensips
  88. ${INSTALL_DIR} $(IDIR_OPENSIPS)/usr/sbin
  89. ${INSTALL_DIR} $(IDIR_OPENSIPS)/usr/lib/opensips/modules
  90. $(CP) $(WRKBUILD)/$(PKG_NAME) $(IDIR_OPENSIPS)/usr/sbin/
  91. (cd $(WRKBUILD);\
  92. $(CP) $(OPENSIPS_MODULE_FILES) $(IDIR_OPENSIPS)/usr/lib/opensips/modules/; \
  93. )
  94. $(CP) ./files/opensips.cfg $(IDIR_OPENSIPS)/etc/opensips/
  95. ${INSTALL_DATA} ./files/opensips.init $(IDIR_OPENSIPS)/etc/init.d/opensips
  96. include ${TOPDIR}/mk/pkg-bottom.mk