source: trunk/package/openssl/Makefile @ 5644

Last change on this file since 5644 was 5644, checked in by nbd, 9 years ago

sync openssl ciphers and options with whiterussian

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 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.8d
13PKG_RELEASE:=1
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
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_MD5SUM:=8ed1853538e1d05a1f5ada61ebf8bffa
21PKG_CAT:=zcat
22
23PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
24PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
25
26include $(INCLUDE_DIR)/package.mk
27
28define Package/openssl/Default
29  TITLE:=Open source SSL toolkit
30  DESCRIPTION:=\
31        The OpenSSL Project is a collaborative effort to develop a robust, \\\
32        commercial-grade, full-featured, and Open Source toolkit implementing the \\\
33        Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) \\\
34        protocols as well as a full-strength general purpose cryptography library.
35  URL:=http://www.openssl.org/
36endef
37
38define Package/libopenssl
39  $(call Package/openssl/Default)
40  SECTION:=libs
41  CATEGORY:=Libraries
42  DEPENDS:=+zlib
43  TITLE+= (libraries)
44  DESCRIPTION+=\\\
45        \\\
46        This package contains the OpenSSL shared libraries, needed by other \\\
47        programs.
48endef
49
50define Package/openssl-util
51  $(call Package/openssl/Default)
52  SECTION:=utils
53  CATEGORY:=Utilities
54  DEPENDS:=+libopenssl
55  TITLE+= (utility)
56  DESCRIPTION+=\\\
57        \\\
58        This package contains the OpenSSL command-line utility.
59endef
60
61define Package/openssl-util/conffiles
62/etc/ssl/openssl.cnf
63endef
64
65OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc2 no-rc5 no-sha0 no-smime no-cast \
66                                        no-rmd160 no-aes192 no-ripemd no-camellia no-ans1 no-krb5 no-ssl2
67OPENSSL_OPTIONS:= shared no-dso no-ec no-err no-fips no-hw no-threads zlib-dynamic \
68                                        no-engines no-sse2 no-perlasm
69
70
71define Build/Configure
72        (cd $(PKG_BUILD_DIR); \
73                ./Configure linux-openwrt \
74                        --prefix=/usr \
75                        --openssldir=/etc/ssl \
76                        -I$(STAGING_DIR)/usr/include \
77                        -L$(STAGING_DIR)/usr/lib -ldl \
78                        -DOPENSSL_SMALL_FOOTPRINT \
79                        $(OPENSSL_NO_CIPHERS) \
80                        $(OPENSSL_OPTIONS) \
81        )
82endef
83
84define Build/Compile
85        rm -rf $(PKG_INSTALL_DIR)
86        mkdir -p $(PKG_INSTALL_DIR)
87        $(MAKE) -C $(PKG_BUILD_DIR) \
88                MAKEDEPPROG="$(TARGET_CROSS)gcc" \
89                OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
90                depend
91        $(MAKE) -C $(PKG_BUILD_DIR) \
92                CC="$(TARGET_CC)" \
93                AR="$(TARGET_CROSS)ar r" \
94                RANLIB="$(TARGET_CROSS)ranlib" \
95                OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
96                all build-shared
97        # Work around openssl build bug to link libssl.so with libcrypto.so.
98        -rm $(PKG_BUILD_DIR)/libssl.so.*.*.*
99        $(MAKE) -C $(PKG_BUILD_DIR) \
100                CC="$(TARGET_CC)" \
101                OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
102                do_linux-shared
103        $(MAKE) -C $(PKG_BUILD_DIR) \
104                INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
105                install
106endef
107
108define Build/InstallDev
109        mkdir -p $(STAGING_DIR)/usr/include
110        $(CP) $(PKG_INSTALL_DIR)/usr/include/openssl $(STAGING_DIR)/usr/include/
111        mkdir -p $(STAGING_DIR)/usr/lib/
112        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.{a,so*} $(STAGING_DIR)/usr/lib/
113endef
114
115define Build/UninstallDev
116        rm -rf  $(STAGING_DIR)/usr/include/openssl \
117                $(STAGING_DIR)/usr/lib/lib{crypto,ssl}.{a,so*}
118endef
119
120define Package/libopenssl/install
121        $(INSTALL_DIR) $(1)/usr/lib
122        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.so.* $(1)/usr/lib/
123        chmod 0644 $(1)/usr/lib/*
124endef
125
126define Package/openssl-util/install
127        $(INSTALL_DIR) $(1)/etc/ssl
128        $(CP) $(PKG_INSTALL_DIR)/etc/ssl/openssl.cnf $(1)/etc/ssl/
129        $(INSTALL_DIR) $(1)/etc/ssl/certs
130        $(INSTALL_DIR) $(1)/etc/ssl/private
131        chmod 0700 $(1)/etc/ssl/private
132        $(INSTALL_DIR) $(1)/usr/bin
133        $(CP) $(PKG_INSTALL_DIR)/usr/bin/openssl $(1)/usr/bin/
134endef
135
136$(eval $(call BuildPackage,libopenssl))
137$(eval $(call BuildPackage,openssl-util))
Note: See TracBrowser for help on using the repository browser.