[tools] firmware-utils: add a file {en,de}cryption tool, based on the PC1 encryption...
[openwrt.git] / package / openssl / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=openssl
11 PKG_VERSION:=0.9.8k
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.openssl.org/source/ \
16 ftp://ftp.funet.fi/pub/crypt/cryptography/libs/openssl/source/ \
17 ftp://ftp.webmonster.de/pub/openssl/source/ \
18 ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/
19 PKG_MD5SUM:=e555c6d58d276aec7fdc53363e338ab3
20
21 PKG_BUILD_DEPENDS:=ocf-crypto-headers
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/openssl/Default
26 TITLE:=Open source SSL toolkit
27 URL:=http://www.openssl.org/
28 endef
29
30 define Package/openssl/Default/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 endef
36
37 define Package/libopenssl
38 $(call Package/openssl/Default)
39 SECTION:=libs
40 SUBMENU:=SSL
41 CATEGORY:=Libraries
42 DEPENDS:=+zlib
43 TITLE+= (libraries)
44 endef
45
46 define Package/libopenssl/description
47 $(call Package/openssl/Default/description)
48 This package contains the OpenSSL shared libraries, needed by other
49 programs.
50 endef
51
52 define Package/openssl-util
53 $(call Package/openssl/Default)
54 SECTION:=utils
55 CATEGORY:=Utilities
56 DEPENDS:=+libopenssl
57 TITLE+= (utility)
58 endef
59
60 define Package/openssl-util/conffiles
61 /etc/ssl/openssl.cnf
62 endef
63
64 define Package/openssl-util/description
65 $(call Package/openssl/Default/description)
66 This package contains the OpenSSL command-line utility.
67 endef
68
69
70 OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-smime \
71 no-rmd160 no-aes192 no-ripemd no-camellia no-ans1 no-krb5
72 ifeq ($(BOARD),ixp4xx)
73 OPENSSL_OPTIONS:= shared no-ec no-err no-hw no-threads zlib-dynamic \
74 no-sse2 no-perlasm --with-cryptodev
75 else
76 OPENSSL_OPTIONS:= shared no-ec no-err no-hw no-threads zlib-dynamic \
77 no-engines no-sse2 no-perlasm
78 endif
79
80
81 define Build/Configure
82 (cd $(PKG_BUILD_DIR); \
83 ./Configure linux-openwrt \
84 --prefix=/usr \
85 --openssldir=/etc/ssl \
86 $(TARGET_CPPFLAGS) \
87 $(TARGET_LDFLAGS) -ldl \
88 -DOPENSSL_SMALL_FOOTPRINT \
89 $(OPENSSL_NO_CIPHERS) \
90 $(OPENSSL_OPTIONS) \
91 )
92 endef
93
94 TARGET_CFLAGS += $(FPIC)
95
96 define Build/Compile
97 # XXX: OpenSSL "make depend" will look for installed headers before its own,
98 # so remove installed stuff first
99 -$(SUBMAKE) -j1 clean-staging
100 $(MAKE) -C $(PKG_BUILD_DIR) \
101 MAKEDEPPROG="$(TARGET_CROSS)gcc" \
102 OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
103 depend
104 $(MAKE) -C $(PKG_BUILD_DIR) \
105 CC="$(TARGET_CC)" \
106 AR="$(TARGET_CROSS)ar r" \
107 RANLIB="$(TARGET_CROSS)ranlib" \
108 OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
109 all build-shared
110 # Work around openssl build bug to link libssl.so with libcrypto.so.
111 -rm $(PKG_BUILD_DIR)/libssl.so.*.*.*
112 $(MAKE) -C $(PKG_BUILD_DIR) \
113 CC="$(TARGET_CC)" \
114 OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
115 do_linux-shared
116 $(MAKE) -C $(PKG_BUILD_DIR) \
117 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
118 install
119 endef
120
121 define Build/InstallDev
122 mkdir -p $(1)/usr/include
123 $(CP) $(PKG_INSTALL_DIR)/usr/include/openssl $(1)/usr/include/
124 mkdir -p $(1)/usr/lib/
125 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.{a,so*} $(1)/usr/lib/
126 mkdir -p $(1)/usr/lib/pkgconfig
127 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/{openssl,libcrypto,libssl}.pc $(1)/usr/lib/pkgconfig/
128 $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/{openssl,libcrypto,libssl}.pc
129 endef
130
131 define Package/libopenssl/install
132 $(INSTALL_DIR) $(1)/usr/lib
133 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.so.* $(1)/usr/lib/
134 chmod 0644 $(1)/usr/lib/*
135 endef
136
137 define Package/openssl-util/install
138 $(INSTALL_DIR) $(1)/etc/ssl
139 $(CP) $(PKG_INSTALL_DIR)/etc/ssl/openssl.cnf $(1)/etc/ssl/
140 $(INSTALL_DIR) $(1)/etc/ssl/certs
141 $(INSTALL_DIR) $(1)/etc/ssl/private
142 chmod 0700 $(1)/etc/ssl/private
143 $(INSTALL_DIR) $(1)/usr/bin
144 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/openssl $(1)/usr/bin/
145 endef
146
147 $(eval $(call BuildPackage,libopenssl))
148 $(eval $(call BuildPackage,openssl-util))
This page took 0.051096 seconds and 5 git commands to generate.