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
); \
55 .
/Configure linux-openwrt \
57 --openssldir
=/etc
/ssl \
58 -I
$(STAGING_DIR
)/usr
/include \
59 -L
$(STAGING_DIR
)/usr
/lib
-ldl \
60 -DOPENSSL_SMALL_FOOTPRINT \
61 $(OPENSSL_NO_CIPHERS
) \
67 rm -rf
$(PKG_INSTALL_DIR
)
68 mkdir
-p
$(PKG_INSTALL_DIR
)
69 $(MAKE
) -C
$(PKG_BUILD_DIR
) -j1 \
70 MAKEDEPPROG
="$(TARGET_CC)" \
72 $(MAKE
) -C
$(PKG_BUILD_DIR
) -j1 \
74 AR
="$(TARGET_CROSS)ar r" \
75 RANLIB
="$(TARGET_CROSS)ranlib" \
77 # Work around openssl build bug to link libssl.so with libcrypto.so.
78 -rm $(PKG_BUILD_DIR
)/libssl.so.
*.
*.
*
79 $(MAKE
) -C
$(PKG_BUILD_DIR
) -j1 \
81 CCOPTS
="$(TARGET_CFLAGS) -fomit-frame-pointer" \
83 $(MAKE
) -C
$(PKG_BUILD_DIR
) -j1 \
84 INSTALL_PREFIX
="$(PKG_INSTALL_DIR)" \
88 define Build
/InstallDev
89 mkdir
-p
$(STAGING_DIR
)/usr
/include
90 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/openssl
$(STAGING_DIR
)/usr
/include/
91 mkdir
-p
$(STAGING_DIR
)/usr
/lib
/
92 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.
{a
,so
*} $(STAGING_DIR
)/usr
/lib
/
95 define Build
/UninstallDev
96 rm -rf
$(STAGING_DIR
)/usr
/include/openssl \
97 $(STAGING_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.
{a
,so
*}
100 define Package
/libopenssl
/install
101 install -d
-m0755
$(1)/usr
/lib
102 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{crypto
,ssl
}.so.
* $(1)/usr
/lib
/
103 chmod
0644 $(1)/usr
/lib
/*
106 define Package
/openssl-util
/install
107 install -d
-m0755
$(1)/etc
/ssl
108 $(CP
) $(PKG_INSTALL_DIR
)/etc
/ssl
/openssl.cnf
$(1)/etc
/ssl
/
109 install -d
-m0755
$(1)/etc
/ssl
/certs
110 install -d
-m0755
$(1)/etc
/ssl
/private
111 chmod
0700 $(1)/etc
/ssl
/private
112 install -d
-m0755
$(1)/usr
/bin
113 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/openssl
$(1)/usr
/bin
/
116 $(eval
$(call BuildPackage
,libopenssl
))
117 $(eval
$(call BuildPackage
,openssl-util
))