Makefile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. #
  2. # Copyright (C) 2011-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=libevent2
  9. PKG_VERSION:=2.1.8
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=libevent-$(PKG_VERSION)-stable.tar.gz
  12. PKG_SOURCE_URL:=https://github.com/libevent/libevent/releases/download/release-$(PKG_VERSION)-stable
  13. PKG_HASH:=965cc5a8bb46ce4199a47e9b2c9e1cae3b137e8356ffdad6d94d3b9069b71dc2
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/libevent-$(PKG_VERSION)-stable
  15. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  16. PKG_LICENSE:=BSD-3-Clause
  17. PKG_CPE_ID:=cpe:/a:libevent_project:libevent
  18. PKG_FIXUP:=autoreconf
  19. PKG_INSTALL:=1
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/libevent2/Default
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. TITLE:=Event notification
  26. URL:=http://libevent.org
  27. endef
  28. define Package/libevent2/Default/description
  29. The libevent API provides a mechanism to execute a callback function
  30. when a specific event occurs on a file descriptor or after a timeout
  31. has been reached. Furthermore, libevent also support callbacks due
  32. to signals or regular timeouts.
  33. libevent is meant to replace the event loop found in event driven
  34. network servers. An application just needs to call event_dispatch()
  35. and then add or remove events dynamically without having to change
  36. the event loop.
  37. endef
  38. define Package/libevent2
  39. $(call Package/libevent2/Default)
  40. TITLE+= library (version 2.1)
  41. endef
  42. define Package/libevent2/description
  43. $(call Package/libevent2/Default/description)
  44. This package contains the libevent shared library historically
  45. containing both the core & extra libraries.
  46. endef
  47. define Package/libevent2-core
  48. $(call Package/libevent2/Default)
  49. TITLE+= core library (version 2.1)
  50. endef
  51. define Package/libevent2-core/description
  52. $(call Package/libevent2/Default/description)
  53. This package contains the libevent core shared library for the event,
  54. buffer & utility functions.
  55. endef
  56. define Package/libevent2-extra
  57. $(call Package/libevent2/Default)
  58. TITLE+= extra library (version 2.1)
  59. endef
  60. define Package/libevent2-extra/description
  61. $(call Package/libevent2/Default/description)
  62. This package contains the libevent extra shared library for specific
  63. protocols including HTTP, DNS & RPC.
  64. endef
  65. define Package/libevent2-openssl
  66. $(call Package/libevent2/Default)
  67. TITLE+= OpenSSL library (version 2.1)
  68. DEPENDS+=+libopenssl
  69. endef
  70. define Package/libevent2-openssl/description
  71. $(call Package/libevent2/Default/description)
  72. This package contains the libevent OpenSSL shared library for encrypted
  73. bufferevents.
  74. endef
  75. define Package/libevent2-pthreads
  76. $(call Package/libevent2/Default)
  77. TITLE+= Pthreads library (version 2.1)
  78. DEPENDS+=+libpthread
  79. endef
  80. define Package/libevent2-pthreads/description
  81. $(call Package/libevent2/Default/description)
  82. This package contains the libevent Pthreads shared library for
  83. threading & locking.
  84. endef
  85. TARGET_CFLAGS += $(FPIC)
  86. CONFIGURE_ARGS += \
  87. --enable-shared \
  88. --enable-static \
  89. --disable-debug-mode
  90. MAKE_FLAGS += \
  91. CFLAGS="$(TARGET_CFLAGS)"
  92. define Build/InstallDev
  93. $(INSTALL_DIR) $(1)/usr/include
  94. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  95. $(INSTALL_DIR) $(1)/usr/lib
  96. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent*.{la,a,so} $(1)/usr/lib/
  97. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent*-2.1.so* $(1)/usr/lib/
  98. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  99. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libevent*.pc $(1)/usr/lib/pkgconfig/
  100. endef
  101. define Package/libevent2/install
  102. $(INSTALL_DIR) $(1)/usr/lib
  103. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent-2.1.so.* $(1)/usr/lib/
  104. endef
  105. define Package/libevent2-core/install
  106. $(INSTALL_DIR) $(1)/usr/lib
  107. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_core-2.1.so.* $(1)/usr/lib/
  108. endef
  109. define Package/libevent2-extra/install
  110. $(INSTALL_DIR) $(1)/usr/lib
  111. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_extra-2.1.so.* $(1)/usr/lib/
  112. endef
  113. define Package/libevent2-openssl/install
  114. $(INSTALL_DIR) $(1)/usr/lib
  115. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_openssl-2.1.so.* $(1)/usr/lib/
  116. endef
  117. define Package/libevent2-pthreads/install
  118. $(INSTALL_DIR) $(1)/usr/lib
  119. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_pthreads-2.1.so.* $(1)/usr/lib/
  120. endef
  121. $(eval $(call BuildPackage,libevent2))
  122. $(eval $(call BuildPackage,libevent2-core))
  123. $(eval $(call BuildPackage,libevent2-extra))
  124. $(eval $(call BuildPackage,libevent2-openssl))
  125. $(eval $(call BuildPackage,libevent2-pthreads))