source: trunk/package/openssl/Makefile @ 9162

Last change on this file since 9162 was 9162, checked in by blogic, 9 years ago

added our own pkg-config wrapper, making the sed foo on *.pc files obselete 1/2

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