pkgname=openssh pkgver=9.9p1 pkgrel=1 pkgdesc="SSH protocol implementation for remote login, command execution and file transfer" arch=('x86_64') url="https://www.openssh.com/portable.html" license=('BSD-2-Clause' 'BSD-3-Clause' 'ISC' 'LicenseRef-Public-Domain' 'MIT') depends=('glibc' 'systemd') makedepends=('krb5' 'libxcrypt' 'openssl' 'linux-pam' 'zlib') backup=(etc/pam.d/sshd etc/ssh/ssh_config etc/ssh/sshd_config) install=${pkgname}.install source=(https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${pkgname}-${pkgver}.tar.gz sshd.pam 01-permitrootlogin.conf 99-flarebird.conf sshdat.service sshd.service sshd.socket) sha256sums=(b343fbcdbff87f15b1986e6e15d6d4fc9a7d36066be6b7fb507087ba8f966c02 15e711122662d6c7cc7f671b688f1e1709c543d2e61e61e2832c52d6d55f0530 26930fed946d924b87b15c052e255bbe0744c0b0749dbd713f23fa9ec7b94bc5 220db98a99db7022443a42422c6a2ffa14eb6c7ae4563a9f2a36657a1661b9e9 66066cdb28dfb91892bd455a79218f45a6ab23458b1bff036ddd56b9cd4b0c92 d5315c06d024b450bdff521c5680257609006d3b9bec9bfb9fee8c07ce2821ab efc5cf5e700036acdae0602bc551f71adf9a29af8b85505db7195382fc475f03) prepare() { cd ${pkgname}-${pkgver} # remove variable (but useless) first line in config (related to upstream VCS) sed '/^#.*\$.*\$$/d' -i ssh{,d}_config # prepend configuration option to include drop-in configuration files for sshd_config printf "# Include drop-in configurations\nInclude /etc/ssh/sshd_config.d/*.conf\n" | cat - sshd_config > sshd_config.tmp mv -v sshd_config.tmp sshd_config # prepend configuration option to include drop-in configuration files for ssh_config printf "# Include drop-in configurations\nInclude /etc/ssh/ssh_config.d/*.conf\n" | cat - ssh_config > ssh_config.tmp mv -v ssh_config.tmp ssh_config } build() { cd ${pkgname}-${pkgver} local configure_args=( --sysconfdir=/etc/ssh --with-privsep-path=/var/lib/sshd --with-default-path=/usr/bin --with-superuser-path=/usr/sbin:/usr/bin --with-pid-dir=/run --with-xauth=/usr/bin/xauth --with-kerberos5=/usr --with-pam ${configure_options} ) ./configure ${configure_args[@]} make } package() { cd ${pkgname}-${pkgver} make DESTDIR=${pkgdir} install install -vm755 contrib/ssh-copy-id ${pkgdir}/usr/bin install -vm644 contrib/ssh-copy-id.1 ${pkgdir}/usr/share/man/man1 install -vdm755 ${pkgdir}/usr/share/doc/${pkgname}-${pkgver} install -vm644 INSTALL LICENCE OVERVIEW README* ${pkgdir}/usr/share/doc/${pkgname}-${pkgver} install -v -g sys -m700 -d ${pkgdir}/var/lib/sshd install -vDm644 ${srcdir}/sshd.pam ${pkgdir}/etc/pam.d/sshd install -vDm 644 ${srcdir}/01-permitrootlogin.conf -t ${pkgdir}/etc/ssh/sshd_config.d/ install -vDm 644 ${srcdir}/99-flarebird.conf -t ${pkgdir}/etc/ssh/sshd_config.d/ install -vDm644 ${srcdir}/sshd.service ${pkgdir}/usr/lib/systemd/system/sshd.service install -vDm644 ${srcdir}/sshdat.service ${pkgdir}/usr/lib/systemd/system/sshd@.service install -vDm644 ${srcdir}/sshd.socket ${pkgdir}/usr/lib/systemd/system/sshd.socket }