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
14 PKG_MD5SUM
:=12cedbeb6813a0d7919dbf1f82134b86
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_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
23 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
24 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
26 OPENSSL_NO_CIPHERS
:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-rmd160 no-aes192
27 OPENSSL_OPTIONS
:= shared no-ec no-err no-fips no-hw no-krb5 no-threads zlib-dynamic no-engines
29 include $(INCLUDE_DIR
)/package.mk
31 define Package
/libopenssl
34 TITLE
:=Open source SSL libraries
36 DESCRIPTION
:=Open source SSL
(Secure Socket Layer
) libraries
37 URL
:=http
://www.openssl.org
/
40 define Package
/openssl-util
41 $(call Package
/libopenssl
)
43 TITLE
:=OpenSSL command line utilities
44 DESCRIPTION
:=OpenSSL command line utilities
47 define Package
/openssl-util
/conffiles
51 define Build
/Configure
52 $(SED
) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' $(PKG_BUILD_DIR
)/Configure
53 $(SED
) s
/OPENWRT_OPTIMIZATION_FLAGS
/$(BR2_TARGET_OPTIMIZATION
)/g
$(PKG_BUILD_DIR
)/Configure
54 (cd
$(PKG_BUILD_DIR
); \
56 .
/Configure linux-openwrt \
58 --openssldir
=/etc
/ssl \
59 -I
$(STAGING_DIR
)/usr
/include \
60 -L
$(STAGING_DIR
)/usr
/lib
-ldl \
61 -DOPENSSL_SMALL_FOOTPRINT \
62 $(OPENSSL_NO_CIPHERS
) \
68 rm -rf
$(PKG_INSTALL_DIR
)
69 mkdir
-p
$(PKG_INSTALL_DIR
)
70 $(MAKE
) -C
$(PKG_BUILD_DIR
) -j1 \
71 MAKEDEPPROG
="$(TARGET_CC)" \
73 $(MAKE
) -C
$(PKG_BUILD_DIR
) -j1 \
75 AR
="$(TARGET_CROSS)ar r" \
76 RANLIB
="$(TARGET_CROSS)ranlib" \
78 # Work around openssl build bug to link libssl.so with libcrypto.so.
79 -rm $(PKG_BUILD_DIR
)/libssl.so.
*.
*.
*
80 $(MAKE
) -C
$(PKG_BUILD_DIR
) -j1 \
82 CCOPTS
="$(TARGET_CFLAGS) -fomit-frame-pointer" \
84 $(MAKE
) -C
$(PKG_BUILD_DIR
) -j1 \
85 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
89 define Build
/InstallDev
90 mkdir
-p
$(STAGING_DIR
)/usr
/include
91 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/openssl
$(STAGING_DIR
)/usr
/include/
92 mkdir
-p
$(STAGING_DIR
)/usr
/lib
/
93 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.
{a
,so
*} $(STAGING_DIR
)/usr
/lib
/
96 define Build
/UninstallDev
97 rm -rf
$(STAGING_DIR
)/usr
/include/openssl \
98 $(STAGING_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.
{a
,so
*}
101 define Package
/libopenssl
/install
102 install -d
-m0755
$(1)/usr
/lib
103 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.so.
* $(1)/usr
/lib
/
104 chmod
0644 $(1)/usr
/lib
/*
107 define Package
/openssl-util
/install
108 install -d
-m0755
$(1)/etc
/ssl
109 $(CP
) $(PKG_INSTALL_DIR
)/etc
/ssl
/openssl.cnf
$(1)/etc
/ssl
/
110 install -d
-m0755
$(1)/etc
/ssl
/certs
111 install -d
-m0755
$(1)/etc
/ssl
/private
112 chmod
0700 $(1)/etc
/ssl
/private
113 install -d
-m0755
$(1)/usr
/bin
114 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/openssl
$(1)/usr
/bin
/
117 $(eval
$(call BuildPackage
,libopenssl
))
118 $(eval
$(call BuildPackage
,openssl-util
))