Ticket #2779: openssh.diff

File openssh.diff, 3.5 KB (added by mww@…, 19 years ago)

patch for openssh/Portfile

  • Portfile

    old new  
    22
    33PortSystem      1.0
    44name            openssh
    5 version         3.8.1p1
    6 revision        1
    7 revision        0
     5version         4.0
    86categories      net
    97maintainers     yeled@opendarwin.org
    108description     OpenSSH secure login server
     
    2018          methods.
    2119homepage        http://www.openssh.com/
    2220platforms       darwin
    23 checksums       md5 1dbfd40ae683f822ae917eebf171ca42
     21distname                ${distname}p1
     22checksums       md5 7b36f28fc16e1b7f4ba3c1dca191ac92
    2423master_sites    openbsd:OpenSSH/portable \
    2524                ftp://carroll.cac.psu.edu/pub/OpenBSD/OpenSSH/portable/
    26 depends_lib     lib:libssl.0.9.7:openssl lib:libz.1.1.4:zlib
     25depends_lib     lib:XXX:openssl lib:XXX:zlib
    2726
    2827# Specified -fno-builtin because GCC 3.3 has log() as a builtin
    2928# (from math.h) while OpenSSH has its own log() function
     
    3231configure.args --with-ssl-dir=${prefix} --sysconfdir=${prefix}/etc/ssh \
    3332  --with-privsep-path=${prefix}/var/empty --with-md5-passwords \
    3433  --with-pid-dir=${prefix}/var/run --with-tcp-wrappers \
    35   --with-pam --disable-suid-ssh --with-random=/dev/urandom
     34  --with-pam --disable-suid-ssh --with-random=/dev/urandom \
     35  --mandir=${prefix}/share/man
    3636
    3737destroot.target install-nokeys
    3838
    3939post-destroot {
    40   xinstall -o root -m 755 -d ${destroot}${prefix}/etc/rc.d
    4140  destroot.keepdirs ${destroot}${prefix}/var/run ${destroot}${prefix}/var/empty
    42   xinstall -o root -m 755 -c ${portpath}/files/openssh.sh ${destroot}${prefix}/etc/rc.d
    43   reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/rc.d/openssh.sh
     41  reinplace "s|#Port 22|Port 2222|g" ${destroot}${prefix}/etc/ssh/sshd_config
    4442}
    4543
    4644# For X11 Forwarding
     
    5351}
    5452
    5553variant darwin {
    56   depends_run  path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
    5754  # ln -s /usr/include/pam to work/include/security because 'security' was
    5855  # renamed to 'pam' in OS X.
    59   pre-configure { system "mkdir ${workpath}/include"
    60     system "ln -s /usr/include/pam ${workpath}/include/security" }
    61   post-install {
    62   ui_msg "===============================================================================\n"
    63   ui_msg "Setup instructions:\n\t
    64     Make sure SSHSERVER=-NO- is set in /etc/hostconfig or untick\n\t'Remote Sharing' option in System Preferences > Sharing.\n\tOPTIONAL: Copy your /etc/ssh_host* files to ${prefix}/etc/ssh/\n\tRun: `sudo killall sshd && sudo ${prefix}/etc/rc.d/openssh.sh`\n"
    65 ui_msg "===============================================================================\n"
     56  pre-configure {
     57    file mkdir ${workpath}/include
     58    system "ln -s /usr/include/pam ${workpath}/include/security"
    6659  }
    6760}
    6861
     62startupitem.create      yes
     63startupitem.name        OpenSSH
     64startupitem.start \
     65        "if \[ -x ${prefix}/sbin/sshd ]; then
     66                if \[ ! -f ${prefix}/etc/ssh/ssh_host_key \]; then
     67                        ${prefix}/bin/ssh-keygen -t rsa1 -f \\
     68                        ${prefix}/etc/ssh/ssh_host_key -N \"\" -C `hostname`
     69                fi
     70                if \[ ! -f ${prefix}/etc/ssh/ssh_host_dsa_key \]; then
     71                        ${prefix}/bin/ssh-keygen -t dsa -f \\
     72                        ${prefix}/etc/ssh/ssh_host_dsa_key -N \"\" -C `hostname`
     73                fi
     74                if \[ ! -f ${prefix}/etc/ssh/ssh_host_rsa_key \]; then
     75                        ${prefix}/bin/ssh-keygen -t rsa -f \\
     76                        ${prefix}/etc/ssh/ssh_host_rsa_key -N \"\" -C `hostname`
     77                fi
     78                ${prefix}/sbin/sshd
     79                fi"
     80startupitem.stop \
     81        "if \[ -r ${prefix}/var/run/sshd.pid \]; then
     82                kill `cat ${prefix}/var/run/sshd.pid` && rm ${prefix}/var/run/sshd.pid
     83                fi"
     84startupitem.restart     "StopService; StartService"