2 # Copyright (C) 2006-2008 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
:=a5cb5f6c3d11affb387ecf7a997cac0c
22 PKG_BUILD_DEPENDS
:=ocf-crypto-headers
24 include $(INCLUDE_DIR
)/package.mk
26 define Package
/openssl
/Default
27 TITLE
:=Open source SSL toolkit
28 URL
:=http
://www.openssl.org
/
31 define Package
/openssl
/Default
/description
32 The OpenSSL Project is a collaborative effort to develop a robust
,
33 commercial-grade
, full-featured
, and Open Source toolkit implementing the
34 Secure Sockets Layer
(SSL v2
/v3
) and Transport Layer Security
(TLS v1
)
35 protocols
as well
as a full-strength general purpose cryptography library.
38 define Package
/libopenssl
39 $(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 no-perlasm
--with-cryptodev
76 OPENSSL_OPTIONS
:= shared no-ec no-err no-hw no-threads zlib-dynamic \
77 no-engines no-sse2 no-perlasm
81 define Build
/Configure
82 (cd
$(PKG_BUILD_DIR
); \
83 .
/Configure linux-openwrt \
85 --openssldir
=/etc
/ssl \
87 $(TARGET_LDFLAGS
) -ldl \
88 -DOPENSSL_SMALL_FOOTPRINT \
89 $(OPENSSL_NO_CIPHERS
) \
94 TARGET_CFLAGS
+= $(FPIC
)
97 rm -rf
$(PKG_INSTALL_DIR
)
98 mkdir
-p
$(PKG_INSTALL_DIR
)
99 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
100 MAKEDEPPROG
="$(TARGET_CROSS)gcc" \
101 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
103 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
105 AR
="$(TARGET_CROSS)ar r" \
106 RANLIB
="$(TARGET_CROSS)ranlib" \
107 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
109 # Work around openssl build bug to link libssl.so with libcrypto.so.
110 -rm $(PKG_BUILD_DIR
)/libssl.so.
*.
*.
*
111 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
113 OPENWRT_OPTIMIZATION_FLAGS
="$(TARGET_CFLAGS)" \
115 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
116 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
120 define Build
/InstallDev
121 mkdir
-p
$(1)/usr
/include
122 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/openssl
$(1)/usr
/include/
123 mkdir
-p
$(1)/usr
/lib
/
124 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.
{a
,so
*} $(1)/usr
/lib
/
125 mkdir
-p
$(1)/usr
/lib
/pkgconfig
126 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/{openssl
,libcrypto
,libssl
}.
pc $(1)/usr
/lib
/pkgconfig
/
127 $(SED
) 's#$(TARGET_LDFLAGS)##g' $(1)/usr
/lib
/pkgconfig
/{openssl
,libcrypto
,libssl
}.
pc
130 define Package
/libopenssl
/install
131 $(INSTALL_DIR
) $(1)/usr
/lib
132 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.so.
* $(1)/usr
/lib
/
133 chmod
0644 $(1)/usr
/lib
/*
136 define Package
/openssl-util
/install
137 $(INSTALL_DIR
) $(1)/etc
/ssl
138 $(CP
) $(PKG_INSTALL_DIR
)/etc
/ssl
/openssl.cnf
$(1)/etc
/ssl
/
139 $(INSTALL_DIR
) $(1)/etc
/ssl
/certs
140 $(INSTALL_DIR
) $(1)/etc
/ssl
/private
141 chmod
0700 $(1)/etc
/ssl
/private
142 $(INSTALL_DIR
) $(1)/usr
/bin
143 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/openssl
$(1)/usr
/bin
/
146 $(eval
$(call BuildPackage
,libopenssl
))
147 $(eval
$(call BuildPackage
,openssl-util
))