Noux: add noux-pkg/openssh

This commit is contained in:
Josef Söntgen 2012-10-04 12:18:15 +02:00 committed by Norman Feske
parent 5c413929ef
commit 46597d3b17
5 changed files with 134 additions and 0 deletions

22
ports/ports/openssh.mk Normal file
View File

@ -0,0 +1,22 @@
OPENSSH = openssh-6.1p1
OPENSSH_TGZ = $(OPENSSH).tar.gz
OPENSSH_URL = ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$(OPENSSH).tar.gz
#
# Interface to top-level prepare Makefile
#
PORTS += $(OPENSSH)
prepare:: $(CONTRIB_DIR)/$(OPENSSH)
#
# Port-specific local rules
#
$(DOWNLOAD_DIR)/$(OPENSSH_TGZ):
$(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(OPENSSH_URL) && touch $@
$(CONTRIB_DIR)/$(OPENSSH): $(DOWNLOAD_DIR)/$(OPENSSH_TGZ)
$(VERBOSE)tar xfz $< -C $(CONTRIB_DIR) && touch $@
$(VERBOSE)patch -d contrib/ -N -p0 < src/noux-pkg/openssh/monitor_fdpass.c.patch
$(VERBOSE)patch -d contrib/ -N -p0 < src/noux-pkg/openssh/sshconnect.h.patch
$(VERBOSE)patch -d contrib/ -N -p0 < src/noux-pkg/openssh/includes_h.patch

View File

@ -0,0 +1,12 @@
--- openssh-6.1p1/includes.h.orig 2012-11-14 16:18:25.970072293 +0100
+++ openssh-6.1p1/includes.h 2012-11-14 16:18:48.860209365 +0100
@@ -18,7 +18,8 @@
#include "config.h"
-#define _GNU_SOURCE /* activate extra prototypes for glibc */
+/* already defined by noux.mk */
+//#define _GNU_SOURCE /* activate extra prototypes for glibc */
#include <sys/types.h>
#include <sys/socket.h> /* For CMSG_* */

View File

@ -0,0 +1,16 @@
We do not have poll.h and since struct pollfd etc. pp is defined in
sys/poll.h we use it instead.
--- openssh-6.1p1/monitor_fdpass.c.orig
+++ openssh-6.1p1/monitor_fdpass.c
@@ -36,6 +36,10 @@
#include <errno.h>
#ifdef HAVE_POLL_H
#include <poll.h>
+#else
+# ifdef HAVE_SYS_POLL_H
+# include <sys/poll.h>
+# endif
#endif
#include <string.h>
#include <stdarg.h>

View File

@ -0,0 +1,20 @@
set*uid() is not implemented but it does not matter anyway because there
is only one user per noux instance.
--- openssh-6.1p1/sshconnect.h.orig
+++ openssh-6.1p1/sshconnect.h
@@ -55,6 +55,7 @@ void ssh_userauth2(const char *, const char *, char *, Sensitive *);
void ssh_put_password(char *);
int ssh_local_cmd(const char *);
+#if 0
/*
* Macros to raise/lower permissions.
*/
@@ -73,3 +74,6 @@ int ssh_local_cmd(const char *);
strerror(errno)); \
errno = save_errno; \
} while (0)
+#endif
+#define PRIV_START
+#define PRIV_END

View File

@ -0,0 +1,64 @@
TARGET = openssh
#
# This prefix 'magic' is needed because OpenSSH uses $exec_prefix
# while compiling (e.g. -DSSH_PATH) and in the end the $prefix and
# $exec_prefix path differ.
#
NOUX_CONFIGURE_ARGS += --disable-ip6 \
--with-md5-passwords \
--without-zlib-version-check \
--with-ssl-engine \
--disable-finger \
--disable-gopher \
--disable-news \
--disable-ftp \
--disable-rpath-hack \
--disable-utmpx \
--disable-strip \
--exec-prefix= \
--bindir=/bin \
--sbindir=/bin \
--libexecdir=/bin
LIBS += libcrypto libssl zlib libc_resolv
noux_built.tag: Makefile Makefile_patch
Makefile_patch: Makefile
@#
@# Our $(LDFLAGS) contain options which are usable by gcc(1)
@# only. So instead of using ld(1) to link the binary, we have
@# to use gcc(1).
@#
$(VERBOSE)sed -i 's|^LD=.*|LD=$(CC)|' Makefile
@#
@# We do not want to generate host-keys because we are crosscompiling
@# and we can not run Genode binaries on the build system.
@#
$(VERBOSE)sed -i 's|^install:.*||' Makefile
$(VERBOSE)sed -i 's|^install-nokeys:|install:|' Makefile
@#
@# The path of ssh(1) is hardcoded to $(bindir)/ssh which in our
@# case is insufficient.
@#
$(VERBOSE)sed -i 's|^SSH_PROGRAM=.*|SSH_PROGRAM=/bin/ssh|' Makefile
#
# Make the zlib linking test succeed
#
Makefile: dummy_libs
NOUX_LDFLAGS += -L$(PWD)
dummy_libs: libz.a libcrypto.a libssl.a
libcrypto.a:
$(VERBOSE)$(AR) -rc $@
libssl.a:
$(VERBOSE)$(AR) -rc $@
libz.a:
$(VERBOSE)$(AR) -rc $@
include $(REP_DIR)/mk/noux.mk