jobcomm/openssh-selinux/PKGBUILD

116 lines
4.2 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/jobcomm/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=openssh-selinux
pkgver=9.6p1
pkgrel=01
pkgdesc='Premier connectivity tool for remote login with the SSH protocol, command execution and file transfer, with SELinux support w/o systemd'
url='https://www.openssh.com/portable.html'
depends=('glibc' 'krb5' 'ldns' 'libedit' 'libxcrypt' 'libcrypt.so' 'openssl' 'zlib' 'pam' 'libselinux')
makedepends=('linux-headers' 'libfido2')
optdepends=(
'libfido2: FIDO/U2F support'
'x11-ssh-askpass: input passphrase in X'
'xorg-xauth: X11 forwarding'
)
backup=('etc/ssh/ssh_config' 'etc/ssh/sshd_config' 'etc/pam.d/sshd')
conflicts=("${pkgname/-selinux}" "selinux-${pkgname/-selinux}")
provides=("${pkgname/-selinux}=${pkgver}-${pkgrel}"
"selinux-${pkgname/-selinux}=${pkgver}-${pkgrel}")
groups=('selinux')
#source=("git://anongit.mindrot.org/openssh.git?signed#tag=V_8_2_P1"
#options=('debug') ## uncomment this to have the debug pkg produced
source=("https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${pkgname/-selinux}-${pkgver}.tar.gz"{,.asc}
"00-joborun-linux.conf"
'sshd.conf'
'sshd.pam')
#install=install ### systemd crap
prepare() {
# patch -Np1 -d "${pkgname/-selinux}-$pkgver" -i ../${pkgname/-selinux}-9.0p1-sshd_config.patch
cd ${pkgname/-selinux}-$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/-selinux}-${pkgver}"
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--libexecdir=/usr/lib/ssh \
--sysconfdir=/etc/ssh \
--disable-strip \
--with-ldns \
--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' \
--with-selinux \
--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/-selinux}-$pkgver
}
package() {
cd ${pkgname/-selinux}-$pkgver
make DESTDIR="$pkgdir" install
install -vDm 644 ../00-joborun-linux.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 ../sshd.conf -t "$pkgdir"/usr/lib/tmpfiles.d/
install -Dm644 ../sshd.pam "$pkgdir"/etc/pam.d/sshd
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)
validpgpkeys=('7168B983815A5EEF59A4ADFD2A3F414E736060BA') # Damien Miller <djm@mindrot.org>
sha256sums=(910211c07255a8c5ad654391b40ee59800710dd8119dd5362de09385aa7a777c # openssh-9.6p1.tar.gz
9b1e931cbc811f02e91f7eacd55f8211cc45dade11975462f4b0dcdad29927aa # openssh-9.6p1.tar.gz.asc
78b806c38bc1e246daaa941bfe7880e6eb6f53f093bea5d5868525ae6d223d30 # 00-joborun-linux.conf
76635a91526ce44571485e292e3a777ded6a439af78cb93514b999f91fb9b327 # sshd.conf
64576021515c0a98b0aaf0a0ae02e0f5ebe8ee525b1e647ab68f369f81ecd846) # sshd.pam
## 79d8982b3aa12b628ad90b35ad4d41af7432c2f01062d9f4debcadbda5fa9cba openssh-selinux-9.6p1-01-x86_64.pkg.tar.lz