aboutsummaryrefslogtreecommitdiffstats
path: root/main/openssh/APKBUILD
blob: 7eca4e7df760abc94b4e4418fd89d54b1c4ff18b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=openssh
pkgver=7.1_p1
_myver=${pkgver%_*}${pkgver#*_}
pkgrel=1
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"
makedepends="openssl-dev zlib-dev linux-headers"
subpackages="$pkgname-doc $pkgname-client $pkgname-keysign
	$pkgname-sftp-server:sftp"
source="ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$_myver.tar.gz
	openssh6.5-peaktput.diff
	openssh7.1-dynwindows.diff
	openssh-fix-utmp.diff
	bsd-compatible-realpath.patch
	sshd.initd
	sshd.confd
	openssh-sftp-interactive.diff
	"
# HPN patches are from: http://www.psc.edu/index.php/hpn-ssh

_builddir="$srcdir"/$pkgname-$_myver
prepare() {
	cd "$_builddir"
	for i in $source; do
		case "$i" in
		*.diff.gz)
			msg "Applying $i"
			gunzip -c "$srcdir"/"${i##*/}" | patch -p1 -N || return 1
			;;
		*.diff|*.patch)
			msg "Applying $i"
			patch -p1 -N -i "$srcdir"/${i##*/} || return 1
			;;
		esac
	done
	sed -i -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
		pathnames.h || return 1

}

build () {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc/ssh \
		--datadir=/usr/share/openssh \
		--libexecdir=/usr/lib/ssh \
		--mandir=/usr/share/man \
		--with-mantype=man \
		--with-ldflags="${LDFLAGS}" \
		--disable-strip \
		--disable-lastlog \
		--disable-wtmp \
		--with-privsep-path=/var/empty \
		--with-privsep-user=sshd \
		--with-md5-passwords \
		--with-ssl-engine \
		--without-pam \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	mkdir -p "$pkgdir"/var/empty
	install -D -m755 "$srcdir"/sshd.initd \
		"$pkgdir"/etc/init.d/sshd || return 1
	install -D -m644 "$srcdir"/sshd.confd \
		"$pkgdir"/etc/conf.d/sshd || return 1
        install -Dm644 "$_builddir"/contrib/ssh-copy-id.1 \
		"$pkgdir"/usr/share/man/man1/ssh-copy-id.1 || return 1
	sed -i 's/#UseDNS yes/UseDNS no/' "$pkgdir"/etc/ssh/sshd_config
}

client() {
	pkgdesc="OpenBSD's SSH client"
	replaces="openssh"
	depends=
	install -d "$subpkgdir"/usr/bin \
		"$subpkgdir"/usr/lib/ssh \
		"$subpkgdir"/etc/ssh \
		"$subpkgdir"/var/run \
		"$subpkgdir"/var/empty

	mv "$pkgdir"/usr/bin/* \
		"$subpkgdir"/usr/bin/ || return 1
	mv "$pkgdir"/etc/ssh/ssh_config \
		"$pkgdir"/etc/ssh/moduli \
		"$subpkgdir"/etc/ssh/ || return 1
	install -Dm755 "$_builddir"/contrib/findssl.sh \
		"$subpkgdir"/usr/bin/findssl.sh || return 1
	install -Dm755 "$_builddir"/contrib/ssh-copy-id \
		"$subpkgdir"/usr/bin/ssh-copy-id || return 1
}

keysign() {
	pkgdesc="ssh helper program for host-based authentication"
	depends="openssh-client"
	install -d "$subpkgdir"/usr/lib/ssh || return 1
	mv "$pkgdir"/usr/lib/ssh/ssh-keysign \
		"$subpkgdir"/usr/lib/ssh/ || return 1
}

sftp() {
	pkgdesc="ssh sftp server module"
	depends=""
	install -d "$subpkgdir"/usr/lib/ssh || return 1
	mv "$pkgdir"/usr/lib/ssh/sftp-server \
		"$subpkgdir"/usr/lib/ssh/ || return 1
}

md5sums="8709736bc8a8c253bc4eeb4829888ca5  openssh-7.1p1.tar.gz
cd52fe99cb4b7d0d847bf5d710d93564  openssh6.5-peaktput.diff
c17db9b1c9ee354ed66328e3e2b13e98  openssh7.1-dynwindows.diff
37fbfe9cfb9a5e2454382ea8c79ed2e1  openssh-fix-utmp.diff
8a2b8457148c29d9bf90955f6c142269  bsd-compatible-realpath.patch
8590e08286f47a777725655873dd318f  sshd.initd
b35e9f3829f4cfca07168fcba98749c7  sshd.confd
2dd7e366607e95f9762273067309fd6e  openssh-sftp-interactive.diff"
sha256sums="fc0a6d2d1d063d5c66dffd952493d0cda256cad204f681de0f84ef85b2ad8428  openssh-7.1p1.tar.gz
bf49212e47a86d10650f739532cea514a310925e6445b4f8011031b6b55f3249  openssh6.5-peaktput.diff
cdfb88c155a8472e26bf1a116979ecda65b3b7aafc953158302b61a55eba1ebd  openssh7.1-dynwindows.diff
1c85437fd94aa4fc269e6297e4eb790baa98c39949ec0410792c09ee31ba9782  openssh-fix-utmp.diff
d17751be027684424a72d0d9fe2561a70a72396d75f30248688422687fa5b730  bsd-compatible-realpath.patch
c31a116bba900c6c4795b061766169e6455d6e1b7cf9aa2ee5ba4eaa1afa76b0  sshd.initd
29c6d57ac3ec6018cadc6ba6cd9b90c9ed46e20049b970fdcc68ee2481a2ee41  sshd.confd
4ce1ad5f767c0f4e854a0cfeef0e2e400f333c649e552df1ecc317e6a6557376  openssh-sftp-interactive.diff"
sha512sums="f1491ca5a0a733eb27ede966590642a412cb7be7178dcb7b9e5844bbdc8383032f4b00435192b95fc0365b6fe74d6c5ac8d6facbe9d51e1532d049e2f784e8f7  openssh-7.1p1.tar.gz
e041398e177674f698480e23be037160bd07b751c754956a3ddf1b964da24c85e826fb75e7c23c9826d36761da73d08db9583c047d58a08dc7b2149a949075b1  openssh6.5-peaktput.diff
390214cecb1ffd9eaa10e1d74b353739dcb710c0c180077e7e3fa35f6f9bf0c38be7d0bea58b0d108de1ec37bf8cac721e5564cea387a0d3e3c58b125bbe9241  openssh7.1-dynwindows.diff
f35fffcd26635249ce5d820e7b3e406e586f2d2d7f6a045f221e2f9fb53aebc1ab1dd1e603b3389462296ed77921a1d08456e7aaa3825cbed08f405b381a58e1  openssh-fix-utmp.diff
4e551e341e3237cda1bfaf00e770a8b98a2e5ac72238ef305f793279d046c26649b44388b792f79bfc0814468099aa040216407ea9244dfe31ce87d33475b642  bsd-compatible-realpath.patch
7e4378daebd8f5df0cd2f0709af806a0d4a78c948b8fc3baaf3585e5f5ec5d0793f7e4d0a450bc43bbcb92daa09bfab482cbceb396b993c0545adfe56573cd44  sshd.initd
b9ae816af54a55e134a9307e376f05367b815f1b3fd545c2a2c312d18aedcf907f413e8bad8db980cdd9aad4011a72a79e1e94594f69500939a9cb46287f2f81  sshd.confd
c1d09c65dbc347f0904edc30f91aa9a24b0baee50309536182455b544f1e3f85a8cecfa959e32be8b101d8282ef06dde3febbbc3f315489339dcf04155c859a9  openssh-sftp-interactive.diff"