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