add tcpdump depend on libpcap
[openwrt.git] / openwrt / package / openssl / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME := openssl
6 PKG_VERSION := 0.9.7e
7 PKG_RELEASE := 1
8 PKG_MD5SUM := a8777164bca38d84e5eb2b1535223474
9
10 PKG_SOURCE_SITE := http://www.openssl.org/source
11 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_SOURCE_CAT := zcat
13 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
14 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
15 PKG_IPK := $(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
16
17 OPENSSL_NO_CIPHERS:=no-idea no-mdc2 no-rc5 no-rc2 no-md2 no-md4
18
19 $(DL_DIR)/$(PKG_SOURCE_FILE):
20 mkdir -p $(DL_DIR)
21 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) $(PKG_MD5SUM) $(PKG_SOURCE_SITE)
22
23 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
24 mkdir -p $(TOOL_BUILD_DIR)
25 $(PKG_SOURCE_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
26 $(PATCH) $(PKG_BUILD_DIR) ./patches
27 $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \
28 $(PKG_BUILD_DIR)/Configure
29 touch $(PKG_BUILD_DIR)/.patched
30
31 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
32 (cd $(PKG_BUILD_DIR); \
33 CFLAGS="-DOPENSSL_NO_KRB5 -DOPENSSL_NO_IDEA -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5" \
34 PATH=$(TARGET_PATH) ./Configure linux-$(ARCH) --prefix=/ \
35 --openssldir=/usr/lib/ssl -L$(STAGING_DIR)/lib -ldl \
36 -I$(STAGING_DIR)/include $(OPENSSL_NO_CIPHERS) \
37 shared no-krb5 no-ec no-engine zlib-dynamic no-hw no-threads )
38 touch $(PKG_BUILD_DIR)/.configured
39
40 $(PKG_BUILD_DIR)/apps/openssl: $(PKG_BUILD_DIR)/.configured
41 $(MAKE) CC=$(TARGET_CC) -C $(PKG_BUILD_DIR) all build-shared
42 # Work around openssl build bug to link libssl.so with libcrypto.so.
43 -rm $(PKG_BUILD_DIR)/libssl.so.*.*.*
44 $(MAKE) CC=$(TARGET_CC) -C $(PKG_BUILD_DIR) do_linux-shared
45
46 $(STAGING_DIR)/lib/libssl.so: $(PKG_BUILD_DIR)/apps/openssl
47 $(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(STAGING_DIR) -C $(PKG_BUILD_DIR) install_sw
48 cp -fa $(PKG_BUILD_DIR)/libcrypto.so* $(STAGING_DIR)/lib/
49 chmod a-x $(STAGING_DIR)/lib/libcrypto.so.0.9.7
50 (cd $(STAGING_DIR)/lib; ln -fs libcrypto.so.0.9.7 libcrypto.so)
51 (cd $(STAGING_DIR)/lib; ln -fs libcrypto.so.0.9.7 libcrypto.so.0)
52 cp -fa $(PKG_BUILD_DIR)/libssl.so* $(STAGING_DIR)/lib/
53 chmod a-x $(STAGING_DIR)/lib/libssl.so.0.9.7
54 (cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so)
55 (cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so.0)
56
57 $(PKG_IPK): $(STAGING_DIR)/lib/libssl.so
58 mkdir -p $(PACKAGE_DIR)
59 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
60 mkdir -p $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib
61 cp -a $(STAGING_DIR)/lib/libssl.so* $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib
62 cp -a $(STAGING_DIR)/lib/libcrypto.so* $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib
63 $(STRIP) $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib/*
64 $(IPKG_BUILD) $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME) $(PACKAGE_DIR)
65
66 $(IPKG_STATE_DIR)/info/openssl.list: $(PKG_IPK)
67 $(IPKG) install $(PKG_IPK)
68
69 source: $(DL_DIR)/$(PKG_SOURCE_FILE)
70 prepare: $(PKG_BUILD_DIR)/.patched
71 compile: $(STAGING_DIR)/lib/libssl.so $(PKG_IPK)
72 install: $(PKG_ZLIB) $(IPKG_STATE_DIR)/info/openssl.list
73
74 clean:
75 rm -rf $(PKG_BUILD_DIR)
76 rm -f $(STAGING_DIR)/lib/libssl*
77 rm -f $(STAGING_DIR)/lib/libcrypto*
78 rm -f $(PKG_IPK)
79
This page took 0.04398 seconds and 5 git commands to generate.