update disclaimer in LFS files
[ipfire-2.x.git] / lfs / openssl-compat
CommitLineData
11e78f38
MT
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
eee037b8 4# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
11e78f38
MT
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 Config
26
a9e61199 27VER = 1.0.2p
11e78f38
MT
28
29THISAPP = openssl-$(VER)
30DL_FILE = $(THISAPP).tar.gz
31DL_FROM = $(URL_IPFIRE)
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33
34TARGET = $(DIR_INFO)/$(THISAPP)$(KCFG)
35
36export RPM_OPT_FLAGS = $(CFLAGS)
37
38CONFIGURE_OPTIONS = \
39 --prefix=/usr \
40 --openssldir=/etc/ssl \
41 --enginesdir=/usr/lib/openssl/engines \
42 shared \
43 zlib-dynamic \
44 enable-camellia \
45 enable-md2 \
46 disable-ssl2 \
47 enable-seed \
48 enable-tlsext \
49 enable-rfc3779 \
50 no-idea \
51 no-mdc2 \
52 no-rc5 \
53 no-srp \
54 -DSSL_FORBID_ENULL \
55 $(OPENSSL_ARCH)
56
57ifeq "$(IS_64BIT)" "1"
58 OPENSSL_ARCH = linux-generic64
59else
60 OPENSSL_ARCH = linux-generic32
61endif
62
63ifeq "$(BUILD_ARCH)" "aarch64"
64 OPENSSL_ARCH = linux-aarch64
65endif
66
67ifeq "$(BUILD_ARCH)" "x86_64"
68 OPENSSL_ARCH = linux-x86_64
69endif
70
71ifeq "$(BUILD_ARCH)" "i586"
72 OPENSSL_ARCH = linux-elf
73
74 ifneq "$(KCFG)" "-sse2"
75 OPENSSL_ARCH += no-sse2
76 endif
77endif
78
79###############################################################################
80# Top-level Rules
81###############################################################################
82
83objects = $(DL_FILE)
84
85$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
86
a9e61199 87$(DL_FILE)_MD5 = ac5eb30bf5798aa14b1ae6d0e7da58df
11e78f38
MT
88
89install : $(TARGET)
90
91check : $(patsubst %,$(DIR_CHK)/%,$(objects))
92
93download :$(patsubst %,$(DIR_DL)/%,$(objects))
94
95md5 : $(subst %,%_MD5,$(objects))
96
97###############################################################################
98# Downloading, checking, md5sum
99###############################################################################
100
101$(patsubst %,$(DIR_CHK)/%,$(objects)) :
102 @$(CHECK)
103
104$(patsubst %,$(DIR_DL)/%,$(objects)) :
105 @$(LOAD)
106
107$(subst %,%_MD5,$(objects)) :
108 @$(MD5)
109
110###############################################################################
111# Installation Details
112###############################################################################
113
114$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
115 @$(PREBUILD)
116 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
117 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.0-beta5-enginesdir.patch
118 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2a-rpmbuild.patch
119 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2h-weak-ciphers.patch
120 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2g-disable-sslv2v3.patch
121
122 # i586 specific patches
123ifeq "$(BUILD_ARCH)" "i586"
11e78f38
MT
124 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2a_disable_ssse3_for_amd.patch
125endif
126
127 # With openssl 1.0.2e, pod2mantest is missing
128 echo -e "#!/bin/bash\necho \$$(which pod2man)" > $(DIR_APP)/util/pod2mantest
129 chmod a+x $(DIR_APP)/util/pod2mantest
130
131 # Apply our CFLAGS
132 cd $(DIR_APP) && sed -i Configure \
133 -e "s/-O3 -fomit-frame-pointer/$(CFLAGS)/g"
134
135 cd $(DIR_APP) && find crypto/ -name Makefile -exec \
136 sed 's/^ASFLAGS=/&-Wa,--noexecstack /' -i {} \;
137
138 cd $(DIR_APP) && ./Configure $(CONFIGURE_OPTIONS)
139
140 cd $(DIR_APP) && make depend
141 cd $(DIR_APP) && make
142
143 # Install libraries only
144 cd $(DIR_APP) && install -m 755 \
b9c56c9e 145 libcrypto.so.10 libssl.so.10 /usr/lib
11e78f38
MT
146
147 @rm -rf $(DIR_APP)
148 @$(POSTBUILD)