1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 maintainer = Michael Tremer <michael.tremer@ipfire.org>
11 groups = System/Libraries
12 url = http://www.openssl.org/
14 summary = A general purpose cryptography library with TLS implementation.
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.
22 source_dl = http://openssl.org/source/
34 export RPM_OPT_FLAGS = %{CFLAGS}
37 sed -e 's/SHLIB_VERSION_NUMBER "1.0.0"/SHLIB_VERSION_NUMBER "%{version}"/' \
40 find crypto/ -name Makefile -exec \
41 sed 's/^ASFLAGS=/&-Wa,--noexecstack /' -i {} \;
43 # Generate a table with the compile settings for my perusal.
45 make TABLE PERL=/usr/bin/perl
48 # Set default ssl_arch.
49 ssl_arch = linux-%{DISTRO_ARCH}
51 if "%{DISTRO_ARCH}" == "i686"
53 ssl_arch = linux-elf no-asm 386
56 if "%{DISTRO_ARCH}" == "armv5tel"
57 ssl_arch = linux-armv4
60 if "%{DISTRO_ARCH}" == "armv7hl"
61 ssl_arch = linux-armv4
67 --openssldir=/etc/pki/tls \
68 --enginesdir=%{libdir}/openssl/engines \
88 # Generate hashes for the included certs.
93 # Revert ca-dir patch. Otherwise the tests will fail.
94 patch -Np1 -R < %{DIR_PATCHES}/openssl-1.0.0-beta4-ca-dir.patch
100 make install build-shared INSTALL_PREFIX=%{BUILDROOT}
102 # Install manpages do right place
103 mkdir -pv %{BUILDROOT}/usr/share
104 mv -v %{BUILDROOT}/etc/pki/tls/man %{BUILDROOT}/usr/share/
106 mkdir -pv %{BUILDROOT}%{libdir}/openssl
107 mv -v %{BUILDROOT}%{libdir}/engines %{BUILDROOT}%{libdir}/openssl
109 mkdir -pv %{BUILDROOT}/etc/pki/CA/private
110 chmod -v 700 -R %{BUILDROOT}/etc/pki/CA
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
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
122 [[ ${m} == openssl.1* ]] && continue
123 [[ -n "$(find -L "${d}" -type l)" ]] && exit 1
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}"
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
135 ln -s "ssl-${m}" "${d}/ssl-${s}"
136 ln -s "ssl-${s}" "${d}/openssl-${s}"
140 [[ -n "$(find -L "${d}" -type l)" ]] && exit 1 # "broken manpage links found :("
147 requires += %{name}-libs = %{thisver}
153 requires += ca-certificates
155 conflicts += %{name} < %{thisver}
157 files += %{libdir}/openssl
160 package %{name}-devel
164 package %{name}-debuginfo