]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - pkgs/core/openssl/openssl.nm
New package: openssl.
[people/amarx/ipfire-3.x.git] / pkgs / core / openssl / openssl.nm
CommitLineData
93c1e71e
MT
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include $(PKGROOT)/Include
26
27PKG_NAME = openssl
28PKG_VER = 0.9.8k
29PKG_REL = 0
30
31PKG_MAINTAINER =
32PKG_GROUP = System/Libraries
33PKG_URL = http://www.openssl.org/
34PKG_LICENSE = OpenSSL
35PKG_SUMMARY = A general purpose cryptography library with TLS implementation.
36
37PKG_BUILD_DEPS+= perl
38
39define PKG_DESCRIPTION
40 The OpenSSL toolkit provides support for secure communications between \
41 machines. OpenSSL includes a certificate management tool and shared \
42 libraries which provide various cryptographic algorithms and protocols.
43endef
44
45PKG_TARBALL = $(THISAPP).tar.gz
46
47PKG_PATCHES += $(THISAPP)-fix_manpages-1.patch
48PKG_PATCHES += $(THISAPP)-enginesdir.patch
49PKG_PATCHES += $(THISAPP)-no-rpath.patch
50
51ifneq "$(MACHINE)" "i686"
52 SSL_ARCH = no-asm 386 # 386 implies no-sse2
53endif
54
55# These arches do support sse2.
56#ifneq "$(TARGET)" "via-c7"
57#ifneq "$(TARGET)" "atom"
58#ifneq "$(TARGET)" "core2duo"
59# SSL_ARCH += no-sse2
60#endif
61#endif
62#endif
63
64###############################################################################
65# Installation Details
66###############################################################################
67
68define STAGE_PREPARE_CMDS
69 cd $(DIR_APP) && sed -i -e 's/-O3 -fomit-frame-pointer/$(CFLAGS)/' Configure
70
71 cd $(DIR_APP) && sed -e 's/__OpenBSD__/__linux__/' -e 's/arandom/urandom/' \
72 -i.orig crypto/rand/randfile.c
73
74 cd $(DIR_APP) && sed 's/__OpenBSD__/__linux__/' -i.orig crypto/uid.c
75 cd $(DIR_APP) && sed -e 's/__OpenBSD__/__linux__/' -i crypto/rand/rand_unix.c
76
77 cd $(DIR_APP) && find crypto/ -name Makefile -exec \
78 sed 's/^ASFLAGS=/&-Wa,--noexecstack /' -i.orig {} \;
79endef
80
81define STAGE_BUILD
82 cd $(DIR_APP) && \
83 ./Configure \
84 --prefix=/usr \
85 --openssldir=/etc/pki/tls \
86 --enginesdir=/usr/lib/openssl/engines \
87 linux-elf $(SSL_ARCH) \
88 shared \
89 zlib-dynamic \
90 enable-camellia \
91 enable-seed \
92 enable-tlsext \
93 enable-rfc3779 \
94 no-idea \
95 no-mdc2 \
96 no-rc5 \
97 no-ec \
98 no-ecdh \
99 no-ecdsa \
100 -DSSL_FORBID_ENULL
101
102 # Build.
103 cd $(DIR_APP) && make all build-shared #$(PARALLELISMFLAGS)
104
105 # Generate hashes for the included certs.
106 cd $(DIR_APP) && make rehash build-shared
107endef
108
109define STAGE_INSTALL
110 cd $(DIR_APP) && make install build-shared INSTALL_PREFIX=$(BUILDROOT)
111
112 -mkdir -pv $(BUILDROOT)/usr/lib/openssl
113 mv -v $(BUILDROOT)/usr/lib/engines $(BUILDROOT)/usr/lib/openssl
114
115 -mkdir -pv $(BUILDROOT)/etc/pki/CA/private
116 chmod -v 700 -R $(BUILDROOT)/etc/pki/CA
117
118 -mkdir -pv $(BUILDROOT)/etc/pki/tls
119 install -m 0644 $(DIR_SOURCE)/openssl.cnf $(BUILDROOT)/etc/pki/tls
120 cd $(DIR_APP) && cp -v -r certs $(BUILDROOT)/etc/pki/tls
121endef
122