recipe 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. # Build recipe for openssh.
  2. #
  3. # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. program=openssh
  17. version=8.1p1
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/networking"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$tarname
  24. description="
  25. The OpenSSH suite.
  26. OpenSSH is the premier connectivity tool for remote login with the SSH
  27. protocol. It encrypts all traffic to eliminate eavesdropping,
  28. connection hijacking, and other attacks. In addition, OpenSSH provides
  29. a large suite of secure tunneling capabilities, several authentication
  30. methods, and sophisticated configuration options.
  31. "
  32. homepage=http://www.openssh.com
  33. license=Custom
  34. # Source documentation
  35. docs="CREDITS ChangeLog LICENCE OVERVIEW PROTOCOL* README* TODO"
  36. docsdir="${docdir}/${program}-${version}"
  37. build()
  38. {
  39. set -e
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # Set sane permissions
  43. chmod -R u+w,go-w,a+rX-s .
  44. # A patch from Dragora to include a missing header at md5crypt.c file
  45. patch -p1 < "${worktree}/patches/openssh/openssh-include-stdio.h.patch"
  46. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" LIBS="-ledit" \
  47. $configure_args \
  48. --libdir=/usr/lib${libSuffix} \
  49. --sysconfdir=/etc/ssh \
  50. --mandir=$mandir \
  51. --docdir=$docsdir \
  52. --enable-strip \
  53. --with-default-path='/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin' \
  54. --with-privsep-path=/var/lib/sshd \
  55. --with-privsep-user=sshd \
  56. --with-pid-dir=/var/run/sshd \
  57. --with-md5-passwords \
  58. --with-pie \
  59. --without-zlib-version-check \
  60. --build="$(cc -dumpmachine)"
  61. make -j${jobs} V=1
  62. make -j${jobs} DESTDIR="$destdir" install
  63. # Make empty directories for the package
  64. mkdir -p "${destdir}/var/run/sshd" "${destdir}/var/lib/sshd"
  65. # Copy additional utilities
  66. cp -p contrib/ssh-copy-id "${destdir}/usr/bin"
  67. chmod 755 "${destdir}/usr/bin/ssh-copy-id"
  68. mkdir -p "${destdir}/${mandir}/man1"
  69. cp -p contrib/ssh-copy-id.1 "${destdir}/${mandir}/man1"
  70. # Install sshd perp service(s)
  71. mkdir -p "${destdir}/etc/perp/sshd"
  72. cp -p "${worktree}/archive/openssh/rc.log" \
  73. "${worktree}/archive/openssh/rc.main" \
  74. "${destdir}/etc/perp/sshd/"
  75. chmod 755 "${destdir}"/etc/perp/sshd/rc.*
  76. # THIS SERVICE IS DISABLED BY DEFAULT
  77. chmod -t "${destdir}/etc/perp/sshd"
  78. # Manage (dot) new files via graft(1)
  79. touch "${destdir}/etc/ssh/.graft-config" \
  80. "${destdir}/etc/perp/sshd/.graft-config"
  81. # Compress and link man pages (if needed)
  82. if test -d "${destdir}/$mandir"
  83. then
  84. (
  85. cd "${destdir}/$mandir"
  86. find . -type f -exec lzip -9 '{}' +
  87. find . -type l | while read -r file
  88. do
  89. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  90. rm -- "$file"
  91. done
  92. )
  93. fi
  94. # Copy documentation
  95. mkdir -p "${destdir}${docsdir}"
  96. cp -p $docs "${destdir}${docsdir}"
  97. }