1 include $(TOPDIR
)/rules.mk
7 PKG_SOURCE_SITE
:= http
://www.openssl.org
/source
8 PKG_SOURCE_FILE
:= $(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
10 PKG_SOURCE_DIR
:= $(PKG_NAME
)-$(PKG_VERSION
)
11 PKG_BUILD_DIR
:= $(BUILD_DIR
)/$(PKG_SOURCE_DIR
)
12 PKG_IPK
:= $(PACKAGE_DIR
)/$(PKG_NAME
)_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
14 OPENSSL_NO_CIPHERS
:=no-idea no-mdc2 no-rc5 no-rc2 no-md2 no-md4
16 $(DL_DIR
)/$(PKG_SOURCE_FILE
):
18 $(WGET
) -P
$(DL_DIR
) $(PKG_SOURCE_SITE
)/$(PKG_SOURCE_FILE
)
20 $(PKG_BUILD_DIR
)/.patched
: $(DL_DIR
)/$(PKG_SOURCE_FILE
)
21 mkdir
-p
$(TOOL_BUILD_DIR
)
22 $(PKG_SOURCE_CAT
) $(DL_DIR
)/$(PKG_SOURCE_FILE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
23 $(PATCH
) $(PKG_BUILD_DIR
) .
/patches
24 $(SED
) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \
25 $(PKG_BUILD_DIR
)/Configure
26 touch
$(PKG_BUILD_DIR
)/.patched
28 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.patched
29 (cd
$(PKG_BUILD_DIR
); \
30 CFLAGS
="-DOPENSSL_NO_KRB5 -DOPENSSL_NO_IDEA -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5" \
31 PATH
=$(TARGET_PATH
) .
/Configure linux-
$(ARCH
) --prefix=/ \
32 --openssldir
=/usr
/lib
/ssl
-L
$(STAGING_DIR
)/lib
-ldl \
33 -I
$(STAGING_DIR
)/include $(OPENSSL_NO_CIPHERS
) \
34 shared no-krb5 no-ec no-engine zlib-dynamic no-hw no-threads
)
35 touch
$(PKG_BUILD_DIR
)/.configured
37 $(PKG_BUILD_DIR
)/apps
/openssl
: $(PKG_BUILD_DIR
)/.configured
38 $(MAKE
) CC
=$(TARGET_CC
) -C
$(PKG_BUILD_DIR
) all build-shared
39 # Work around openssl build bug to link libssl.so with libcrypto.so.
40 -rm $(PKG_BUILD_DIR
)/libssl.so.
*.
*.
*
41 $(MAKE
) CC
=$(TARGET_CC
) -C
$(PKG_BUILD_DIR
) do_linux-shared
43 $(STAGING_DIR
)/lib
/libssl.so
: $(PKG_BUILD_DIR
)/apps
/openssl
44 $(MAKE
) CC
=$(TARGET_CC
) INSTALL_PREFIX
=$(STAGING_DIR
) -C
$(PKG_BUILD_DIR
) install_sw
45 cp
-fa
$(PKG_BUILD_DIR
)/libcrypto.so
* $(STAGING_DIR
)/lib
/
46 chmod a-x
$(STAGING_DIR
)/lib
/libcrypto.so
.0.9.7
47 (cd
$(STAGING_DIR
)/lib
; ln
-fs libcrypto.so
.0.9.7 libcrypto.so
)
48 (cd
$(STAGING_DIR
)/lib
; ln
-fs libcrypto.so
.0.9.7 libcrypto.so
.0)
49 cp
-fa
$(PKG_BUILD_DIR
)/libssl.so
* $(STAGING_DIR
)/lib
/
50 chmod a-x
$(STAGING_DIR
)/lib
/libssl.so
.0.9.7
51 (cd
$(STAGING_DIR
)/lib
; ln
-fs libssl.so
.0.9.7 libssl.so
)
52 (cd
$(STAGING_DIR
)/lib
; ln
-fs libssl.so
.0.9.7 libssl.so
.0)
54 $(PKG_IPK
): $(STAGING_DIR
)/lib
/libssl.so
55 mkdir
-p
$(PACKAGE_DIR
)
56 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_BUILD_DIR
)/ipkg
/$(PKG_NAME
) $(PKG_NAME
).control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
57 mkdir
-p
$(PKG_BUILD_DIR
)/ipkg
/$(PKG_NAME
)/usr
/lib
58 cp
-a
$(STAGING_DIR
)/lib
/libssl.so
* $(PKG_BUILD_DIR
)/ipkg
/$(PKG_NAME
)/usr
/lib
59 cp
-a
$(STAGING_DIR
)/lib
/libcrypto.so
* $(PKG_BUILD_DIR
)/ipkg
/$(PKG_NAME
)/usr
/lib
60 $(STRIP
) $(PKG_BUILD_DIR
)/ipkg
/$(PKG_NAME
)/usr
/lib
/*
61 $(IPKG_BUILD
) $(PKG_BUILD_DIR
)/ipkg
/$(PKG_NAME
) $(PACKAGE_DIR
)
63 $(IPKG_STATE_DIR
)/info/openssl.list
: $(PKG_IPK
)
64 $(IPKG
) install $(PKG_IPK
)
66 source
: $(DL_DIR
)/$(PKG_SOURCE_FILE
)
67 prepare
: $(PKG_BUILD_DIR
)/.patched
68 compile
: $(STAGING_DIR
)/lib
/libssl.so
$(PACKAGE_DIR
)/$(PKG_IPK
)
69 install: $(PKG_ZLIB
) $(IPKG_STATE_DIR
)/info/openssl.list
72 rm -rf
$(PKG_BUILD_DIR
)
73 rm -f
$(STAGING_DIR
)/lib
/libssl
*
74 rm -f
$(STAGING_DIR
)/lib
/libcrypto
*