jobcore/openssh/PKGBUILD
2024-07-01 13:37:54 +03:00

161 lines
5.6 KiB
Bash

#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=openssh
pkgver=9.8p1
pkgrel=01
pkgdesc="SSH protocol implementation for remote login, command execution and file transfer w/o systemd"
url='https://www.openssh.com/portable.html'
depends=(glibc)
makedepends=(autoconf automake
krb5
libedit
libfido2
libxcrypt
linux-headers
openssl
pam
zlib)
optdepends=('sh: for ssh-copy-id and findssl.sh'
'libfido2: FIDO/U2F support'
'x11-ssh-askpass: input passphrase in X'
'xorg-xauth: X11 forwarding')
# old source
#source=("git://anongit.mindrot.org/openssh.git?signed#tag=V_8_2_P1"
backup=('etc/ssh/ssh_config' 'etc/ssh/sshd_config' 'etc/pam.d/sshd')
#options=('debug') ## uncomment this to have the debug pkg produced
source=(https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$pkgver.tar.gz{,.asc}
# "$pkgname-9.0p1-sshd_config.patch"
99-archlinux.conf
$pkgname.tmpfiles
# 'sshd.conf'
'sshd.pam')
#install=install ### systemd autostart crap
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
# extract separate licenses
sed -n '89,113p' LICENCE > ../rijndael.Public-Domain.txt
sed -n '116,145p' LICENCE > ../ssh.BSD-3-Clause.txt
sed -n '148,209p' LICENCE > ../BSD-2-Clause.txt
sed -n '213,218p' LICENCE > ../snprintf.Public-Domain.txt
sed -n '222,258p' LICENCE > ../openbsd-compat.BSD-3-Clause.txt
sed -n '260,278p' LICENCE > ../openbsd-compat.ISC.txt
sed -n '280,308p' LICENCE > ../openbsd-compat.MIT.txt
sed -n '280,308p' LICENCE > ../openbsd-compat.MIT.txt
sed -n '310,338p' LICENCE > ../blowfish.BSD-3-Clause.txt
sed -n '340,368p' LICENCE > ../replacement.BSD-2-Clause.txt
}
#prepare() {
# cd "${srcdir}/${pkgname}-${pkgver}"
# # patch goes here
# patch -p1 -i ../glibc-2.31.patch
#
# autoreconf
#}
build() {
cd "${pkgname}-${pkgver}"
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--libexecdir=/usr/lib/ssh \
--sysconfdir=/etc/ssh \
--disable-strip \
--with-libedit \
--with-security-key-builtin \
--with-ssl-engine \
--with-pam \
--with-privsep-user=nobody \
--with-kerberos5=/usr \
--with-xauth=/usr/bin/xauth \
--with-pid-dir=/run \
--with-default-path='/usr/local/sbin:/usr/local/bin:/usr/bin' \
--without-zlib-version-check \
--without-systemd
make
}
check() {
# NOTE: make t-exec does not work in our build environment
make file-tests interop-tests unit -C $pkgname-$pkgver
}
package() {
depends+=(
krb5 libkrb5.so libgssapi_krb5.so
libedit libedit.so
libxcrypt libcrypt.so
openssl libcrypto.so
pam libpam.so
zlib libz.so
)
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
install -vDm 644 ../99-archlinux.conf -t "$pkgdir/etc/ssh/sshd_config.d/"
install -vdm 755 "$pkgdir/etc/ssh/ssh_config.d"
# ln -sf ssh.1.gz "${pkgdir}"/usr/share/man/man1/slogin.1.gz
install -Dm644 LICENCE -t "$pkgdir/usr/share/licenses/$pkgname/"
install -Dm644 ../*.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
# We are including the service files as guid in making runit 66 services, especially the
# sshdgenkeys service
# install -Dm644 ../sshdgenkeys.service -t "${pkgdir}"/usr/lib/systemd/system/sshdgenkeys.service
# install -Dm644 ../sshd.service -t "${pkgdir}"/usr/lib/systemd/system/sshd.service
# install -Dm644 ../sshd.conf -t "${pkgdir}"/usr/lib/tmpfiles.d/sshd.conf
install -Dm644 ../sshd.pam "${pkgdir}"/etc/pam.d/sshd
# factory files
install -Dm644 ../sshd.pam "$pkgdir"/usr/share/factory/etc/pam.d/sshd
install -Dm644 "$pkgdir/etc/ssh/moduli" -t "$pkgdir"/usr/share/factory/etc/ssh/
install -Dm644 "$pkgdir/etc/ssh/ssh_config" -t "$pkgdir"/usr/share/factory/etc/ssh/
install -Dm644 "$pkgdir/etc/ssh/sshd_config" -t "$pkgdir"/usr/share/factory/etc/ssh/
install -vDm 644 ../99-archlinux.conf -t "$pkgdir/usr/share/factory/etc/ssh/sshd_config.d/"
install -vDm 644 ../$pkgname.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
install -Dm755 contrib/findssl.sh -t "$pkgdir"/usr/bin/
install -Dm755 contrib/ssh-copy-id -t "$pkgdir"/usr/bin/
install -Dm644 contrib/ssh-copy-id.1 -t "$pkgdir"/usr/share/man/man1/
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=(BSD-2-Clause
BSD-3-Clause
ISC
MIT
LicenseRef-Public-Domain)
validpgpkeys=('7168B983815A5EEF59A4ADFD2A3F414E736060BA') # "Damien Miller <djm@mindrot.org>"
sha256sums=(dd8bd002a379b5d499dfb050dd1fa9af8029e80461f4bb6c523c49973f5a39f3 # openssh-9.8p1.tar.gz
dbb65803565909f2c541db9b45385249cacbf021a0cd4189836bff5c3832d4b9 # openssh-9.8p1.tar.gz.asc
78b806c38bc1e246daaa941bfe7880e6eb6f53f093bea5d5868525ae6d223d30 # 99-archlinux.conf
975904668c3c98fff5dbf840717ae959593fa05e90e215e67bf7ee24369d6369 # openssh.tmpfiles
64576021515c0a98b0aaf0a0ae02e0f5ebe8ee525b1e647ab68f369f81ecd846) # sshd.pam
## 1430a7468d6a8525c840d6b811d39776f907022d9a2d614bde201eeb4fbe706d openssh-9.8p1-01-x86_64.pkg.tar.lz