]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - openssl/openssl.nm
openssl: Enable optimised code for ARM
[people/amarx/ipfire-3.x.git] / openssl / openssl.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = openssl
7 version = 1.0.2d
8 release = 2
9
10 maintainer = Michael Tremer <michael.tremer@ipfire.org>
11 groups = System/Libraries
12 url = http://www.openssl.org/
13 license = OpenSSL
14 summary = A general purpose cryptography library with TLS implementation.
15
16 description
17 The OpenSSL toolkit provides support for secure communications between
18 machines. OpenSSL includes a certificate management tool and shared
19 libraries which provide various cryptographic algorithms and protocols.
20 end
21
22 source_dl = http://openssl.org/source/
23
24 build
25 requires
26 bc
27 gnutls-devel
28 perl
29 util-linux
30 zlib-devel
31 end
32
33 CFLAGS += -DPURIFY
34 export RPM_OPT_FLAGS = %{CFLAGS}
35
36 prepare_cmds
37 sed -e 's/SHLIB_VERSION_NUMBER "1.0.0"/SHLIB_VERSION_NUMBER "%{version}"/' \
38 -i crypto/opensslv.h
39
40 find crypto/ -name Makefile -exec \
41 sed 's/^ASFLAGS=/&-Wa,--noexecstack /' -i {} \;
42
43 # Generate a table with the compile settings for my perusal.
44 touch Makefile
45 make TABLE PERL=/usr/bin/perl
46 end
47
48 # Set default ssl_arch.
49 ssl_arch = linux-%{DISTRO_ARCH}
50
51 if "%{DISTRO_ARCH}" == "i686"
52 # 386 implies no-sse2
53 ssl_arch = linux-elf no-asm 386
54 end
55
56 if "%{DISTRO_ARCH}" == "armv5tel"
57 ssl_arch = linux-armv4
58 end
59
60 if "%{DISTRO_ARCH}" == "armv7hl"
61 ssl_arch = linux-armv4
62 end
63
64 build
65 ./Configure \
66 --prefix=/usr \
67 --openssldir=/etc/pki/tls \
68 --enginesdir=%{libdir}/openssl/engines \
69 shared \
70 zlib-dynamic \
71 enable-camellia \
72 enable-md2 \
73 enable-seed \
74 enable-tlsext \
75 enable-rfc3779 \
76 no-idea \
77 no-mdc2 \
78 no-rc5 \
79 no-ec2m \
80 no-srp \
81 -DSSL_FORBID_ENULL \
82 %{ssl_arch}
83
84 # Build.
85 make depend
86 make all
87
88 # Generate hashes for the included certs.
89 make rehash
90 end
91
92 test
93 # Revert ca-dir patch. Otherwise the tests will fail.
94 patch -Np1 -R < %{DIR_PATCHES}/openssl-1.0.0-beta4-ca-dir.patch
95
96 make test
97 end
98
99 install
100 make install build-shared INSTALL_PREFIX=%{BUILDROOT}
101
102 # Install manpages do right place
103 mkdir -pv %{BUILDROOT}/usr/share
104 mv -v %{BUILDROOT}/etc/pki/tls/man %{BUILDROOT}/usr/share/
105
106 mkdir -pv %{BUILDROOT}%{libdir}/openssl
107 mv -v %{BUILDROOT}%{libdir}/engines %{BUILDROOT}%{libdir}/openssl
108
109 mkdir -pv %{BUILDROOT}/etc/pki/CA/private
110 chmod -v 700 -R %{BUILDROOT}/etc/pki/CA
111
112 mkdir -pv %{BUILDROOT}/etc/pki/tls
113 install -m 0644 %{DIR_SOURCE}/openssl.cnf %{BUILDROOT}/etc/pki/tls
114 cp -v -r certs %{BUILDROOT}/etc/pki/tls
115
116 # Rename man pages so that they don't conflict with other system man pages.
117 pushd %{BUILDROOT}%{mandir}
118 for m in $(find . -type f | xargs grep -L '#include'); do
119 d="${m%/*}"
120 d="${d#./}"
121 m="${m##*/}"
122 [[ ${m} == openssl.1* ]] && continue
123 [[ -n "$(find -L "${d}" -type l)" ]] && exit 1
124 mv ${d}/{,ssl-}${m}
125
126 # fix up references to renamed man pages
127 sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' "${d}/ssl-${m}"
128 ln -s "ssl-${m}" "${d}/openssl-${m}"
129
130 # locate any symlinks that point to this man page ... we assume
131 # that any broken links are due to the above renaming
132 for s in $(find -L "${d}" -type l); do
133 s="${s##*/}"
134 rm -f "${d}/${s}"
135 ln -s "ssl-${m}" "${d}/ssl-${s}"
136 ln -s "ssl-${s}" "${d}/openssl-${s}"
137 done
138 done
139
140 [[ -n "$(find -L "${d}" -type l)" ]] && exit 1 # "broken manpage links found :("
141 popd
142 end
143 end
144
145 packages
146 package %{name}
147 requires += %{name}-libs = %{thisver}
148 end
149
150 package %{name}-libs
151 template LIBS
152
153 requires += ca-certificates
154
155 conflicts += %{name} < %{thisver}
156
157 files += %{libdir}/openssl
158 end
159
160 package %{name}-devel
161 template DEVEL
162 end
163
164 package %{name}-debuginfo
165 template DEBUGINFO
166 end
167 end