2 # Copyright (C) 2006-2009 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=http
://www.openssl.org
/source
/ \
16 ftp
://ftp.funet.fi
/pub
/crypt
/cryptography
/libs
/openssl
/source
/ \
17 ftp
://ftp.webmonster.de
/pub
/openssl
/source
/ \
18 ftp
://ftp.sunet.se
/pub
/security
/tools
/net
/openssl
/source
/
19 PKG_MD5SUM
:=05a0ece1372392a2cf310ebb96333025
21 PKG_BUILD_DEPENDS
:=ocf-crypto-headers
23 include $(INCLUDE_DIR
)/package.mk
25 define Package
/openssl
/Default
26 TITLE
:=Open source SSL toolkit
27 URL
:=http
://www.openssl.org
/
30 define Package
/openssl
/Default
/description
31 The OpenSSL Project is a collaborative effort to develop a robust
,
32 commercial-grade
, full-featured
, and Open Source toolkit implementing the
33 Secure Sockets Layer
(SSL v2
/v3
) and Transport Layer Security
(TLS v1
)
34 protocols
as well
as a full-strength general purpose cryptography library.
37 define Package
/libopenssl
38 $(call Package
/openssl
/Default
)
46 define Package
/libopenssl
/description
47 $(call Package
/openssl
/Default
/description
)
48 This package contains the OpenSSL shared libraries
, needed by other
52 define Package
/openssl-util
53 $(call Package
/openssl
/Default
)
60 define Package
/openssl-util
/conffiles
64 define Package
/openssl-util
/description
65 $(call Package
/openssl
/Default
/description
)
66 This package contains the OpenSSL command-line utility.
70 OPENSSL_NO_CIPHERS
:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-smime \
71 no-rmd160 no-aes192 no-ripemd no-camellia no-ans1 no-krb5
72 ifeq ($(BOARD
),ixp4xx
)
73 OPENSSL_OPTIONS
:= shared no-ec no-err no-hw no-threads zlib-dynamic \
74 no-sse2
--with-cryptodev
76 OPENSSL_OPTIONS
:= shared no-ec no-err no-hw no-threads zlib-dynamic \
80 OPENSSL_MAKEFLAGS
:= AES_ASM_OBJ
="aes-armv4.o aes_cbc.o"
82 OPENSSL_OPTIONS
+= no-perlasm
85 define Build
/Configure
86 (cd
$(PKG_BUILD_DIR
); \
87 .
/Configure linux-openwrt \
89 --openssldir
=/etc
/ssl \
91 $(TARGET_LDFLAGS
) -ldl \
92 -DOPENSSL_SMALL_FOOTPRINT \
93 $(OPENSSL_NO_CIPHERS
) \
98 TARGET_CFLAGS
+= $(FPIC
)
101 # XXX: OpenSSL "make depend" will look for installed headers before its own,
102 # so remove installed stuff first
103 -$(SUBMAKE
) -j1 clean-staging
104 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
105 MAKEDEPPROG
="$(TARGET_CROSS)gcc" \
106 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
107 $(OPENSSL_MAKEFLAGS
) \
109 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
111 AR
="$(TARGET_CROSS)ar r" \
112 RANLIB
="$(TARGET_CROSS)ranlib" \
113 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
114 $(OPENSSL_MAKEFLAGS
) \
116 # Work around openssl build bug to link libssl.so with libcrypto.so.
117 -rm $(PKG_BUILD_DIR
)/libssl.so.
*.
*.
*
118 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
120 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
121 $(OPENSSL_MAKEFLAGS
) \
123 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
124 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
125 $(OPENSSL_MAKEFLAGS
) \
129 define Build
/InstallDev
130 mkdir
-p
$(1)/usr
/include
131 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/openssl
$(1)/usr
/include/
132 mkdir
-p
$(1)/usr
/lib
/
133 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.
{a
,so
*} $(1)/usr
/lib
/
134 mkdir
-p
$(1)/usr
/lib
/pkgconfig
135 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/{openssl
,libcrypto
,libssl
}.
pc $(1)/usr
/lib
/pkgconfig
/
136 $(SED
) 's#$(TARGET_LDFLAGS)##g' $(1)/usr
/lib
/pkgconfig
/{openssl
,libcrypto
,libssl
}.
pc
139 define Package
/libopenssl
/install
140 $(INSTALL_DIR
) $(1)/usr
/lib
141 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libcrypto.so.
* $(1)/usr
/lib
/
142 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libssl.so.
* $(1)/usr
/lib
/
145 define Package
/openssl-util
/install
146 $(INSTALL_DIR
) $(1)/etc
/ssl
147 $(CP
) $(PKG_INSTALL_DIR
)/etc
/ssl
/openssl.cnf
$(1)/etc
/ssl
/
148 $(INSTALL_DIR
) $(1)/etc
/ssl
/certs
149 $(INSTALL_DIR
) $(1)/etc
/ssl
/private
150 chmod
0700 $(1)/etc
/ssl
/private
151 $(INSTALL_DIR
) $(1)/usr
/bin
152 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/openssl
$(1)/usr
/bin
/
155 $(eval
$(call BuildPackage
,libopenssl
))
156 $(eval
$(call BuildPackage
,openssl-util
))