aboutsummaryrefslogtreecommitdiff
path: root/libs_security/openssl/openssl.build
blob: a25420d2b340aa73d699252566943d795266d7e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
#
# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd>

source /usr/src/ports/Build/build.sh

NAME=openssl
VERSION=1.0.1g
BUILD=1

# These are the known patent issues with OpenSSL:
# name   #          expires
# RC5:   5,724,428  2015-03-03, not included.

# Description

cat > ${PKG}/install/slack-desc <<EOF
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':'.

$(padd)|-----handy-ruler------------------------------------------------------|
${NAME}: openssl (Secure Sockets Layer toolkit)
${NAME}:
${NAME}: The OpenSSL certificate management tool and the shared libraries that
${NAME}: provide various encryption and decryption algorithms and protocols.
${NAME}:
${NAME}: This product includes software developed by the OpenSSL Project for
${NAME}: use in the OpenSSL Toolkit (http://www.openssl.org). This product
${NAME}: includes cryptographic software written by Eric Young
${NAME}: (eay@cryptsoft.com).  This product includes software written by Tim
${NAME}: Hudson (tjh@cryptsoft.com).
${NAME}:
EOF

cat >> ${PKG}/install/doinst.sh <<EOF
#!/bin/sh

config() {
  NEW="\$1"
  OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r \$OLD ]; then
    mv \$NEW \$OLD
  elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then
    # toss the redundant copy
    rm \$NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

config etc/ssl/openssl.cnf.new
config etc/cron.daily/certwatch.new

# Rehash certificates if the package is upgraded on a running system:

if [ -x ${SYS_DIR[bin]}/c_rehash ]; then
  ${SYS_DIR[bin]}/c_rehash 1> /dev/null 2> /dev/null
fi
EOF

# $(uname -m) here is a kludge because we should take care of the arch stuff
# before we get to this point. I.e. ${ARCH} should work here.
case "$(uname -m)" in
  x86)
    OPENSSLTARGET="linux-elf"
    OPTIONS=""
  ;;
  x86_64)
    OPENSSLTARGET="linux-x86_64"
    OPTIONS="enable-ec_nistp_64_gcc_128"
  ;;
esac

# Sources

SRCNAME[0]=${NAME}
SRCVERS[0]=${VERSION}
SRCPACK[0]=http://www.openssl.org/source/${SRCNAME[0]}-${SRCVERS[0]}.tar.gz

build0()
{
sed -i 's|$(LIBDIR)/pkgconfig|$(PREFIX)/share/pkgconfig|g' Makefile.org
sed -i "s|@OPTFLAGS@|${FLAGS}|g" Configure
./Configure \
 --prefix="${SYS_DIR[usr]}" \
 --openssldir="${SYS_DIR[etc]}/ssl" \
 --libdir=lib \
 shared zlib-dynamic \
 no-rc5 no-mdc2 no-ec no-ec2m no-ecdh no-ecdsa no-srp no-sse2 \
 enable-md2 enable-tlsext enable-cms enable-rfc3779 ${OPTIONS} \
 "${OPENSSLTARGET}"
# ${JOBS}
make depend
make
make install INSTALL_PREFIX="${PKG}" MANDIR="${SYS_DIR[man]}"
doc ACKNOWLEDGMENTS FAQ 
changelog NEWS
license LICENSE
install.dir ${PKG}${SYS_DIR[etc]}/cron.daily
install.bin certwatch ${PKG}${SYS_DIR[etc]}/cron.daily/certwatch.new
( cd ${PKG}${SYS_DIR[lib]} ; ldconfig -l lib*.so* )
config ${PKG}${SYS_DIR[etc]}/ssl/openssl.cnf
}