diff options
author | Timo Teräs <timo.teras@iki.fi> | 2016-07-18 10:57:33 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2016-07-18 11:00:27 +0000 |
commit | 756f181a56f8c7d4445ba4aacec5354e3bf9e051 (patch) | |
tree | e2d9b8f8c1f95c8eb4d7bfff9011dc602bd0a872 /main/openssh | |
parent | 267b90c0703c128548dc22f6f116becdeee693c3 (diff) | |
download | aports-756f181a56f8c7d4445ba4aacec5354e3bf9e051.tar.bz2 aports-756f181a56f8c7d4445ba4aacec5354e3bf9e051.tar.xz |
main/openssh: support cross building and use default_prepare
Diffstat (limited to 'main/openssh')
-rw-r--r-- | main/openssh/APKBUILD | 38 | ||||
-rw-r--r-- | main/openssh/bsd-compatible-realpath.patch | 56 |
2 files changed, 50 insertions, 44 deletions
diff --git a/main/openssh/APKBUILD b/main/openssh/APKBUILD index 1db8ad1bd4..93977fbe77 100644 --- a/main/openssh/APKBUILD +++ b/main/openssh/APKBUILD @@ -10,7 +10,9 @@ arch="all" license="as-is" options="suid" depends="openssh-client openssh-sftp-server" -makedepends="openssl-dev zlib-dev linux-headers" +makedepends_build="" +makedepends_host="openssl-dev zlib-dev linux-headers" +makedepends="$makedepends_build $makedepends_host" subpackages="$pkgname-doc $pkgname-client $pkgname-keysign $pkgname-sftp-server:sftp" source="http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$_myver.tar.gz @@ -24,27 +26,17 @@ source="http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$_myver.tar " # HPN patches are from: http://www.psc.edu/index.php/hpn-ssh -_builddir="$srcdir"/$pkgname-$_myver +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 + cd "$builddir" + default_prepare sed -i -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \ pathnames.h || return 1 } build() { - cd "$_builddir" + cd "$builddir" + export LD="$CC" ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -69,14 +61,14 @@ build() { } package() { - cd "$_builddir" + 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 \ + 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 } @@ -95,9 +87,9 @@ client() { mv "$pkgdir"/etc/ssh/ssh_config \ "$pkgdir"/etc/ssh/moduli \ "$subpkgdir"/etc/ssh/ || return 1 - install -Dm755 "$_builddir"/contrib/findssl.sh \ + install -Dm755 "$builddir"/contrib/findssl.sh \ "$subpkgdir"/usr/bin/findssl.sh || return 1 - install -Dm755 "$_builddir"/contrib/ssh-copy-id \ + install -Dm755 "$builddir"/contrib/ssh-copy-id \ "$subpkgdir"/usr/bin/ssh-copy-id || return 1 } @@ -121,7 +113,7 @@ md5sums="13009a9156510d8f27e752659075cced openssh-7.2p2.tar.gz cd52fe99cb4b7d0d847bf5d710d93564 openssh6.5-peaktput.diff 6337ad8a38783c8f1285cf4f97fc451f openssh7.1-dynwindows.diff 37fbfe9cfb9a5e2454382ea8c79ed2e1 openssh-fix-utmp.diff -177e3fc8239080bbba5617b373d10e73 bsd-compatible-realpath.patch +e21243d6ddff1bb929eed3676b4b9a2a bsd-compatible-realpath.patch 8590e08286f47a777725655873dd318f sshd.initd b35e9f3829f4cfca07168fcba98749c7 sshd.confd 2dd7e366607e95f9762273067309fd6e openssh-sftp-interactive.diff" @@ -129,7 +121,7 @@ sha256sums="a72781d1a043876a224ff1b0032daa4094d87565a68528759c1c2cab5482548c op bf49212e47a86d10650f739532cea514a310925e6445b4f8011031b6b55f3249 openssh6.5-peaktput.diff 861132af07c18f5e0ac7b64f389a929e61a051887bf44bda770a97e3afd9bfb6 openssh7.1-dynwindows.diff 1c85437fd94aa4fc269e6297e4eb790baa98c39949ec0410792c09ee31ba9782 openssh-fix-utmp.diff -75930926f8381883c63d6de7a1f4ed63c2eedd1b682d4e9da8c760ac9242e1c6 bsd-compatible-realpath.patch +a843cacd7002a68e9d09b5d8ea1466c9980fa35fa3ccd8d9357ac793017de2a6 bsd-compatible-realpath.patch c31a116bba900c6c4795b061766169e6455d6e1b7cf9aa2ee5ba4eaa1afa76b0 sshd.initd 29c6d57ac3ec6018cadc6ba6cd9b90c9ed46e20049b970fdcc68ee2481a2ee41 sshd.confd 4ce1ad5f767c0f4e854a0cfeef0e2e400f333c649e552df1ecc317e6a6557376 openssh-sftp-interactive.diff" @@ -137,7 +129,7 @@ sha512sums="44f62b3a7bc50a0735d496a5aedeefb71550d8c10ad8f22b94e29fcc8084842db96e e041398e177674f698480e23be037160bd07b751c754956a3ddf1b964da24c85e826fb75e7c23c9826d36761da73d08db9583c047d58a08dc7b2149a949075b1 openssh6.5-peaktput.diff 72a7dc21d18388c635d14dda762ac50caeefd38f0153d8ea36d18e9d7c982e104f7b7a3af8c18fd479c31201fbdee1639f3a1ec60d035d4ca8721a8563fa11a0 openssh7.1-dynwindows.diff f35fffcd26635249ce5d820e7b3e406e586f2d2d7f6a045f221e2f9fb53aebc1ab1dd1e603b3389462296ed77921a1d08456e7aaa3825cbed08f405b381a58e1 openssh-fix-utmp.diff -0f5299c8ac921a3e75934bd6145c35f9151c33f9dd4bf3067412c7bf3c8b8f5668edf9d0a8bfac3f9eaa0a3a0819e9292742d131aab1185cac2b358b4e89fec2 bsd-compatible-realpath.patch +f2b8daa537ea3f32754a4485492cc6eb3f40133ed46c0a5a29a89e4bcf8583d82d891d94bf2e5eb1c916fa68ec094abf4e6cd641e9737a6c05053808012b3a73 bsd-compatible-realpath.patch 7e4378daebd8f5df0cd2f0709af806a0d4a78c948b8fc3baaf3585e5f5ec5d0793f7e4d0a450bc43bbcb92daa09bfab482cbceb396b993c0545adfe56573cd44 sshd.initd b9ae816af54a55e134a9307e376f05367b815f1b3fd545c2a2c312d18aedcf907f413e8bad8db980cdd9aad4011a72a79e1e94594f69500939a9cb46287f2f81 sshd.confd c1d09c65dbc347f0904edc30f91aa9a24b0baee50309536182455b544f1e3f85a8cecfa959e32be8b101d8282ef06dde3febbbc3f315489339dcf04155c859a9 openssh-sftp-interactive.diff" diff --git a/main/openssh/bsd-compatible-realpath.patch b/main/openssh/bsd-compatible-realpath.patch index e3ed33ff7e..1cdb4f7c5d 100644 --- a/main/openssh/bsd-compatible-realpath.patch +++ b/main/openssh/bsd-compatible-realpath.patch @@ -1,30 +1,45 @@ fix issues with fortify-headers and the way openssh handles the needed -BSD compatible realpath(3) +BSD compatible realpath(3). -diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h -index 1ff7114..e552a10 100644 ---- a/openbsd-compat/openbsd-compat.h -+++ b/openbsd-compat/openbsd-compat.h -@@ -70,12 +70,8 @@ void *reallocarray(void *, size_t, size_t); +unconditionally use the provided realpath() as otherwise cross-builds +would try to use musl realpath() which is posix compliant and not +working to openssh expectations. + +diff -ru openssh-7.2p2.orig/openbsd-compat/openbsd-compat.h openssh-7.2p2/openbsd-compat/openbsd-compat.h +--- openssh-7.2p2.orig/openbsd-compat/openbsd-compat.h 2016-03-09 20:04:48.000000000 +0200 ++++ openssh-7.2p2/openbsd-compat/openbsd-compat.h 2016-07-18 13:33:16.260357745 +0300 +@@ -68,17 +68,7 @@ + void *reallocarray(void *, size_t, size_t); #endif - #if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) +-#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) -/* - * glibc's FORTIFY_SOURCE can redefine this and prevent us picking up the - * compat version. - */ -# ifdef BROKEN_REALPATH -# define realpath(x, y) _ssh_compat_realpath(x, y) -+# if !defined(BROKEN_REALPATH) -+# define ssh_realpath(x, y) realpath(x, y) - # endif +-# endif +- +-char *realpath(const char *path, char *resolved); +-#endif ++char *ssh_realpath(const char *path, char *resolved); + + #ifndef HAVE_RRESVPORT_AF + int rresvport_af(int *alport, sa_family_t af); +diff -ru openssh-7.2p2.orig/openbsd-compat/realpath.c openssh-7.2p2/openbsd-compat/realpath.c +--- openssh-7.2p2.orig/openbsd-compat/realpath.c 2016-03-09 20:04:48.000000000 +0200 ++++ openssh-7.2p2/openbsd-compat/realpath.c 2016-07-18 13:33:45.420721690 +0300 +@@ -31,7 +31,7 @@ + + #include "includes.h" + +-#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) ++#if 1 - char *realpath(const char *path, char *resolved); -diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c -index ba4cea9..1e67ebc 100644 ---- a/openbsd-compat/realpath.c -+++ b/openbsd-compat/realpath.c -@@ -51,7 +51,7 @@ + #include <sys/types.h> + #include <sys/param.h> +@@ -58,7 +58,7 @@ * in which case the path which caused trouble is left in (resolved). */ char * @@ -33,11 +48,10 @@ index ba4cea9..1e67ebc 100644 { struct stat sb; char *p, *q, *s; -diff --git a/sftp-server.c b/sftp-server.c -index eac11d7..ac51ca3 100644 ---- a/sftp-server.c -+++ b/sftp-server.c -@@ -1162,7 +1162,7 @@ process_realpath(u_int32_t id) +diff -ru openssh-7.2p2.orig/sftp-server.c openssh-7.2p2/sftp-server.c +--- openssh-7.2p2.orig/sftp-server.c 2016-03-09 20:04:48.000000000 +0200 ++++ openssh-7.2p2/sftp-server.c 2016-07-18 13:34:29.131267241 +0300 +@@ -1162,7 +1162,7 @@ } debug3("request %u: realpath", id); verbose("realpath \"%s\"", path); |