PKGBUILD 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. # Maintainer: Noah Vogt (noahvogt) <noah@noahvogt.com>
  2. # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
  3. # Maintainer: Giancarlo Razzolini <grazzolini@archlinux.org>
  4. # Contributor: Gaetan Bisson <bisson@archlinux.org>
  5. # Contributor: Aaron Griffin <aaron@archlinux.org>
  6. # Contributor: judd <jvinet@zeroflux.org>
  7. pkgname=openssh-dotconfig
  8. pkgver=9.4p1
  9. pkgrel=1
  10. pkgdesc='Premier connectivity tool for remote login with the SSH protocol - but moved $HOME/.ssh to $HOME/.config/ssh'
  11. url='https://www.openssh.com/portable.html'
  12. license=('custom:BSD')
  13. arch=('x86_64')
  14. depends=(
  15. glibc
  16. krb5 libkrb5.so libgssapi_krb5.so
  17. ldns
  18. libedit
  19. libxcrypt libcrypt.so
  20. openssl
  21. pam libpam.so
  22. zlib
  23. )
  24. makedepends=(
  25. libfido2
  26. linux-headers
  27. )
  28. optdepends=(
  29. 'libfido2: FIDO/U2F support'
  30. 'sh: for ssh-copy-id and findssl.sh'
  31. 'x11-ssh-askpass: input passphrase in X'
  32. 'xorg-xauth: X11 forwarding'
  33. )
  34. backup=(
  35. etc/pam.d/sshd
  36. etc/ssh/ssh_config
  37. etc/ssh/sshd_config
  38. )
  39. source=("https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${pkgname%-*}-${pkgver}.tar.gz"
  40. "${pkgname%-*}-9.0p1-sshd_config.patch"
  41. '00-archlinux.conf'
  42. 'sshdgenkeys.service'
  43. 'sshd.service'
  44. 'sshd.conf'
  45. 'sshd.pam')
  46. sha256sums=('3608fd9088db2163ceb3e600c85ab79d0de3d221e59192ea1923e23263866a85'
  47. '27e43dfd1506c8a821ec8186bae65f2dc43ca038616d6de59f322bd14aa9d07f'
  48. '78b806c38bc1e246daaa941bfe7880e6eb6f53f093bea5d5868525ae6d223d30'
  49. 'e5305767b2d317183ad1c5022a5f6705bd9014a8b22495a000fd482713738611'
  50. 'e40f8b7c8e5e2ecf3084b3511a6c36d5b5c9f9e61f2bb13e3726c71dc7d4fbc7'
  51. '76635a91526ce44571485e292e3a777ded6a439af78cb93514b999f91fb9b327'
  52. '64576021515c0a98b0aaf0a0ae02e0f5ebe8ee525b1e647ab68f369f81ecd846')
  53. b2sums=('d13d758129cce947d3f12edb6e88406aad10de6887b19ffa3ebd8e382b742a05f2a692a8824aec99939f6c7e13fbccc3bb14e5ee112f9a9255d4882eb87dcf53'
  54. '29e1a1c2744e0234830c6f93a46338ea8dc943370e20a24883d207d611025e54643da678f2826050c073a36be48dfdc7329d4cfb144c2ff90607a5f10f73dc59'
  55. '1ff8cd4ae22efed2b4260f1e518de919c4b290be4e0b5edbc8e2225ffe63788678d1961e6f863b85974c4697428ee827bcbabad371cfc91cc8b36eae9402eb97'
  56. '09fad3648f48f13ee80195b90913feeba21240d121b1178e0ce62f4a17b1f7e58e8edc22c04403e377ab300f5022a804c848f5be132765d5ca26a38aab262e50'
  57. '07ad5c7fb557411a6646ff6830bc9d564c07cbddc4ce819641d31c05dbdf677bfd8a99907cf529a7ee383b8c250936a6423f4b4b97ba0f1c14f627bbd629bd4e'
  58. 'a3fd8f00430168f03dcbc4a5768ed788dd43140e365a882b601510f53f69704da04f24660157bb8a43125f5389528993732d99569d77d5f3358074e7ae36d4ca'
  59. '557d015bca7008ce824111f235da67b7e0051a693aaab666e97b78e753ed7928b72274af03d7fde12033986b733d5f996faf2a4feb6ecf53f39accae31334930')
  60. provides=('openssh')
  61. conflicts=('openssh')
  62. prepare() {
  63. patch -Np1 -d "${pkgname%-*}-$pkgver" -i ../"${pkgname%-*}"-9.0p1-sshd_config.patch
  64. cd "$srcdir/${pkgname%-*}-$pkgver"
  65. grep -rl "\.ssh" * | xargs sed -i 's/\.ssh/.config\/ssh/g'
  66. # remove variable (but useless) first line in config (related to upstream VCS)
  67. sed '/^#.*\$.*\$$/d' -i ssh{,d}_config
  68. # prepend configuration option to include drop-in configuration files for sshd_config
  69. printf "# Include drop-in configurations\nInclude /etc/ssh/sshd_config.d/*.conf\n" | cat - sshd_config > sshd_config.tmp
  70. mv -v sshd_config.tmp sshd_config
  71. # prepend configuration option to include drop-in configuration files for ssh_config
  72. printf "# Include drop-in configurations\nInclude /etc/ssh/ssh_config.d/*.conf\n" | cat - ssh_config > ssh_config.tmp
  73. mv -v ssh_config.tmp ssh_config
  74. }
  75. build() {
  76. local configure_options=(
  77. --prefix=/usr
  78. --sbindir=/usr/bin
  79. --libexecdir=/usr/lib/ssh
  80. --sysconfdir=/etc/ssh
  81. --disable-strip
  82. --with-ldns
  83. --with-libedit
  84. --with-security-key-builtin
  85. --with-ssl-engine
  86. --with-pam
  87. --with-privsep-user=nobody
  88. --with-kerberos5=/usr
  89. --with-xauth=/usr/bin/xauth
  90. --with-pid-dir=/run
  91. --with-default-path='/usr/local/sbin:/usr/local/bin:/usr/bin'
  92. )
  93. cd "$srcdir/${pkgname%-*}-$pkgver"
  94. ./configure "${configure_options[@]}"
  95. make
  96. }
  97. check() {
  98. # NOTE: make t-exec does not work in our build environment
  99. make file-tests interop-tests unit -C "${pkgname%-*}-$pkgver"
  100. }
  101. package() {
  102. cd "${srcdir}/${pkgname%-*}-${pkgver}"
  103. make DESTDIR="${pkgdir}" install
  104. ln -sf ssh.1.gz "${pkgdir}"/usr/share/man/man1/slogin.1.gz
  105. install -Dm644 LICENCE -t "${pkgdir}/usr/share/licenses/${pkgname%-*}/"
  106. install -Dm644 ../sshdgenkeys.service -t "${pkgdir}"/usr/lib/systemd/system/
  107. install -Dm644 ../sshd.service -t "${pkgdir}"/usr/lib/systemd/system/
  108. install -Dm644 ../sshd.conf -t "${pkgdir}"/usr/lib/tmpfiles.d/
  109. install -Dm644 ../sshd.pam "${pkgdir}"/etc/pam.d/sshd
  110. install -Dm755 contrib/findssl.sh -t "${pkgdir}"/usr/bin/
  111. install -Dm755 contrib/ssh-copy-id -t "${pkgdir}"/usr/bin/
  112. install -Dm644 contrib/ssh-copy-id.1 -t "${pkgdir}"/usr/share/man/man1/
  113. }