source: branches/buildroot-ng/openwrt/package/openssl/Makefile @ 4723

Last change on this file since 4723 was 4723, checked in by mbm, 10 years ago

fix ccache error

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1#
2# Copyright (C) 2006 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7# $Id$
8
9include $(TOPDIR)/rules.mk
10
11PKG_NAME:=openssl
12PKG_VERSION:=0.9.8b
13PKG_RELEASE:=1
14PKG_MD5SUM:=12cedbeb6813a0d7919dbf1f82134b86
15
16PKG_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/
20PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
21PKG_CAT:=zcat
22
23PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
24PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
25
26OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-rmd160 no-aes192
27OPENSSL_OPTIONS:= shared no-ec no-err no-fips no-hw no-krb5 no-threads zlib-dynamic no-engines
28
29include $(INCLUDE_DIR)/package.mk
30
31define Package/libopenssl
32SECTION:=base
33CATEGORY:=Libraries
34TITLE:=Open source SSL libraries
35DEPENDS:=+zlib
36DESCRIPTION:=Open source SSL (Secure Socket Layer) libraries
37URL:=http://www.openssl.org/
38endef
39
40define Package/openssl-util
41$(call Package/libopenssl)
42DEPENDS:=libopenssl
43TITLE:=OpenSSL command line utilities
44DESCRIPTION:=OpenSSL command line utilities
45endef
46
47define Package/openssl-util/conffiles
48/etc/ssl/openssl.cnf
49endef
50
51define 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 \
56                  --prefix=/usr \
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) \
62                  $(OPENSSL_OPTIONS) \
63        )
64endef
65
66define Build/Compile
67        rm -rf $(PKG_INSTALL_DIR)
68        mkdir -p $(PKG_INSTALL_DIR)
69        $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
70                MAKEDEPPROG="$(TARGET_CROSS)gcc" \
71                depend
72        $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
73                CC="$(TARGET_CC)" \
74                AR="$(TARGET_CROSS)ar r" \
75                RANLIB="$(TARGET_CROSS)ranlib" \
76                all build-shared
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 \
80                CC="$(TARGET_CC)" \
81                CCOPTS="$(TARGET_CFLAGS) -fomit-frame-pointer" \
82                do_linux-shared
83        $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
84                INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
85                install
86endef
87
88define 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/
93endef
94       
95define Build/UninstallDev
96        rm -rf  $(STAGING_DIR)/usr/include/openssl \
97                $(STAGING_DIR)/usr/lib/lib{crypto,ssl}.{a,so*}
98endef
99
100define 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/*
104endef
105
106define 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/
114endef
115
116$(eval $(call BuildPackage,libopenssl))
117$(eval $(call BuildPackage,openssl-util))
Note: See TracBrowser for help on using the repository browser.