]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - pkgs/openssl/openssl.nm
Merge branch 'master' of ssh://git.ipfire.org/pub/git/ipfire-3.x
[people/ms/ipfire-3.x.git] / pkgs / openssl / openssl.nm
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
25 include $(PKGROOT)/Include
26
27 PKG_NAME = openssl
28 PKG_VER = 1.0.0d
29 PKG_REL = 2
30
31 PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
32 PKG_GROUPS = System/Libraries
33 PKG_URL = http://www.openssl.org/
34 PKG_LICENSE = OpenSSL
35 PKG_SUMMARY = A general purpose cryptography library with TLS implementation.
36
37 PKG_BUILD_DEPS+= bc gnutls-devel perl zlib-devel
38
39 define 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.
43 endef
44
45 PKG_TARBALL = $(THISAPP).tar.gz
46
47 PKG_PACKAGES += $(PKG_NAME)-devel
48
49 ifneq "$(MACHINE)" "i686"
50 SSL_ARCH = no-asm 386 # 386 implies no-sse2
51 endif
52
53 # These arches do support sse2.
54 #ifneq "$(TARGET)" "via-c7"
55 #ifneq "$(TARGET)" "atom"
56 #ifneq "$(TARGET)" "core2duo"
57 # SSL_ARCH += no-sse2
58 #endif
59 #endif
60 #endif
61
62 define STAGE_PREPARE_CMDS
63 cd $(DIR_APP) && find crypto/ -name Makefile -exec \
64 sed 's/^ASFLAGS=/&-Wa,--noexecstack /' -i {} \;
65
66 # # Modify the various perl scripts to reference perl in the right location.
67 cd $(DIR_APP) && perl util/perlpath.pl /usr/bin
68
69 # Generate a table with the compile settings for my perusal.
70 cd $(DIR_APP) && touch Makefile
71 cd $(DIR_APP) && make TABLE PERL=/usr/bin/perl
72 endef
73
74 define STAGE_BUILD
75 cd $(DIR_APP) && \
76 ./Configure \
77 --prefix=/usr \
78 --openssldir=/etc/pki/tls \
79 --enginesdir=/usr/lib/openssl/engines \
80 linux-elf $(SSL_ARCH) \
81 shared \
82 zlib-dynamic \
83 enable-camellia \
84 enable-md2 \
85 enable-seed \
86 enable-tlsext \
87 enable-rfc3779 \
88 no-idea \
89 no-mdc2 \
90 no-rc5 \
91 -DSSL_FORBID_ENULL
92
93 # Build.
94 cd $(DIR_APP) && make depend all build-shared RPM_OPT_FLAGS="$(CFLAGS)" #$(PARALLELISMFLAGS)
95
96 # Generate hashes for the included certs.
97 cd $(DIR_APP) && make rehash build-shared
98 endef
99
100 define STAGE_TEST
101 cd $(DIR_APP) && make test
102 endef
103
104 define STAGE_INSTALL
105 cd $(DIR_APP) && make install build-shared INSTALL_PREFIX=$(BUILDROOT)
106
107 -mkdir -pv $(BUILDROOT)/lib
108 mv -vf $(BUILDROOT)/usr/lib/lib{crypto,ssl}.so.* $(BUILDROOT)/lib
109 ln -svf ../../lib/libcrypto.so.10 $(BUILDROOT)/usr/lib/libcrypto.so
110 ln -svf ../../lib/libssl.so.10 $(BUILDROOT)/usr/lib/libssl.so
111
112 # Install manpages do right place
113 -mkdir -pv $(BUILDROOT)/usr/share
114 mv -v $(BUILDROOT)/etc/pki/tls/man $(BUILDROOT)/usr/share/
115
116 -mkdir -pv $(BUILDROOT)/usr/lib/openssl
117 mv -v $(BUILDROOT)/usr/lib/engines $(BUILDROOT)/usr/lib/openssl
118
119 -mkdir -pv $(BUILDROOT)/etc/pki/CA/private
120 chmod -v 700 -R $(BUILDROOT)/etc/pki/CA
121
122 -mkdir -pv $(BUILDROOT)/etc/pki/tls
123 install -m 0644 $(DIR_SOURCE)/openssl.cnf $(BUILDROOT)/etc/pki/tls
124 cd $(DIR_APP) && cp -v -r certs $(BUILDROOT)/etc/pki/tls
125 endef
126