Convert ttcp to new packaging style, add PKG_VERSION, use TARGET_CFLAGS
[openwrt.git] / openwrt / package / openssl / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME := openssl
6 PKG_VERSION := 0.9.7g
7 PKG_RELEASE := 1
8 PKG_MD5SUM := 991615f73338a571b6a1be7d74906934
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 .NOTPARALLEL:
20
21 $(DL_DIR)/$(PKG_SOURCE_FILE):
22 mkdir -p $(DL_DIR)
23 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) $(PKG_MD5SUM) $(PKG_SOURCE_SITE)
24
25 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
26 mkdir -p $(TOOL_BUILD_DIR)
27 $(PKG_SOURCE_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
28 $(PATCH) $(PKG_BUILD_DIR) ./patches
29 $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \
30 $(PKG_BUILD_DIR)/Configure
31 touch $(PKG_BUILD_DIR)/.patched
32
33 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
34 (cd $(PKG_BUILD_DIR); \
35 CFLAGS="-DOPENSSL_NO_KRB5 -DOPENSSL_NO_IDEA -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5" \
36 PATH=$(TARGET_PATH) ./Configure linux-$(ARCH) --prefix=/ \
37 --openssldir=/usr/lib/ssl -L$(STAGING_DIR)/usr/lib -ldl \
38 -I$(STAGING_DIR)/usr/include $(OPENSSL_NO_CIPHERS) \
39 shared no-krb5 no-ec no-engine zlib-dynamic no-hw no-threads )
40 touch $(PKG_BUILD_DIR)/.configured
41
42 $(PKG_BUILD_DIR)/apps/openssl: $(PKG_BUILD_DIR)/.configured
43 $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
44 CC="$(TARGET_CC)" \
45 AR="$(TARGET_CROSS)ar r" \
46 RANLIB="$(TARGET_CROSS)ranlib" \
47 all build-shared
48 # Work around openssl build bug to link libssl.so with libcrypto.so.
49 -rm $(PKG_BUILD_DIR)/libssl.so.*.*.*
50 $(MAKE) -j1 CC=$(TARGET_CC) -C $(PKG_BUILD_DIR) do_linux-shared
51
52 $(STAGING_DIR)/lib/libssl.so: $(PKG_BUILD_DIR)/apps/openssl
53 $(MAKE) -j1 CC=$(TARGET_CC) INSTALL_PREFIX=$(STAGING_DIR) -C $(PKG_BUILD_DIR) install_sw
54 cp -fa $(PKG_BUILD_DIR)/libcrypto.so* $(STAGING_DIR)/lib/
55 chmod a-x $(STAGING_DIR)/lib/libcrypto.so.0.9.7
56 (cd $(STAGING_DIR)/lib; ln -fs libcrypto.so.0.9.7 libcrypto.so)
57 (cd $(STAGING_DIR)/lib; ln -fs libcrypto.so.0.9.7 libcrypto.so.0)
58 cp -fa $(PKG_BUILD_DIR)/libssl.so* $(STAGING_DIR)/lib/
59 chmod a-x $(STAGING_DIR)/lib/libssl.so.0.9.7
60 (cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so)
61 (cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so.0)
62
63 $(PKG_IPK): $(STAGING_DIR)/lib/libssl.so
64 mkdir -p $(PACKAGE_DIR)
65 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
66 mkdir -p $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib
67 cp -a $(STAGING_DIR)/lib/libssl.so* $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib
68 cp -a $(STAGING_DIR)/lib/libcrypto.so* $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib
69 $(STRIP) $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)/usr/lib/*
70 $(IPKG_BUILD) $(PKG_BUILD_DIR)/ipkg/$(PKG_NAME) $(PACKAGE_DIR)
71
72 $(IPKG_STATE_DIR)/info/openssl.list: $(PKG_IPK)
73 $(IPKG) install $(PKG_IPK)
74
75 source: $(DL_DIR)/$(PKG_SOURCE_FILE)
76 prepare: $(PKG_BUILD_DIR)/.patched
77 compile: $(STAGING_DIR)/lib/libssl.so $(PKG_IPK)
78 install: $(PKG_ZLIB) $(IPKG_STATE_DIR)/info/openssl.list
79
80 clean:
81 rm -rf $(PKG_BUILD_DIR)
82 rm -f $(STAGING_DIR)/lib/libssl*
83 rm -f $(STAGING_DIR)/lib/libcrypto*
84 rm -f $(PKG_IPK)
85
This page took 0.062273 seconds and 5 git commands to generate.