2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=http
://www.openssl.org
/source
/ \
17 ftp
://ftp.funet.fi
/pub
/crypt
/cryptography
/libs
/openssl
/source
/ \
18 ftp
://ftp.webmonster.de
/pub
/openssl
/source
/ \
19 ftp
://ftp.sunet.se
/pub
/security
/tools
/net
/openssl
/source
/
20 PKG_MD5SUM
:=8ed1853538e1d05a1f5ada61ebf8bffa
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/openssl
/Default
25 TITLE
:=Open source SSL toolkit
27 The OpenSSL Project is a collaborative effort to develop a robust
, \\\
28 commercial-grade
, full-featured
, and Open Source toolkit implementing the
\\\
29 Secure Sockets Layer
(SSL v2
/v3
) and Transport Layer Security
(TLS v1
) \\\
30 protocols
as well
as a full-strength general purpose cryptography library.
31 URL
:=http
://www.openssl.org
/
34 define Package
/libopenssl
35 $(call Package
/openssl
/Default
)
42 This package contains the OpenSSL shared libraries
, needed by other
\\\
46 define Package
/openssl-util
47 $(call Package
/openssl
/Default
)
54 This package contains the OpenSSL command-line utility.
57 define Package
/openssl-util
/conffiles
61 OPENSSL_NO_CIPHERS
:= no-idea no-md2 no-mdc2 no-rc2 no-rc5 no-sha0 no-smime \
62 no-rmd160 no-aes192 no-ripemd no-camellia no-ans1 no-krb5
63 OPENSSL_OPTIONS
:= shared no-ec no-err no-fips no-hw no-threads zlib-dynamic \
64 no-engines no-sse2 no-perlasm
67 define Build
/Configure
68 (cd
$(PKG_BUILD_DIR
); \
69 .
/Configure linux-openwrt \
71 --openssldir
=/etc
/ssl \
72 -I
$(STAGING_DIR
)/usr
/include \
73 -L
$(STAGING_DIR
)/usr
/lib
-ldl \
74 -DOPENSSL_SMALL_FOOTPRINT \
75 $(OPENSSL_NO_CIPHERS
) \
81 rm -rf
$(PKG_INSTALL_DIR
)
82 mkdir
-p
$(PKG_INSTALL_DIR
)
83 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
84 MAKEDEPPROG
="$(TARGET_CROSS)gcc" \
85 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
87 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
89 AR
="$(TARGET_CROSS)ar r" \
90 RANLIB
="$(TARGET_CROSS)ranlib" \
91 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
93 # Work around openssl build bug to link libssl.so with libcrypto.so.
94 -rm $(PKG_BUILD_DIR
)/libssl.so.
*.
*.
*
95 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
97 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
99 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
100 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
104 define Build
/InstallDev
105 mkdir
-p
$(STAGING_DIR
)/usr
/include
106 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/openssl
$(STAGING_DIR
)/usr
/include/
107 mkdir
-p
$(STAGING_DIR
)/usr
/lib
/
108 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.
{a
,so
*} $(STAGING_DIR
)/usr
/lib
/
111 define Build
/UninstallDev
112 rm -rf
$(STAGING_DIR
)/usr
/include/openssl \
113 $(STAGING_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.
{a
,so
*}
116 define Package
/libopenssl
/install
117 $(INSTALL_DIR
) $(1)/usr
/lib
118 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.so.
* $(1)/usr
/lib
/
119 chmod
0644 $(1)/usr
/lib
/*
122 define Package
/openssl-util
/install
123 $(INSTALL_DIR
) $(1)/etc
/ssl
124 $(CP
) $(PKG_INSTALL_DIR
)/etc
/ssl
/openssl.cnf
$(1)/etc
/ssl
/
125 $(INSTALL_DIR
) $(1)/etc
/ssl
/certs
126 $(INSTALL_DIR
) $(1)/etc
/ssl
/private
127 chmod
0700 $(1)/etc
/ssl
/private
128 $(INSTALL_DIR
) $(1)/usr
/bin
129 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/openssl
$(1)/usr
/bin
/
132 $(eval
$(call BuildPackage
,libopenssl
))
133 $(eval
$(call BuildPackage
,openssl-util
))