aboutsummaryrefslogtreecommitdiffstats
path: root/main/openssh/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'main/openssh/APKBUILD')
-rw-r--r--main/openssh/APKBUILD113
1 files changed, 83 insertions, 30 deletions
diff --git a/main/openssh/APKBUILD b/main/openssh/APKBUILD
index 9494fce30e..fb13f9d1c6 100644
--- a/main/openssh/APKBUILD
+++ b/main/openssh/APKBUILD
@@ -1,24 +1,32 @@
-# Conptributor: Valery Kartel <valery.kartel@gmail.com>
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=openssh
pkgver=7.5_p1
_myver=${pkgver%_*}${pkgver#*_}
-pkgrel=1
+pkgrel=2
pkgdesc="Port of OpenBSD's free SSH release"
url="http://www.openssh.org/portable.html"
arch="all"
license="as-is"
options="suid"
depends="openssh-client openssh-sftp-server openssh-server"
-makedepends_build=""
+makedepends_build="linux-pam-dev"
makedepends_host="libressl-dev zlib-dev linux-headers"
makedepends="$makedepends_build $makedepends_host"
+# Add more packages support here e.g. kerberos
+_pkgsupport="pam"
+for _flavour in $_pkgsupport; do
+ _subpackages="$_subpackages ${pkgname}-server-$_flavour:_pkg_flavour"
+done
subpackages="$pkgname-doc
$pkgname-keygen
$pkgname-client
$pkgname-keysign
$pkgname-sftp-server:sftp
+ $pkgname-server-common:server_common:noarch
$pkgname-server
+ $_subpackages
"
source="http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$_myver.tar.gz
openssh7.4-peaktput.patch
@@ -42,10 +50,18 @@ source="http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$_myver.tar
builddir="$srcdir"/$pkgname-$_myver
+prepare() {
+ cd "$builddir"
+ default_prepare
+ for _flavour in $_pkgsupport; do
+ cp -R "$srcdir"/$pkgname-$_myver "$srcdir"/$pkgname-${_myver}-$_flavour
+ done
+}
+
build() {
cd "$builddir"
export LD="$CC"
- ./configure \
+ _configure_vanilla="./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
@@ -63,30 +79,45 @@ build() {
--with-privsep-user=sshd \
--with-md5-passwords \
--with-ssl-engine \
- --without-pam \
- || return 1
- make || return 1
+ "
+ # now we build "vanilla" openssh
+ _configure="$_configure_vanilla"
+ for _flavour in $_pkgsupport; do
+ _configure="$_configure --without-$_flavour"
+ done
+ msg "Building openssh..."
+ ./configure $_configure
+ make
+
+ # now we build other openssh-$_flavour
+ _configure="$_configure_vanilla"
+ for _flavour in $_pkgsupport; do
+ cd "$builddir-$_flavour"
+ msg "Building openssh with $_flavour support..."
+ ./configure $_configure --with-$_flavour
+ make
+ done
}
package() {
cd "$builddir"
- make DESTDIR="$pkgdir" install || return 1
+ make DESTDIR="$pkgdir" install
mkdir -p "$pkgdir"/var/empty
install -D -m755 "$srcdir"/sshd.initd \
- "$pkgdir"/etc/init.d/sshd || return 1
+ "$pkgdir"/etc/init.d/sshd
install -D -m644 "$srcdir"/sshd.confd \
- "$pkgdir"/etc/conf.d/sshd || return 1
+ "$pkgdir"/etc/conf.d/sshd
install -Dm644 "$builddir"/contrib/ssh-copy-id.1 \
- "$pkgdir"/usr/share/man/man1/ssh-copy-id.1 || return 1
+ "$pkgdir"/usr/share/man/man1/ssh-copy-id.1
sed -i 's/#UseDNS yes/UseDNS no/' "$pkgdir"/etc/ssh/sshd_config
}
keygen() {
pkgdesc="ssh helper program for generating keys"
depends=
- install -d "$subpkgdir"/usr/bin || return 1
+ install -d "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/ssh-keygen \
- "$subpkgdir"/usr/bin/ || return 1
+ "$subpkgdir"/usr/bin/
}
client() {
@@ -98,48 +129,70 @@ client() {
"$subpkgdir"/var/empty
mv "$pkgdir"/usr/bin/* \
- "$subpkgdir"/usr/bin/ || return 1
+ "$subpkgdir"/usr/bin/
mv "$pkgdir"/etc/ssh/ssh_config \
"$pkgdir"/etc/ssh/moduli \
- "$subpkgdir"/etc/ssh/ || return 1
+ "$subpkgdir"/etc/ssh/
install -Dm755 "$builddir"/contrib/findssl.sh \
- "$subpkgdir"/usr/bin/findssl.sh || return 1
+ "$subpkgdir"/usr/bin/findssl.sh
install -Dm755 "$builddir"/contrib/ssh-copy-id \
- "$subpkgdir"/usr/bin/ssh-copy-id || return 1
+ "$subpkgdir"/usr/bin/ssh-copy-id
+ install -Dm755 "$builddir"/ssh-pkcs11-helper \
+ "$subpkgdir"/usr/bin/ssh-pkcs11-helper
}
keysign() {
pkgdesc="ssh helper program for host-based authentication"
depends="openssh-client"
- install -d "$subpkgdir"/usr/lib/ssh || return 1
+ install -d "$subpkgdir"/usr/lib/ssh
mv "$pkgdir"/usr/lib/ssh/ssh-keysign \
- "$subpkgdir"/usr/lib/ssh/ || return 1
+ "$subpkgdir"/usr/lib/ssh/
}
sftp() {
pkgdesc="ssh sftp server module"
depends=""
- install -d "$subpkgdir"/usr/lib/ssh || return 1
+ install -d "$subpkgdir"/usr/lib/ssh
mv "$pkgdir"/usr/lib/ssh/sftp-server \
- "$subpkgdir"/usr/lib/ssh/ || return 1
+ "$subpkgdir"/usr/lib/ssh/
}
-server() {
- pkgdesc="OpenSSH server"
- depends="openssh-keygen"
-
+server_common() {
+ pkgdesc="OpenSSH server configuration files"
+ depends=""
for i in etc/ssh/sshd_config \
etc/init.d/sshd \
- etc/conf.d/sshd \
- usr/sbin/sshd \
- usr/lib/ssh/ssh-pkcs11-helper; do
+ etc/conf.d/sshd; do
- install -d "$subpkgdir"/${i%/*} || return 1
+ install -d "$subpkgdir"/${i%/*}
mv "$pkgdir"/$i \
- "$subpkgdir"/${i%/*}/ || return 1
+ "$subpkgdir"/${i%/*}/
+
done
}
+server() {
+ pkgdesc="OpenSSH server"
+ depends="openssh-keygen openssh-server-common"
+ cd "$builddir"
+ install -d "$subpkgdir"/usr/sbin
+ mv "$pkgdir"/usr/sbin/sshd "$subpkgdir"/usr/sbin/
+}
+
+_server() {
+ cd "$builddir"
+ install -d "$subpkgdir"/usr/sbin
+ mv "$1"/sshd "$subpkgdir"/usr/sbin/
+}
+
+_pkg_flavour() {
+ pkgdesc="OpenSSH server with $_flavour support"
+ depends="openssh-keygen openssh-server-common"
+ for _flavour in $_pkgsupport; do
+ cd "${builddir}"-$_flavour
+ _server "${builddir}"-$_flavour
+ done
+}
sha512sums="58c542e8a110fb4316a68db94abb663fa1c810becd0638d45281df8aeca62c1f705090437a80e788e6c29121769b72a505feced537d3118c933fde01b5285c81 openssh-7.5p1.tar.gz
398096a89aa104abeff31aa043ac406a6348e0fdd4d313b7888ee0b931d38fd71fc21bceee46145e88f03bc27e00890e068442faee2d33f86cfbc04d58ffa4b6 openssh7.4-peaktput.patch