--- /dev/null
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=screen
+PKG_VERSION:=4.2.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/screen
+PKG_MD5SUM:=419a0594e2b25039239af8b90eda7d92
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/screen
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=+libncurses
+ TITLE:=Full-screen terminal window manager
+ URL:=http://www.gnu.org/software/screen/
+endef
+
+define Package/screen/description
+ Screen is a full-screen window manager that multiplexes a physical
+ terminal between several processes, typically interactive shells.
+endef
+
+define Build/Configure
+ $(call Build/Configure/Default,\
+ --with-sys-screenrc=/etc/screenrc \
+ )
+ # XXX: memmove() works well with overlapped memory areas
+ echo "#define USEMEMMOVE 1" >>$(PKG_BUILD_DIR)/config.h
+endef
+
+define Package/screen/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/screen $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DATA) ./files/etc/screenrc $(1)/etc/screenrc
+endef
+
+define Package/screen/conffiles
+/etc/screenrc
+endef
+
+$(eval $(call BuildPackage,screen))
--- /dev/null
+startup_message off
--- /dev/null
+--- a/configure
++++ b/configure
+@@ -414,7 +414,7 @@ as_fn_error ()
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+- as_fn_exit $as_status
++ # as_fn_exit $as_status
+ } # as_fn_error
+
+ if expr a : '\(a\)' >/dev/null 2>&1 &&
+@@ -5941,8 +5941,6 @@ else
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
+-test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lsun"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking IRIX sun library..." >&5
+@@ -7023,7 +7021,7 @@ as_fn_error ()
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+- as_fn_exit $as_status
++ # as_fn_exit $as_status
+ } # as_fn_error
+
+
+--- a/pty.c
++++ b/pty.c
+@@ -39,9 +39,9 @@
+ #endif
+
+ /* for solaris 2.1, Unixware (SVR4.2) and possibly others */
+-#ifdef HAVE_STROPTS_H
+-# include <sys/stropts.h>
+-#endif
++//#ifdef HAVE_STROPTS_H
++//# include <sys/stropts.h>
++//#endif
+
+ #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
+ # include <sys/ttold.h>
+--- a/sched.h
++++ b/sched.h
+@@ -27,6 +27,11 @@
+ * $Id$ GNU
+ */
+
++#ifndef __SCHED_H
++#define __SCHED_H
++
++#include <sys/time.h>
++
+ struct event
+ {
+ struct event *next;
+@@ -46,3 +51,5 @@ struct event
+ #define EV_READ 1
+ #define EV_WRITE 2
+ #define EV_ALWAYS 3
++
++#endif
--- /dev/null
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -79,7 +79,7 @@ screen: $(OFILES)
+ $(CC) $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
+
+ .c.o:
+- $(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(CPPFLAGS) $(DEFS) \
++ $(CC) -c $(M_CFLAGS) $(CPPFLAGS) $(DEFS) \
+ $(OPTIONS) $(CFLAGS) $<
+
+ install_bin: .version screen