Ticket #31156: Portfile

File Portfile, 5.5 KB (added by dj_mook@…, 13 years ago)

5.9p1 Portfile

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 83098 2011-08-25 21:48:33Z dports@macports.org $
3
4PortSystem 1.0
5
6name            openssh
7version         5.9p1
8
9categories      net
10maintainers     jwa openmaintainer
11description     OpenSSH secure login server
12long_description  OpenSSH is a FREE version of the SSH protocol suite of \
13          network connectivity tools that increasing numbers of people on the \
14          Internet are coming to rely on. Many users of telnet, rlogin, ftp, \
15          and other such programs might not realize that their password is \
16          transmitted across the Internet unencrypted, but it is. OpenSSH \
17          encrypts all traffic (including passwords) to effectively eliminate \
18          eavesdropping, connection hijacking, and other network-level \
19          attacks. Additionally, OpenSSH provides a myriad of secure \
20          tunneling capabilities, as well as a variety of authentication \
21          methods.
22homepage        http://www.openbsd.org/openssh/
23platforms       darwin
24license         BSD
25installs_libs   no
26checksums       ${distfiles} \
27    md5     afe17eee7e98d3b8550cc349834a85d0 \
28    sha1    ac4e0055421e9543f0af5da607a72cf5922dcc56 \
29    rmd160  12d92321a2b9f404641a9cdada738784eb30e1cd
30
31master_sites    openbsd:OpenSSH/portable \
32        http://mirror.mcs.anl.gov/openssh/portable/ \
33        ftp://ftp.cise.ufl.edu/pub/mirrors/openssh/portable/ \
34        ftp://reflection.ncsa.uiuc.edu/pub/OpenBSD/OpenSSH/portable/ \
35        ftp://mirror.mcs.anl.gov/pub/openssh/portable/ \
36        ftp://ftp.cse.buffalo.edu/pub/OpenBSD/OpenSSH/portable/ \
37        ftp://openbsd.mirrors.pair.com/ftp/OpenSSH/portable \
38        ftp://openbsd.secsup.org/pub/openbsd/OpenSSH/portable/
39depends_lib     port:openssl port:zlib
40depends_run     port:xauth
41
42# Specified -fno-builtin because GCC 3.3 has log() as a builtin
43# (from math.h) while OpenSSH has its own log() function
44# -- from fink.
45configure.cppflags-append "-fno-builtin"
46configure.args --with-ssl-dir=${prefix} --sysconfdir=${prefix}/etc/ssh \
47    --with-privsep-path=${prefix}/var/empty --with-md5-passwords \
48    --with-pid-dir=${prefix}/var/run --with-tcp-wrappers \
49    --with-pam --disable-suid-ssh --with-random=/dev/urandom \
50    --mandir=${prefix}/share/man --with-zlib=${prefix} \
51    --with-kerberos5=/usr --with-xauth=${prefix}/bin/xauth \
52    --with-libedit
53
54use_parallel_build      yes
55
56destroot.target install-nokeys
57
58post-destroot {
59  destroot.keepdirs ${destroot}${prefix}/var/run ${destroot}${prefix}/var/empty
60  reinplace "s|#Port 22|Port 2222|g" ${destroot}${prefix}/etc/ssh/sshd_config
61}
62
63variant ssh_copy_id description "Install ssh-copy-id utility" {
64  post-destroot {
65    xinstall -m 755 ${worksrcpath}/contrib/ssh-copy-id ${destroot}${prefix}/bin
66    xinstall -m 644 ${worksrcpath}/contrib/ssh-copy-id.1 ${destroot}${prefix}/share/man/man1
67  }
68}
69
70variant no_x11 {
71  configure.args-delete --with-xauth=${prefix}/bin/xauth
72  depends_run-delete    port:xauth
73}
74
75# For high-performance patch
76# re-enable when patch for current version is available
77variant hpn description "apply high performance patch" {
78  patch_sites-append    http://www.psc.edu/networking/projects/hpn-ssh/:hpn
79  patchfiles-append     ${distname}-hpn13v11.diff.gz:hpn
80  checksums-append      ${distname}-hpn13v11.diff.gz \
81                    md5     8be77b83aa4dbdeb744ac682581f868d \
82                    sha1    ea61ab71605ee867eebc1a92875a3ea5369e2d28 \
83                    rmd160  45fbb8e2db2f829f2749cd745ed6a0542adb1c45
84
85  patch.pre_args
86  post-patch {
87    reinplace "s|TMP_SSH_VERSION SSH_PORTABLE|TMP_SSH_VERSION SSH_PORTABLE SSH_HPN|" ${worksrcpath}/version.h
88  }
89}
90
91variant mute_fake_xauth description "Do not print (typically due to XQuartz) 'using fake authentication data' warning messages" {
92  patchfiles-append   patch-clientloop.c.diff
93}
94
95platform darwin {
96  # create link to /usr/include/pam because 'security' was renamed to 'pam'
97  # in OS X.
98  pre-configure {
99    xinstall -d ${workpath}/include
100    file delete ${workpath}/include/security
101    ln -s /usr/include/pam ${workpath}/include/security
102  }
103}
104
105platform darwin 9 {
106#  patch_sites-append   http://www.opensource.apple.com/darwinsource/10.5/OpenSSH-87/patches/:apple
107#  patchfiles-append    DVG-5142987_launchd_DISPLAY_for_X11.patch:apple
108#  checksums-append     DVG-5142987_launchd_DISPLAY_for_X11.patch \
109#                       md5 e188ebbba95c4cde61e0e1b2edc9f992 \
110#                       sha1 62735c5bfbbe1fa41433993435ded7767cc5f1f9 \
111#                       rmd160 eb5262f554583f4925f6f91f6a6d0034c70098ad
112}
113
114startupitem.create  yes
115startupitem.name    OpenSSH
116startupitem.start \
117    "if \[ -x ${prefix}/sbin/sshd ]; then
118        if \[ ! -f ${prefix}/etc/ssh/ssh_host_key \]; then
119            ${prefix}/bin/ssh-keygen -t rsa1 -f \\
120            ${prefix}/etc/ssh/ssh_host_key -N \"\" -C `hostname`
121        fi
122        if \[ ! -f ${prefix}/etc/ssh/ssh_host_dsa_key \]; then
123            ${prefix}/bin/ssh-keygen -t dsa -f \\
124            ${prefix}/etc/ssh/ssh_host_dsa_key -N \"\" -C `hostname`
125        fi
126        if \[ ! -f ${prefix}/etc/ssh/ssh_host_rsa_key \]; then
127            ${prefix}/bin/ssh-keygen -t rsa -f \\
128            ${prefix}/etc/ssh/ssh_host_rsa_key -N \"\" -C `hostname`
129        fi
130        ${prefix}/sbin/sshd
131        fi"
132startupitem.stop \
133    "if \[ -r ${prefix}/var/run/sshd.pid \]; then
134        kill `cat ${prefix}/var/run/sshd.pid`
135        fi"
136
137
138livecheck.type  regex
139livecheck.url   ${homepage}
140livecheck.regex (5.\[0-9\]p\[0-9\])