1 | # $Id: Portfile 38956 2008-08-04 06:07:51Z wsiegrist@apple.com $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name openssh |
---|
6 | version 5.1p1 |
---|
7 | categories net |
---|
8 | maintainers wms openmaintainer |
---|
9 | description OpenSSH secure login server |
---|
10 | long_description OpenSSH is a FREE version of the SSH protocol suite of \ |
---|
11 | network connectivity tools that increasing numbers of people on the \ |
---|
12 | Internet are coming to rely on. Many users of telnet, rlogin, ftp, \ |
---|
13 | and other such programs might not realize that their password is \ |
---|
14 | transmitted across the Internet unencrypted, but it is. OpenSSH \ |
---|
15 | encrypts all traffic (including passwords) to effectively eliminate \ |
---|
16 | eavesdropping, connection hijacking, and other network-level \ |
---|
17 | attacks. Additionally, OpenSSH provides a myriad of secure \ |
---|
18 | tunneling capabilities, as well as a variety of authentication \ |
---|
19 | methods. |
---|
20 | homepage http://www.openssh.com/ |
---|
21 | platforms darwin |
---|
22 | checksums ${distfiles} \ |
---|
23 | md5 03f2d0c1b5ec60d4ac9997a146d2faec \ |
---|
24 | sha1 877ea5b283060fe0160e376ea645e8e168047ff5 \ |
---|
25 | rmd160 24293ad89633cfd4791f08eb3442becb7e5788ca |
---|
26 | |
---|
27 | master_sites openbsd:OpenSSH/portable \ |
---|
28 | http://mirror.mcs.anl.gov/openssh/portable/ \ |
---|
29 | ftp://ftp.cise.ufl.edu/pub/mirrors/openssh/portable/ \ |
---|
30 | ftp://reflection.ncsa.uiuc.edu/pub/OpenBSD/OpenSSH/portable/ \ |
---|
31 | ftp://mirror.mcs.anl.gov/pub/openssh/portable/ \ |
---|
32 | ftp://ftp.cse.buffalo.edu/pub/OpenBSD/OpenSSH/portable/ \ |
---|
33 | ftp://openbsd.mirrors.pair.com/ftp/OpenSSH/portable \ |
---|
34 | ftp://openbsd.secsup.org/pub/openbsd/OpenSSH/portable/ |
---|
35 | depends_lib port:openssl port:zlib |
---|
36 | |
---|
37 | # Specified -fno-builtin because GCC 3.3 has log() as a builtin |
---|
38 | # (from math.h) while OpenSSH has its own log() function |
---|
39 | # -- from fink. |
---|
40 | configure.cppflags-append "-fno-builtin" |
---|
41 | configure.args --with-ssl-dir=${prefix} --sysconfdir=${prefix}/etc/ssh \ |
---|
42 | --with-privsep-path=${prefix}/var/empty --with-md5-passwords \ |
---|
43 | --with-pid-dir=${prefix}/var/run --with-tcp-wrappers \ |
---|
44 | --with-pam --disable-suid-ssh --with-random=/dev/urandom \ |
---|
45 | --mandir=${prefix}/share/man --with-zlib=${prefix} \ |
---|
46 | --with-kerberos5=/usr |
---|
47 | |
---|
48 | destroot.target install-nokeys |
---|
49 | |
---|
50 | post-destroot { |
---|
51 | destroot.keepdirs ${destroot}${prefix}/var/run ${destroot}${prefix}/var/empty |
---|
52 | reinplace "s|#Port 22|Port 2222|g" ${destroot}${prefix}/etc/ssh/sshd_config |
---|
53 | } |
---|
54 | |
---|
55 | # For X11 Forwarding |
---|
56 | variant apple_x11 description "use (apple's) X11 for forwarding" { # set for X11 forwarding |
---|
57 | configure.args-append --with-xauth=${x11prefix}/bin/xauth |
---|
58 | } |
---|
59 | |
---|
60 | # For high-performance patch |
---|
61 | variant hpn description "apply high performance patch" { |
---|
62 | patch_sites-append http://www.psc.edu/networking/projects/hpn-ssh/ |
---|
63 | patchfiles-append ${distname}-hpn13v5.diff.gz |
---|
64 | checksums-append ${distname}-hpn13v5.diff.gz \ |
---|
65 | md5 614f2cc34817bb9460e3b700be21b94b \ |
---|
66 | sha1 c2911f04f8d46a28afa9f9cbb7ec226cb2c893d1 \ |
---|
67 | rmd160 6466cd0825e80366adc1978069e3c61255e0bde7 |
---|
68 | |
---|
69 | patch.pre_args |
---|
70 | post-patch { |
---|
71 | reinplace "s|TMP_SSH_VERSION SSH_PORTABLE|TMP_SSH_VERSION SSH_PORTABLE SSH_HPN|" ${worksrcpath}/version.h |
---|
72 | } |
---|
73 | } |
---|
74 | |
---|
75 | platform darwin { |
---|
76 | # create link to /usr/include/pam because 'security' was renamed to 'pam' |
---|
77 | # in OS X. |
---|
78 | pre-configure { |
---|
79 | xinstall -d ${workpath}/include |
---|
80 | file delete ${workpath}/include/security |
---|
81 | ln -s /usr/include/pam ${workpath}/include/security |
---|
82 | } |
---|
83 | } |
---|
84 | |
---|
85 | platform darwin 9 { |
---|
86 | patch_sites-append http://www.opensource.apple.com/darwinsource/10.5/OpenSSH-87/patches/ |
---|
87 | patchfiles-append DVG-5142987_launchd_DISPLAY_for_X11.patch |
---|
88 | checksums-append DVG-5142987_launchd_DISPLAY_for_X11.patch \ |
---|
89 | md5 e188ebbba95c4cde61e0e1b2edc9f992 \ |
---|
90 | sha1 62735c5bfbbe1fa41433993435ded7767cc5f1f9 \ |
---|
91 | rmd160 eb5262f554583f4925f6f91f6a6d0034c70098ad |
---|
92 | } |
---|
93 | |
---|
94 | startupitem.create yes |
---|
95 | startupitem.name OpenSSH |
---|
96 | startupitem.start \ |
---|
97 | "if \[ -x ${prefix}/sbin/sshd ]; then |
---|
98 | if \[ ! -f ${prefix}/etc/ssh/ssh_host_key \]; then |
---|
99 | ${prefix}/bin/ssh-keygen -t rsa1 -f \\ |
---|
100 | ${prefix}/etc/ssh/ssh_host_key -N \"\" -C `hostname` |
---|
101 | fi |
---|
102 | if \[ ! -f ${prefix}/etc/ssh/ssh_host_dsa_key \]; then |
---|
103 | ${prefix}/bin/ssh-keygen -t dsa -f \\ |
---|
104 | ${prefix}/etc/ssh/ssh_host_dsa_key -N \"\" -C `hostname` |
---|
105 | fi |
---|
106 | if \[ ! -f ${prefix}/etc/ssh/ssh_host_rsa_key \]; then |
---|
107 | ${prefix}/bin/ssh-keygen -t rsa -f \\ |
---|
108 | ${prefix}/etc/ssh/ssh_host_rsa_key -N \"\" -C `hostname` |
---|
109 | fi |
---|
110 | ${prefix}/sbin/sshd |
---|
111 | fi" |
---|
112 | startupitem.stop \ |
---|
113 | "if \[ -r ${prefix}/var/run/sshd.pid \]; then |
---|
114 | kill `cat ${prefix}/var/run/sshd.pid` |
---|
115 | fi" |
---|