Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #
  2. # Copyright (C) 2006 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # $Id$
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=openssl
  10. PKG_VERSION:=0.9.8d
  11. PKG_RELEASE:=2
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=http://www.openssl.org/source/ \
  14. ftp://ftp.funet.fi/pub/crypt/cryptography/libs/openssl/source/ \
  15. ftp://ftp.webmonster.de/pub/openssl/source/ \
  16. ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/
  17. PKG_MD5SUM:=8ed1853538e1d05a1f5ada61ebf8bffa
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/openssl/Default
  20. TITLE:=Open source SSL toolkit
  21. DESCRIPTION:=\
  22. The OpenSSL Project is a collaborative effort to develop a robust, \\\
  23. commercial-grade, full-featured, and Open Source toolkit implementing the \\\
  24. Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) \\\
  25. protocols as well as a full-strength general purpose cryptography library.
  26. URL:=http://www.openssl.org/
  27. endef
  28. define Package/libopenssl
  29. $(call Package/openssl/Default)
  30. SECTION:=libs
  31. CATEGORY:=Libraries
  32. DEPENDS:=+zlib
  33. TITLE+= (libraries)
  34. DESCRIPTION+=\\\
  35. \\\
  36. This package contains the OpenSSL shared libraries, needed by other \\\
  37. programs.
  38. endef
  39. define Package/openssl-util
  40. $(call Package/openssl/Default)
  41. SECTION:=utils
  42. CATEGORY:=Utilities
  43. DEPENDS:=+libopenssl
  44. TITLE+= (utility)
  45. DESCRIPTION+=\\\
  46. \\\
  47. This package contains the OpenSSL command-line utility.
  48. endef
  49. define Package/openssl-util/conffiles
  50. /etc/ssl/openssl.cnf
  51. endef
  52. OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc2 no-rc5 no-sha0 no-smime \
  53. no-rmd160 no-aes192 no-ripemd no-camellia no-ans1 no-krb5
  54. OPENSSL_OPTIONS:= shared no-ec no-err no-fips no-hw no-threads zlib-dynamic \
  55. no-engines no-sse2 no-perlasm
  56. define Build/Configure
  57. (cd $(PKG_BUILD_DIR); \
  58. ./Configure linux-openwrt \
  59. --prefix=/usr \
  60. --openssldir=/etc/ssl \
  61. -I$(STAGING_DIR)/usr/include \
  62. -L$(STAGING_DIR)/usr/lib -ldl \
  63. -DOPENSSL_SMALL_FOOTPRINT \
  64. $(OPENSSL_NO_CIPHERS) \
  65. $(OPENSSL_OPTIONS) \
  66. )
  67. endef
  68. define Build/Compile
  69. rm -rf $(PKG_INSTALL_DIR)
  70. mkdir -p $(PKG_INSTALL_DIR)
  71. $(MAKE) -C $(PKG_BUILD_DIR) \
  72. MAKEDEPPROG="$(TARGET_CROSS)gcc" \
  73. OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
  74. depend
  75. $(MAKE) -C $(PKG_BUILD_DIR) \
  76. CC="$(TARGET_CC)" \
  77. AR="$(TARGET_CROSS)ar r" \
  78. RANLIB="$(TARGET_CROSS)ranlib" \
  79. OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
  80. all build-shared
  81. # Work around openssl build bug to link libssl.so with libcrypto.so.
  82. -rm $(PKG_BUILD_DIR)/libssl.so.*.*.*
  83. $(MAKE) -C $(PKG_BUILD_DIR) \
  84. CC="$(TARGET_CC)" \
  85. OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
  86. do_linux-shared
  87. $(MAKE) -C $(PKG_BUILD_DIR) \
  88. INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
  89. install
  90. endef
  91. define Build/InstallDev
  92. mkdir -p $(STAGING_DIR)/usr/include
  93. $(CP) $(PKG_INSTALL_DIR)/usr/include/openssl $(STAGING_DIR)/usr/include/
  94. mkdir -p $(STAGING_DIR)/usr/lib/
  95. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.{a,so*} $(STAGING_DIR)/usr/lib/
  96. endef
  97. define Build/UninstallDev
  98. rm -rf $(STAGING_DIR)/usr/include/openssl \
  99. $(STAGING_DIR)/usr/lib/lib{crypto,ssl}.{a,so*}
  100. endef
  101. define Package/libopenssl/install
  102. $(INSTALL_DIR) $(1)/usr/lib
  103. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.so.* $(1)/usr/lib/
  104. chmod 0644 $(1)/usr/lib/*
  105. endef
  106. define Package/openssl-util/install
  107. $(INSTALL_DIR) $(1)/etc/ssl
  108. $(CP) $(PKG_INSTALL_DIR)/etc/ssl/openssl.cnf $(1)/etc/ssl/
  109. $(INSTALL_DIR) $(1)/etc/ssl/certs
  110. $(INSTALL_DIR) $(1)/etc/ssl/private
  111. chmod 0700 $(1)/etc/ssl/private
  112. $(INSTALL_DIR) $(1)/usr/bin
  113. $(CP) $(PKG_INSTALL_DIR)/usr/bin/openssl $(1)/usr/bin/
  114. endef
  115. $(eval $(call BuildPackage,libopenssl))
  116. $(eval $(call BuildPackage,openssl-util))