--- erlang-10.b.9.orig/lib/asn1/c_src/Makefile.in
+++ erlang-10.b.9/lib/asn1/c_src/Makefile.in
@@ -74,7 +74,7 @@
 EI_INCLUDES = -I$(ERL_TOP)/lib/erl_interface/include
 DRIVER_INCLUDES = -I$(ERL_TOP)/erts/emulator/beam \
 	-I$(ERL_TOP)/erts/emulator/sys/$(ERLANG_OSTYPE)
-CFLAGS = $(DRIVER_INCLUDES) $(EI_INCLUDES) @DED_CFLAGS@
+CFLAGS = -fPIC $(DRIVER_INCLUDES) $(EI_INCLUDES) @DED_CFLAGS@
 LDFLAGS = @DED_LDFLAGS@
 
 LD_INCL_EI = -L$(EI_LIBDIR)
--- erlang-10.b.9.orig/lib/erl_interface/src/Makefile.in
+++ erlang-10.b.9/lib/erl_interface/src/Makefile.in
@@ -97,7 +97,7 @@
 ifneq ($(findstring ose,$(TARGET)),ose)
 CFLAGS = @DED_CFLAGS@ $(WARNFLAGS) $(INCFLAGS) $(TYPE_FLAGS)
 else
-CFLAGS = @CFLAGS@ $(INCFLAGS)
+CFLAGS = -fPIC @CFLAGS@ $(INCFLAGS)
 endif
 PROG_CFLAGS = @CFLAGS@ $(WARNFLAGS) $(INCFLAGS) $(TYPE_FLAGS) -Ilegacy
 
--- erlang-10.b.9.orig/lib/ic/c_src/Makefile.in
+++ erlang-10.b.9/lib/ic/c_src/Makefile.in
@@ -110,7 +110,7 @@
 
 OBJ_FILES= $(C_FILES:%.c=$(OBJDIR)/%.o) 
 
-ALL_CFLAGS = @CFLAGS@ @DEFS@ -I$(INCDIR) $(ERL_INTERFACE_FLAGS) $(CFLAGS) 
+ALL_CFLAGS = -fPIC @CFLAGS@ @DEFS@ -I$(INCDIR) $(ERL_INTERFACE_FLAGS) $(CFLAGS) 
 
 # ----------------------------------------------------
 # Targets
--- erlang-10.b.9.orig/lib/megaco/src/flex/Makefile.in
+++ erlang-10.b.9/lib/megaco/src/flex/Makefile.in
@@ -154,7 +154,7 @@
 LEX_FLAGS = -d
 endif
 
-CFLAGS += $(DRIVER_INCLUDES) $(DRV_FLAGS) -funroll-loops -Wall 
+CFLAGS += -fPIC $(DRIVER_INCLUDES) $(DRV_FLAGS) -funroll-loops -Wall 
 
 ifeq ($(ENABLE_MEGACO_FLEX_SCANNER_LINENO),true)
 LEX_FLAGS += -Ca
--- erlang-10.b.9.orig/lib/odbc/c_src/Makefile.in
+++ erlang-10.b.9/lib/odbc/c_src/Makefile.in
@@ -77,7 +77,7 @@
 # FLAGS
 # ----------------------------------------------------
 CC =  @CC@
-CFLAGS = $(TYPEFLAGS) @CFLAGS@
+CFLAGS = -fPIC $(TYPEFLAGS) @CFLAGS@
 EI_LDFLAGS = -L$(EI_ROOT)/obj$(TYPEMARKER)/$(TARGET)
 LD = @DED_LD@
 LDFLAGS =  $(ODBC_LIB) $(EI_LDFLAGS)
--- erlang-10.b.9.orig/lib/orber/c_src/Makefile.in
+++ erlang-10.b.9/lib/orber/c_src/Makefile.in
@@ -64,7 +64,7 @@
 TARGET_FILES= $(PROGRAMS:%=$(BINDIR)/%)
 OBJ_FILES= $(C_FILES:%.c=$(OBJDIR)/%.o) 
 
-ALL_CFLAGS = @CFLAGS@ @DEFS@ $(CFLAGS) 
+ALL_CFLAGS = -fPIC @CFLAGS@ @DEFS@ $(CFLAGS) 
 
 # ----------------------------------------------------
 # Targets
--- erlang-10.b.9.orig/lib/os_mon/c_src/Makefile.in
+++ erlang-10.b.9/lib/os_mon/c_src/Makefile.in
@@ -72,7 +72,7 @@
 
 TARGET_FILES= $(PROGRAMS:%=$(BINDIR)/%)
 
-ALL_CFLAGS = @CFLAGS@ @DEFS@ $(CFLAGS)
+ALL_CFLAGS = -fPIC @CFLAGS@ @DEFS@ $(CFLAGS)
 
 # ----------------------------------------------------
 # Targets
--- erlang-10.b.9.orig/lib/ssl/c_src/Makefile.in
+++ erlang-10.b.9/lib/ssl/c_src/Makefile.in
@@ -44,7 +44,7 @@
 # Includes and libs
 # ----------------------------------------------------
 
-ALL_CFLAGS = @WFLAGS@ @CFLAGS@ @DEFS@ $(TYPE_FLAGS)
+ALL_CFLAGS = -fPIC @WFLAGS@ @CFLAGS@ @DEFS@ $(TYPE_FLAGS)
 TARGET = @host@
 
 ifeq ($(TYPE),debug)
@@ -104,9 +104,11 @@
 CC_R_FLAG =
 else
 ifeq ($(findstring osf,$(TARGET)),osf)		# osf1: -Wl,-rpath,
-CC_R_FLAG = -Wl,-rpath,
+#CC_R_FLAG = -Wl,-rpath,
+CC_R_FLAG =
 else						# Default: -Wl,-R
-CC_R_FLAG = -Wl,-R
+#CC_R_FLAG = -Wl,-R
+CC_R_FLAGS =
 endif
 endif
 
--- erlang-10.b.9.orig/lib/stdlib/src/supervisor.erl
+++ erlang-10.b.9/lib/stdlib/src/supervisor.erl
@@ -32,10 +32,12 @@
 -export([init/1, handle_call/3, handle_info/2, terminate/2, code_change/3]).
 -export([handle_cast/2]).
 
+-define(DICT, dict).
+
 -record(state, {name,
 		strategy,
 		children = [],
-		dynamics = [],
+		dynamics = ?DICT:new(),
 		intensity,
 		period,
 		restarts = [],
@@ -218,11 +220,11 @@
     case do_start_child_i(M, F, Args) of
 	{ok, Pid} ->
 	    NState = State#state{dynamics = 
-				 [{Pid, Args}|State#state.dynamics]},
+				 ?DICT:store(Pid, Args, State#state.dynamics)},
 	    {reply, {ok, Pid}, NState};
 	{ok, Pid, Extra} ->
 	    NState = State#state{dynamics = 
-				 [{Pid, Args}|State#state.dynamics]},
+				 ?DICT:store(Pid, Args, State#state.dynamics)},
 	    {reply, {ok, Pid, Extra}, NState};
 	What ->
 	    {reply, What, State}
@@ -284,7 +286,7 @@
 handle_call(which_children, _From, State) when ?is_simple(State) ->
     [#child{child_type = CT, modules = Mods}] = State#state.children,
     Reply = lists:map(fun({Pid, _}) -> {undefined, Pid, CT, Mods} end,
-		      State#state.dynamics),
+		      ?DICT:to_list(State#state.dynamics)),
     {reply, Reply, State};
 
 handle_call(which_children, _From, State) ->
@@ -439,14 +441,14 @@
 %%% ---------------------------------------------------
 
 restart_child(Pid, Reason, State) when ?is_simple(State) ->
-    case lists:keysearch(Pid, 1, State#state.dynamics) of
-	{value, {_Pid, Args}} ->
+    case ?DICT:find(Pid, State#state.dynamics) of
+	{ok, Args} ->
 	    [Child] = State#state.children,
 	    RestartType = Child#child.restart_type,
 	    {M, F, _} = Child#child.mfa,
 	    NChild = Child#child{pid = Pid, mfa = {M, F, Args}},
 	    do_restart(RestartType, Reason, NChild, State);
-	_ ->
+	error ->
 	    {ok, State}
     end;
 restart_child(Pid, Reason, State) ->
@@ -488,13 +490,13 @@
 
 restart(simple_one_for_one, Child, State) ->
     #child{mfa = {M, F, A}} = Child,
-    Dynamics = lists:keydelete(Child#child.pid,1,State#state.dynamics),
+    Dynamics = ?DICT:erase(Child#child.pid, State#state.dynamics),
     case do_start_child_i(M, F, A) of
 	{ok, Pid} ->
-	    NState = State#state{dynamics = [{Pid, A} | Dynamics]},
+	    NState = State#state{dynamics = ?DICT:store(Pid, A, Dynamics)},
 	    {ok, NState};
 	{ok, Pid, _Extra} ->
-	    NState = State#state{dynamics = [{Pid, A} | Dynamics]},
+	    NState = State#state{dynamics = ?DICT:store(Pid, A, Dynamics)},
 	    {ok, NState};
 	{error, Error} ->
 	    report_error(start_error, Error, Child, State#state.name),
@@ -638,7 +640,7 @@
 %% Child/State manipulating functions.
 %%-----------------------------------------------------------------
 state_del_child(#child{pid = Pid}, State) when ?is_simple(State) ->
-    NDynamics = lists:keydelete(Pid, 1, State#state.dynamics),
+    NDynamics = ?DICT:erase(Pid, State#state.dynamics),
     State#state{dynamics = NDynamics};
 state_del_child(Child, State) ->
     NChildren = del_child(Child#child.name, State#state.children),
--- erlang-10.b.9.orig/erts/acconfig.h
+++ erlang-10.b.9/erts/acconfig.h
@@ -188,6 +188,9 @@
 /* Define if you have the <linux/kpoll.h> header file. */
 #undef HAVE_LINUX_KPOLL_H
  
+/* Define if you have the <linux/epoll.h> header file. */
+#undef HAVE_LINUX_EPOLL_H
+
 /* Define if you have the <sys/event.h> header file. */
 #undef HAVE_SYS_EVENT_H
 
@@ -224,7 +227,7 @@
 
 #if !defined(USE_SELECT)
 #  if defined(ENABLE_KERNEL_POLL)
-#    if defined(HAVE_SYS_DEVPOLL_H) || defined(HAVE_LINUX_KPOLL_H) || defined(HAVE_SYS_EVENT_H)
+#    if defined(HAVE_SYS_DEVPOLL_H) || defined(HAVE_LINUX_KPOLL_H) || defined(HAVE_SYS_EVENT_H) || defined(HAVE_LINUX_EPOLL_H)
 #      define USE_KERNEL_POLL
 #    endif
 #  endif
--- erlang-10.b.9.orig/erts/configure.in
+++ erlang-10.b.9/erts/configure.in
@@ -651,6 +651,7 @@
 AC_CHECK_HEADER(sys/devpoll.h, AC_DEFINE(HAVE_SYS_DEVPOLL_H))
 AC_CHECK_HEADER(linux/kpoll.h, AC_DEFINE(HAVE_LINUX_KPOLL_H))
 AC_CHECK_HEADER(sys/event.h, AC_DEFINE(HAVE_SYS_EVENT_H)) 
+AC_CHECK_HEADER(sys/epoll.h, AC_DEFINE(HAVE_LINUX_EPOLL_H))
 
 LM_DECL_SO_BSDCOMPAT
 LM_DECL_INADDR_LOOPBACK
--- erlang-10.b.9.orig/erts/emulator/Makefile.in
+++ erlang-10.b.9/erts/emulator/Makefile.in
@@ -31,7 +31,7 @@
 PURIFY =
 TYPEMARKER = .debug
 THR_LIB_SFX = .debug
-TYPE_FLAGS = @DEBUG_CFLAGS@ -DDEBUG
+TYPE_FLAGS = @DEBUG_CFLAGS@ -fPIC -DDEBUG
 ENABLE_ALLOC_TYPE_VARS += debug
 ifeq ($(TARGET),win32)
 TYPE_FLAGS += -DNO_JUMP_TABLE
@@ -41,20 +41,20 @@
 ifeq ($(TYPE),shared)
 PURIFY =
 TYPEMARKER = .shared
-TYPE_FLAGS = @CFLAGS@ -DSHARED_HEAP
+TYPE_FLAGS = @CFLAGS@ -fPIC -DSHARED_HEAP
 ENABLE_ALLOC_TYPE_VARS += shared_heap
 else
 ifeq ($(TYPE),hybrid)
 PURIFY =
 TYPEMARKER = .hybrid
-TYPE_FLAGS = @CFLAGS@ -DHYBRID
+TYPE_FLAGS = @CFLAGS@ -fPIC -DHYBRID
 ENABLE_ALLOC_TYPE_VARS += hybrid
 else
 ifeq ($(TYPE),purify)
 PURIFY = purify $(PURIFY_BUILD_OPTIONS)
 TYPEMARKER = .purify
 THR_LIB_SFX = .purify
-TYPE_FLAGS = @CFLAGS@ -DPURIFY -DNO_JUMP_TABLE -DERTS_MSEG_FAKE_SEGMENTS
+TYPE_FLAGS = @CFLAGS@ -fPIC -DPURIFY -DNO_JUMP_TABLE -DERTS_MSEG_FAKE_SEGMENTS
 ENABLE_ALLOC_TYPE_VARS += purify
 else
 ifeq ($(TYPE),quantify)
@@ -63,22 +63,22 @@
 THR_LIB_SFX = .quantify
 ENABLE_ALLOC_TYPE_VARS += quantify
 ifeq ($(findstring ose,$(TARGET)),ose)
-  TYPE_FLAGS = @CFLAGS@ -DQUANTIFY
+  TYPE_FLAGS = @CFLAGS@ -fPIC -DQUANTIFY
 else
-  TYPE_FLAGS = @CFLAGS@ -g -O2 -DQUANTIFY -DNO_JUMP_TABLE
+  TYPE_FLAGS = @CFLAGS@ -fPIC -g -O2 -DQUANTIFY -DNO_JUMP_TABLE
 endif
 else
 ifeq ($(TYPE),purecov)
 PURIFY = purecov --follow-child-processes=yes $(PURECOV_BUILD_OPTIONS)
 TYPEMARKER = .purecov
 THR_LIB_SFX = .purecov
-TYPE_FLAGS = @DEBUG_CFLAGS@ -DPURECOV -DNO_JUMP_TABLE
+TYPE_FLAGS = @DEBUG_CFLAGS@ -fPIC -DPURECOV -DNO_JUMP_TABLE
 ENABLE_ALLOC_TYPE_VARS += purecov
 else
 TYPE=opt
 PURIFY =
 TYPEMARKER =
-TYPE_FLAGS = @CFLAGS@
+TYPE_FLAGS = @CFLAGS@ -fPIC 
 endif
 endif
 endif
@@ -94,7 +94,7 @@
 OPSYSCFLAGS=$($(OPSYS)CFLAGS)
 ARCH=@ARCH@
 ultrasparcCFLAGS=-Wa,-xarch=v8plusa
-ARCHCFLAGS=$($(ARCH)CFLAGS)
+ARCHCFLAGS=$($(ARCH)CFLAGS) -fPIC
 
 ifdef HIPE_ENABLED
 ifeq ($(OPSYS),linux)
@@ -129,7 +129,7 @@
 PERL    = @PERL@
 
 ifeq ($(CC), gcc)
-GEN_OPT_FLGS = -O3 -fomit-frame-pointer
+GEN_OPT_FLGS = -O2 -fomit-frame-pointer
 UNROLL_FLG = -funroll-loops
 else
 ifeq ($(TARGET), win32)
--- erlang-10.b.9.orig/erts/emulator/sys/unix/sys.c
+++ erlang-10.b.9/erts/emulator/sys/unix/sys.c
@@ -13,6 +13,12 @@
  * Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
  * AB. All Rights Reserved.''
  * 
+ * 2005-08-31
+ * This has been modified by Matthew Reilly of SIPphone Inc. to 
+ * enable kernel poll (+K true) support via the epoll mechanism in Linux 2.6
+ * Portions created by SIPphone Inc. are Copyright 2005, SIPphone Inc.
+ * These modifications are released under the Erlang Public License.
+ *
  *     $Id$
  */
 
@@ -50,6 +56,9 @@
 #      define USE_DEVPOLL
 #      include <sys/devpoll.h>
 #    endif
+#    ifdef HAVE_LINUX_EPOLL_H /* Too minimize code changes, we pretend we have HAVE_LINUX_KPOLL_H as well */
+#      define HAVE_LINUX_KPOLL_H 1
+#    endif
 #    ifdef HAVE_LINUX_KPOLL_H
 #      define USE_DEVPOLL
 #      include <asm/page.h>
@@ -58,7 +67,11 @@
 #      ifndef POLLREMOVE
 #        define POLLREMOVE 0x1000 /* some day it will make it to bits/poll.h ;-) */
 #      endif
-#      include <linux/kpoll.h>
+#      ifdef HAVE_LINUX_EPOLL_H
+#        include <sys/epoll.h>
+#      else
+#        include <linux/kpoll.h>
+#      endif
 #    endif
 #    ifdef USE_DEVPOLL /* can only use one of them ... */
 #      ifdef USE_KQUEUE
@@ -201,8 +214,17 @@
 
 static int             dev_poll_fd;   /* fd for /dev/poll */
 #ifdef HAVE_LINUX_KPOLL_H
+
+#ifdef HAVE_LINUX_EPOLL_H
+static struct epoll_event* dev_epoll_map;
+/* XXX Implement correct mapping from POLLIN/POLLOUT to/from EPOLLIN/EPOLLOUT */
+/* Currenltly POLLIN/POLLOUT == EPOLLIN/EPOLLOUT. So these macros will work */
+#define EPOLL_TO_POLL(bit_map) (bit_map)
+#define POLL_TO_EPOLL(bit_map) (bit_map & (EPOLLIN|EPOLLOUT))
+#else
 static char *          dev_poll_map;  /* mmap'ed area from kernel /dev/kpoll */
 static struct k_poll   dev_poll;      /* control block for /dev/kpoll */
+#endif /* HAVE_LINUX_EPOLL_H */
 static int max_poll_idx;              /* highest non /dev/kpoll fd */
 
 static void kpoll_enable();
@@ -212,7 +234,7 @@
 static struct pollfd*  dev_poll_rfds = NULL; /* Allocated at startup */
 
 static void devpoll_init(void);
-static void devpoll_update_pix(int pix);
+static void devpoll_update_pix(int pix, int old_events);
 #ifdef HAVE_SYS_DEVPOLL_H
 static void devpoll_clear_pix(int pix);
 #endif /* HAVE_SYS_DEVPOLL_H */
@@ -2021,7 +2043,7 @@
 
 #ifdef USE_DEVPOLL
 	    if (poll_fds[pix].events != old_events) 
-                devpoll_update_pix(pix);
+                devpoll_update_pix(pix, old_events);
 #endif
 #ifdef USE_KQUEUE
 	    if (poll_fds[pix].events != old_events) 
@@ -2077,7 +2099,7 @@
 	    if ( old_events && (dev_poll_fd != -1) ) {
 	       /* Tell /dev/[k]poll that we are not interested any more ... */
 	       poll_fds[pix].events = POLLREMOVE;
-	       devpoll_update_pix(pix);
+	       devpoll_update_pix(pix, old_events);
 	       /* devpoll_update_pix may change the pix */
 	       pix = fd_data[fd].pix;
 	       poll_fds[pix].events = 0;
@@ -2134,7 +2156,7 @@
 #ifdef HAVE_SYS_DEVPOLL_H
 	    devpoll_clear_pix(pix);
 #endif /* HAVE_SYS_DEVPOLL_H */
-	    devpoll_update_pix(pix);
+	    devpoll_update_pix(pix, old_events);
 	}
 #endif
 #ifdef USE_KQUEUE
@@ -2692,6 +2714,27 @@
 	nof_ready_fds = vr;
 
 #if HAVE_LINUX_KPOLL_H
+#ifdef HAVE_LINUX_EPOLL_H
+	if ( do_event_poll ) {
+           if ((r = epoll_wait(dev_poll_fd,dev_epoll_map,max_fd_plus_one,0)) > 0) {
+	    for (i = 0; (i < r); i++) {
+	      short revents = dev_epoll_map[i].events;
+
+	      if (revents != 0) {
+	        int fd = dev_epoll_map[i].data.fd;
+		rp->pfd.fd = fd;
+		rp->pfd.events = poll_fds[fd_data[fd].pix].events;
+		rp->pfd.revents = EPOLL_TO_POLL(revents);
+		rp->iport = fd_data[fd].inport;
+		rp->oport = fd_data[fd].outport;
+		rp++;
+	        nof_ready_fds ++;
+	      } 
+	    }
+           }
+        }
+
+#else
 	if ( do_event_poll ) {
 	  /* Now do the fast poll */
 	  dev_poll.kp_timeout = 0;
@@ -2714,6 +2757,7 @@
 	    nof_ready_fds += r;
 	  }
 	}
+#endif /*HAVE_LINUX_EPOLL_H */
 #endif
 
       } else {
@@ -3622,6 +3666,20 @@
     poll_fds[pix].revents = 0;
 }
 
+#ifdef HAVE_LINUX_EPOLL_H
+static void epoll_init()
+{
+    /* max_files is just a hint to the kernel */
+    if ( (dev_poll_fd=epoll_create(max_files)) < 0 ) {
+        DEBUGF(("Will use poll()\n"));
+        dev_poll_fd = -1; /* We will not use ekpoll */
+    } else {
+        DEBUGF(("Will use epoll\n"));
+        dev_epoll_map = (struct epoll_event *) erts_alloc(ERTS_ALC_T_POLL_FDS, (sizeof(struct epoll_event) * max_files));
+	erts_sys_misc_mem_sz += sizeof(struct epoll_event) * max_files;
+    }
+}
+#else
 static void kpoll_init()
 {
     if ( (dev_poll_fd=open("/dev/kpoll",O_RDWR)) < 0 ) {
@@ -3643,6 +3701,7 @@
       dev_poll_rfds =  NULL;
     }
 }
+#endif /* HAVE_LINUX_EPOLL_H */
 
 #endif /* HAVE_LINUX_KPOLL_H */
 
@@ -3672,7 +3731,11 @@
     } else {
         /* Determine use of poll vs. /dev/poll at runtime */
 #ifdef HAVE_LINUX_KPOLL_H
+#ifdef HAVE_LINUX_EPOLL_H
+        epoll_init();
+#else
         kpoll_init();
+#endif
 #else
 #ifdef HAVE_SYS_DEVPOLL_H
         solaris_devpoll_init();
@@ -3698,7 +3761,7 @@
     return count;
 }
 
-static void devpoll_update_pix(int pix)
+static void devpoll_update_pix(int pix, int old_events)
 {
     int res;
 
@@ -3713,10 +3776,33 @@
 
 #endif
     if ( dev_poll_fd != -1 ) {
+#ifdef HAVE_LINUX_EPOLL_H
+       int events = poll_fds[pix].events;
+       int fd = poll_fds[pix].fd;
+       if (old_events && events & POLLREMOVE) {
+            /* Delete file descriptor from epoll list */
+            res = epoll_ctl(dev_poll_fd,EPOLL_CTL_DEL,fd,NULL);
+            /* XXX check return code */
+       } else {
+            struct epoll_event epoll_ctl_event;
+            epoll_ctl_event.data.fd = fd;
+            epoll_ctl_event.events = POLL_TO_EPOLL(events);
+            if (old_events) {
+                /* Modify exiting fd */
+                res = epoll_ctl(dev_poll_fd,EPOLL_CTL_MOD,fd,&epoll_ctl_event);
+                /* XXX check return code */
+            } else {
+                /* Add fd to epoll list */
+                res = epoll_ctl(dev_poll_fd,EPOLL_CTL_ADD,fd,&epoll_ctl_event);
+                /* XXX check return code */
+            } 
+       }
+#else
         if ( (res=devpoll_write(dev_poll_fd,&poll_fds[pix],sizeof(struct pollfd))) != 
              (sizeof(struct pollfd)) ) {
             erl_exit(1,"Can't write to /dev/poll\n");
         }
+#endif /* HAVE_LINUX_EPOLL_H */
     }
 #if HAVE_LINUX_KPOLL_H
     } else {
--- erlang-10.b.9.orig/erts/emulator/zlib/Makefile.in
+++ erlang-10.b.9/erts/emulator/zlib/Makefile.in
@@ -17,7 +17,7 @@
 else
   TYPE_FLAGS = -O3
 endif
-CFLAGS = @CFLAGS@ @DEFS@ @EMU_THR_DEFS@ $(TYPE_FLAGS)
+CFLAGS = -fPIC @CFLAGS@ @DEFS@ @EMU_THR_DEFS@ $(TYPE_FLAGS)
 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
 #CFLAGS=-g -DDEBUG
 #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
--- erlang-10.b.9.orig/erts/epmd/src/Makefile.in
+++ erlang-10.b.9/erts/epmd/src/Makefile.in
@@ -51,7 +51,7 @@
 
 CC      = @CC@
 WFLAGS  = @WFLAGS@
-CFLAGS  = @CFLAGS@ @DEFS@ $(TYPE_FLAGS) $(WFLAGS)
+CFLAGS  = @CFLAGS@ @DEFS@ $(TYPE_FLAGS) $(WFLAGS) -fPIC
 LD      = @LD@
 LIBS    = @LIBS@
 LDFLAGS = @LDFLAGS@
--- erlang-10.b.9.orig/erts/etc/common/Makefile.in
+++ erlang-10.b.9/erts/etc/common/Makefile.in
@@ -43,7 +43,7 @@
 CC        = @CC@
 WFLAGS    = @WFLAGS@
 CFLAGS    = @CFLAGS@ @DEFS@ $(TYPE_FLAGS) @WFLAGS@ -I$(SYSDIR) -I$(EMUDIR) \
-            -DOTP_SYSTEM_VERSION=\"$(SYSTEM_VSN)\"
+            -DOTP_SYSTEM_VERSION=\"$(SYSTEM_VSN)\" -fPIC
 LD        = @LD@
 LIBS      = @LIBS@
 LDFLAGS   = @LDFLAGS@
--- erlang-10.b.9.orig/erts/etc/common/erlexec.c
+++ erlang-10.b.9/erts/etc/common/erlexec.c
@@ -474,8 +474,11 @@
 			error("-man not supported on Windows");
 #else
 			argv[i] = "man";
-			sprintf(tmpStr, "MANPATH=%s/man", rootdir);
-			putenv(strsave(tmpStr));
+			//sprintf(tmpStr, "MANPATH=%s/man", rootdir);
+		       /*
+			* Conform to erlang-manpages content.
+			*/
+		        putenv(strsave("MANSECT=1:3erl:4:6"));
 			execvp("man", argv+i);
 			error("Could not execute the 'man' command.");
 #endif
--- erlang-10.b.9.orig/erts/etc/common/Install
+++ erlang-10.b.9/erts/etc/common/Install
@@ -0,0 +1,160 @@
+#!/bin/sh
+# 
+#  Patch $ERL_ROOT/emulator/obj/Makefile.dist & make
+#
+#
+start_option=query
+while [ $# -ne 0 ]; do
+	case $1 in
+		-minimal) start_option=minimal ;;
+		-sasl)    start_option=sasl    ;;
+		*)        ERL_ROOT=$1          ;;
+	esac
+	shift
+done
+
+if [ -z "$ERL_ROOT" -o ! -d "$ERL_ROOT" ]
+then
+	echo "Install: need ERL_ROOT directory as argument"
+	exit 1
+fi
+
+if [ `echo $ERL_ROOT | awk '{ print substr($1,1,1) }'` != "/" ]
+then
+	echo "Install: need an absolute path to ERL_ROOT"
+	exit 1
+fi
+
+if [ ! -d $ERL_ROOT/erts-5.4.9/bin ]
+then
+	echo "Install: The directory $ERL_ROOT/erts-5.4.9/bin does not exist"
+	echo "         Bad location or erts module not un-tared"
+	exit 1
+fi
+
+if [ -d $ERL_ROOT/erts-5.4.9/obj ]
+then
+	cd $ERL_ROOT/erts-5.4.9/obj
+	sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" Makefile.src > Makefile
+fi
+
+if [ ! -d $ERL_ROOT/bin ]
+then
+        mkdir $ERL_ROOT/bin
+fi
+
+#
+# Fetch target system.
+#
+SYS=`(uname -s) 2>/dev/null` || SYS=unknown
+REL=`(uname -r) 2>/dev/null` || REL=unknown
+case $SYS:$REL in
+	        SunOS:5.*)
+	                TARGET=sunos5 ;;
+	        Linux:*)
+	                TARGET=linux ;;
+	        *)
+	                TARGET="" ;;
+esac
+
+cd $ERL_ROOT/erts-5.4.9/bin
+
+sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" erl.src > erl
+chmod 755 erl
+
+#
+# Create start file for embedded system use,
+#
+(cd $ERL_ROOT/erts-5.4.9/bin;
+  sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" start.src > start;
+  chmod 755 start)
+
+cd $ERL_ROOT/bin
+
+cp -p $ERL_ROOT/erts-5.4.9/bin/erl .
+cp -p $ERL_ROOT/erts-5.4.9/bin/erlc .
+
+#
+# Set a soft link to epmd
+# This should not be done for an embedded system!
+#
+
+# Remove old links first.
+if [ -h epmd ]; then
+  /bin/rm -f epmd
+fi
+
+ln -s $ERL_ROOT/erts-5.4.9/bin/epmd epmd
+
+cp -p $ERL_ROOT/erts-5.4.9/bin/run_erl .
+cp -p $ERL_ROOT/erts-5.4.9/bin/to_erl .
+cp -p $ERL_ROOT/erts-5.4.9/bin/start .
+sed -e "s;%EMU%;beam;" $ERL_ROOT/erts-5.4.9/bin/start_erl.src > start_erl
+chmod 755 start_erl
+
+if [ -d $ERL_ROOT/lib/sasl* ]
+then
+    (cd $ERL_ROOT/releases
+     echo 5.4.9 R10B > start_erl.data)
+     echo ""
+    (cd $ERL_ROOT/releases/R10B
+     echo ""
+     echo "Building SASL boot script ..."
+#     ERCL_EMULATOR="$ERL_ROOT/bin/erl +B -boot ./start" $ERL_ROOT/bin/erlc -s start_sasl.rel
+     $ERL_ROOT/bin/erl -noinput +B -boot ./start -s systools make_script start_sasl -s erlang halt
+     $ERL_ROOT/bin/erl -noinput +B -boot ./start -s release_handler create_RELEASES $ERL_ROOT start_sasl.rel -s erlang halt
+     echo "")
+fi
+
+
+if [ -f $ERL_ROOT/releases/R10B/start_sasl.boot ] && \
+   [ "$start_option" = "query" ]
+then
+    echo "Do you want to use a minimal system startup"
+    echo "instead of the SASL startup? (y/n) [n]: " | tr -d '\012'
+    read reply
+    case $reply in
+    [Yy]*)
+	start_option=minimal ;;
+    *)
+	start_option=sasl ;;
+    esac
+fi
+
+case $start_option in
+    minimal)
+	Name=start_clean ;;
+    sasl)
+	Name=start_sasl  ;;
+    *)
+	Name=start_sasl  ;;
+esac
+
+cp -p ../releases/R10B/start_*.boot .
+cp -p $Name.boot start.boot
+cp -p ../releases/R10B/$Name.script start.script
+
+#
+# We always run ranlib unless Solaris/SunOS 5
+# but ignore failures.
+#
+if [ "X$TARGET" != "Xsunos5" -a -d $ERL_ROOT/usr/lib ]; then 
+    cd $ERL_ROOT/usr/lib
+    for library in lib*.a
+    do
+	(ranlib $library) > /dev/null 2>&1
+    done
+fi
+
+
+#
+# Fixing the man pages
+#
+
+if [ -d $ERL_ROOT/man ]
+then
+    cd $ERL_ROOT
+    ./misc/format_man_pages $ERL_ROOT
+fi
+
+
--- erlang-10.b.9.orig/erts/lib_src/Makefile.in
+++ erlang-10.b.9/erts/lib_src/Makefile.in
@@ -33,7 +33,7 @@
 ERLANG_OSTYPE=@ERLANG_OSTYPE@
 
 ifeq ($(TYPE),debug)
-CFLAGS=@DEBUG_CFLAGS@ -DDEBUG
+CFLAGS=@DEBUG_CFLAGS@ -DDEBUG -fPIC
 TYPE_SUFFIX=.debug
 ifeq ($(TARGET),win32)
 LD_FLAGS += -g
@@ -43,22 +43,22 @@
 else
 
 ifeq ($(TYPE),purify)
-CFLAGS=@CFLAGS@ -DPURIFY
+CFLAGS=@CFLAGS@ -DPURIFY -fPIC
 TYPE_SUFFIX=.purify
 PRE_LD=purify $(PURIFY_BUILD_OPTIONS)
 else
 ifeq ($(TYPE),quantify)
-CFLAGS=@CFLAGS@ -DQUANTIFY
+CFLAGS=@CFLAGS@ -DQUANTIFY -fPIC
 TYPE_SUFFIX=.quantify
 PRE_LD=quantify $(QUANTIFY_BUILD_OPTIONS)
 else
 ifeq ($(TYPE),purecov)
-CFLAGS=@DEBUG_CFLAGS@ -DPURECOV
+CFLAGS=@DEBUG_CFLAGS@ -DPURECOV -fPIC
 TYPE_SUFFIX=.purecov
 PRE_LD=purecov $(PURECOV_BUILD_OPTIONS)
 else
 override TYPE=opt
-CFLAGS=@CFLAGS@
+CFLAGS=@CFLAGS@ -fPIC
 TYPE_SUFFIX=
 PRE_LD=
 endif
@@ -66,7 +66,7 @@
 endif
 endif
 
-CFLAGS += @WFLAGS@ @DEFS@
+CFLAGS += @WFLAGS@ @DEFS@ -fPIC
 
 ifeq ($(findstring -D_GNU_SOURCE,$(CFLAGS)),)
 THR_DEFS = $(ETHR_DEFS)
--- erlang-10.b.9.orig/erts/configure
+++ erlang-10.b.9/erts/configure
@@ -3716,6 +3716,151 @@
 fi
  
 
+
+if test "${ac_cv_header_sys_epoll_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for sys/epoll.h" >&5
+echo $ECHO_N "checking for sys/epoll.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_epoll_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_epoll_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_epoll_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/epoll.h usability" >&5
+echo $ECHO_N "checking sys/epoll.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <sys/epoll.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/epoll.h presence" >&5
+echo $ECHO_N "checking sys/epoll.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/epoll.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/epoll.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/epoll.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/epoll.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/epoll.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/epoll.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/epoll.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/epoll.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/epoll.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/epoll.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/epoll.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for sys/epoll.h" >&5
+echo $ECHO_N "checking for sys/epoll.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_epoll_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_sys_epoll_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_epoll_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_epoll_h" >&6
+
+fi
+if test $ac_cv_header_sys_epoll_h = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_LINUX_EPOLL_H 1
+_ACEOF
+
+fi
+
 echo $ac_n "checking for SO_BSDCOMPAT declaration""... $ac_c" 1>&6
 echo "configure:3721: checking for SO_BSDCOMPAT declaration" >&5
 if eval "test \"`echo '$''{'ac_cv_decl_so_bsdcompat'+set}'`\" = set"; then
--- erlang-10.b.9.orig/erts/config.h.in
+++ erlang-10.b.9/erts/config.h.in
@@ -175,6 +175,8 @@
 /* Define if you have the <linux/kpoll.h> header file. */
 #undef HAVE_LINUX_KPOLL_H
 
+/* Define if you have the <linux/epoll.h> header file. */
+#undef HAVE_LINUX_EPOLL_H
  
 /* Define if you have the <sys/event.h> header file. */
 #undef HAVE_SYS_EVENT_H
@@ -399,7 +401,7 @@
 
 #if !defined(USE_SELECT)
 #  if defined(ENABLE_KERNEL_POLL)
-#    if defined(HAVE_SYS_DEVPOLL_H) || defined(HAVE_LINUX_KPOLL_H) || defined(HAVE_SYS_EVENT_H)
+#    if defined(HAVE_SYS_DEVPOLL_H) || defined(HAVE_LINUX_KPOLL_H) || defined(HAVE_SYS_EVENT_H) || defined(HAVE_LINUX_EPOLL_H)
 #      define USE_KERNEL_POLL
 #    endif
 #  endif
--- erlang-10.b.9.orig/debian/patches/00list
+++ erlang-10.b.9/debian/patches/00list
@@ -0,0 +1,5 @@
+02Makefile.in.dpatch
+06install.dpatch
+40supervisor.dpatch
+41epoll.dpatch
+42man.dpatch
--- erlang-10.b.9.orig/debian/patches/25crypto-install-fix.dpatch
+++ erlang-10.b.9/debian/patches/25crypto-install-fix.dpatch
@@ -0,0 +1,23 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 25crypto-install-fix.dpatch by  <neumann@lostwebsite.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad erlang-10.b.8~/lib/crypto/c_src/Makefile.in erlang-10.b.8/lib/crypto/c_src/Makefile.in
+--- erlang-10.b.8~/lib/crypto/c_src/Makefile.in	2005-10-24 05:44:46.000000000 -0400
++++ erlang-10.b.8/lib/crypto/c_src/Makefile.in	2005-10-31 22:40:52.000000000 -0500
+@@ -125,9 +125,9 @@
+ release_spec: opt
+ 	$(INSTALL_DIR) $(RELSYSDIR)/priv/obj
+ 	$(INSTALL_DIR) $(RELSYSDIR)/priv/lib
+-	$(INSTALL_PROGRAM) $(DRV_MAKEFILE) $(RELSYSDIR)/priv/obj
+-	$(INSTALL_PROGRAM) $(OBJS) $(RELSYSDIR)/priv/obj
+-	$(INSTALL_PROGRAM) $(DYN_DRIVER) $(RELSYSDIR)/priv/lib
++	$(INSTALL_PROGRAM) -m 0644 $(DRV_MAKEFILE) $(RELSYSDIR)/priv/obj
++	$(INSTALL_PROGRAM) -m 0644 $(OBJS) $(RELSYSDIR)/priv/obj
++	$(INSTALL_PROGRAM) -m 0644 $(DYN_DRIVER) $(RELSYSDIR)/priv/lib
+ 
+ release_docs_spec:
+ 
--- erlang-10.b.9.orig/debian/patches/20rpath.dpatch
+++ erlang-10.b.9/debian/patches/20rpath.dpatch
@@ -0,0 +1,43 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20rpath.dpatch by  <neumann@lostwebsite.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+#DPATCHLEVEL=1
+diff -urNad erlang-10.b.7~/erts/configure.in erlang-10.b.7/erts/configure.in
+--- erlang-10.b.7~/erts/configure.in	2005-10-02 19:50:35.000000000 -0400
++++ erlang-10.b.7/erts/configure.in	2005-10-02 19:50:35.000000000 -0400
+@@ -173,7 +173,8 @@
+ CFLAGS="$CFLAGS $extra_flags"
+ DEBUG_CFLAGS="-g $extra_flags"
+ 
+-CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-R"
++#CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-R"
++CFLAG_RUNTIME_LIBRARY_PATH=""
+ case $host_os in
+   darwin*)
+ 	CFLAG_RUNTIME_LIBRARY_PATH=
+@@ -1326,7 +1327,8 @@
+ fi
+ 
+ DED_LD=ld
+-DED_LD_FLAG_RUNTIME_LIBRARY_PATH="-R"
++#DED_LD_FLAG_RUNTIME_LIBRARY_PATH="-R"
++DED_LD_FLAG_RUNTIME_LIBRARY_PATH=""
+ STATIC_CFLAGS=""
+ 
+ case $host_os in
+diff -urNad erlang-10.b.7~/lib/ssl/c_src/Makefile.dist erlang-10.b.7/lib/ssl/c_src/Makefile.dist
+--- erlang-10.b.7~/lib/ssl/c_src/Makefile.dist	2005-10-02 19:46:21.000000000 -0400
++++ erlang-10.b.7/lib/ssl/c_src/Makefile.dist	2005-10-02 19:50:35.000000000 -0400
+@@ -10,5 +10,6 @@
+ OBJS = %OBJS%
+ 
+ $(BINDIR)/ssl_esock: $(OBJS)
+-	$(CC) -L$(SSL_LIBDIR) -Wl,-R$(SSL_LIBDIR) -o $@ $^ \
+-		$(LIBS) -lssl -lcrypto
++#$(CC) -L$(SSL_LIBDIR) -Wl,-R$(SSL_LIBDIR) -o $@ $^ \
++$(CC) -L$(SSL_LIBDIR) -o $@ $^ \
++       $(LIBS) -lssl -lcrypto
--- erlang-10.b.9.orig/debian/patches/41epoll.dpatch
+++ erlang-10.b.9/debian/patches/41epoll.dpatch
@@ -0,0 +1,430 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 40epoll.dpatch by Sergei Golovan <sgolovan@nes.ru>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch adds epoll support, which is very useful on heavy
+## DP: loaded servers.
+
+@DPATCH@
+diff -ruNad erlang-10.b.9.orig/erts/acconfig.h erlang-10.b.9/erts/acconfig.h
+--- erlang-10.b.9.orig/erts/acconfig.h	2005-06-21 20:37:40.000000000 +0400
++++ erlang-10.b.9/erts/acconfig.h	2006-05-28 21:22:32.180580496 +0400
+@@ -188,6 +188,9 @@
+ /* Define if you have the <linux/kpoll.h> header file. */
+ #undef HAVE_LINUX_KPOLL_H
+  
++/* Define if you have the <linux/epoll.h> header file. */
++#undef HAVE_LINUX_EPOLL_H
++
+ /* Define if you have the <sys/event.h> header file. */
+ #undef HAVE_SYS_EVENT_H
+ 
+@@ -224,7 +227,7 @@
+ 
+ #if !defined(USE_SELECT)
+ #  if defined(ENABLE_KERNEL_POLL)
+-#    if defined(HAVE_SYS_DEVPOLL_H) || defined(HAVE_LINUX_KPOLL_H) || defined(HAVE_SYS_EVENT_H)
++#    if defined(HAVE_SYS_DEVPOLL_H) || defined(HAVE_LINUX_KPOLL_H) || defined(HAVE_SYS_EVENT_H) || defined(HAVE_LINUX_EPOLL_H)
+ #      define USE_KERNEL_POLL
+ #    endif
+ #  endif
+diff -ruNad erlang-10.b.9.orig/erts/config.h.in erlang-10.b.9/erts/config.h.in
+--- erlang-10.b.9.orig/erts/config.h.in	2005-12-13 02:02:32.000000000 +0300
++++ erlang-10.b.9/erts/config.h.in	2006-05-28 21:22:32.269566968 +0400
+@@ -175,6 +175,8 @@
+ /* Define if you have the <linux/kpoll.h> header file. */
+ #undef HAVE_LINUX_KPOLL_H
+ 
++/* Define if you have the <linux/epoll.h> header file. */
++#undef HAVE_LINUX_EPOLL_H
+  
+ /* Define if you have the <sys/event.h> header file. */
+ #undef HAVE_SYS_EVENT_H
+@@ -399,7 +401,7 @@
+ 
+ #if !defined(USE_SELECT)
+ #  if defined(ENABLE_KERNEL_POLL)
+-#    if defined(HAVE_SYS_DEVPOLL_H) || defined(HAVE_LINUX_KPOLL_H) || defined(HAVE_SYS_EVENT_H)
++#    if defined(HAVE_SYS_DEVPOLL_H) || defined(HAVE_LINUX_KPOLL_H) || defined(HAVE_SYS_EVENT_H) || defined(HAVE_LINUX_EPOLL_H)
+ #      define USE_KERNEL_POLL
+ #    endif
+ #  endif
+diff -ruNad erlang-10.b.9.orig/erts/configure erlang-10.b.9/erts/configure
+--- erlang-10.b.9.orig/erts/configure	2005-12-13 02:02:28.000000000 +0300
++++ erlang-10.b.9/erts/configure	2006-05-28 21:22:32.264567728 +0400
+@@ -3716,6 +3716,151 @@
+ fi
+  
+ 
++
++if test "${ac_cv_header_sys_epoll_h+set}" = set; then
++  echo "$as_me:$LINENO: checking for sys/epoll.h" >&5
++echo $ECHO_N "checking for sys/epoll.h... $ECHO_C" >&6
++if test "${ac_cv_header_sys_epoll_h+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_sys_epoll_h" >&5
++echo "${ECHO_T}$ac_cv_header_sys_epoll_h" >&6
++else
++  # Is the header compilable?
++echo "$as_me:$LINENO: checking sys/epoll.h usability" >&5
++echo $ECHO_N "checking sys/epoll.h usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++#include <sys/epoll.h>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_header_compiler=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking sys/epoll.h presence" >&5
++echo $ECHO_N "checking sys/epoll.h presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <sys/epoll.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } >/dev/null; then
++  if test -s conftest.err; then
++    ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++  else
++    ac_cpp_err=
++  fi
++else
++  ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++  ac_header_preproc=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++  ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So?  What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
++    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: sys/epoll.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
++    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: sys/epoll.h: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
++    ;;
++  no:yes:* )
++    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: present but cannot be compiled" >&5
++echo "$as_me: WARNING: sys/epoll.h: present but cannot be compiled" >&2;}
++    { echo "$as_me:$LINENO: WARNING: sys/epoll.h:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: sys/epoll.h:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: sys/epoll.h: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: sys/epoll.h:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: sys/epoll.h:     section \"Present But Cannot Be Compiled\"" >&2;}
++    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: sys/epoll.h: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: sys/epoll.h: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: sys/epoll.h: in the future, the compiler will take precedence" >&2;}
++    (
++      cat <<\_ASBOX
++## ------------------------------------------ ##
++## Report this to the AC_PACKAGE_NAME lists.  ##
++## ------------------------------------------ ##
++_ASBOX
++    ) |
++      sed "s/^/$as_me: WARNING:     /" >&2
++    ;;
++esac
++echo "$as_me:$LINENO: checking for sys/epoll.h" >&5
++echo $ECHO_N "checking for sys/epoll.h... $ECHO_C" >&6
++if test "${ac_cv_header_sys_epoll_h+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  ac_cv_header_sys_epoll_h=$ac_header_preproc
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_sys_epoll_h" >&5
++echo "${ECHO_T}$ac_cv_header_sys_epoll_h" >&6
++
++fi
++if test $ac_cv_header_sys_epoll_h = yes; then
++  cat >>confdefs.h <<\_ACEOF
++#define HAVE_LINUX_EPOLL_H 1
++_ACEOF
++
++fi
++
+ echo $ac_n "checking for SO_BSDCOMPAT declaration""... $ac_c" 1>&6
+ echo "configure:3721: checking for SO_BSDCOMPAT declaration" >&5
+ if eval "test \"`echo '$''{'ac_cv_decl_so_bsdcompat'+set}'`\" = set"; then
+diff -ruNad erlang-10.b.9.orig/erts/configure.in erlang-10.b.9/erts/configure.in
+--- erlang-10.b.9.orig/erts/configure.in	2005-10-24 13:43:05.000000000 +0400
++++ erlang-10.b.9/erts/configure.in	2006-05-28 21:22:32.189579128 +0400
+@@ -651,6 +651,7 @@
+ AC_CHECK_HEADER(sys/devpoll.h, AC_DEFINE(HAVE_SYS_DEVPOLL_H))
+ AC_CHECK_HEADER(linux/kpoll.h, AC_DEFINE(HAVE_LINUX_KPOLL_H))
+ AC_CHECK_HEADER(sys/event.h, AC_DEFINE(HAVE_SYS_EVENT_H)) 
++AC_CHECK_HEADER(sys/epoll.h, AC_DEFINE(HAVE_LINUX_EPOLL_H))
+ 
+ LM_DECL_SO_BSDCOMPAT
+ LM_DECL_INADDR_LOOPBACK
+diff -ruNad erlang-10.b.9.orig/erts/emulator/sys/unix/sys.c erlang-10.b.9/erts/emulator/sys/unix/sys.c
+--- erlang-10.b.9.orig/erts/emulator/sys/unix/sys.c	2005-08-29 17:13:36.000000000 +0400
++++ erlang-10.b.9/erts/emulator/sys/unix/sys.c	2006-05-28 21:22:32.246570464 +0400
+@@ -13,6 +13,12 @@
+  * Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
+  * AB. All Rights Reserved.''
+  * 
++ * 2005-08-31
++ * This has been modified by Matthew Reilly of SIPphone Inc. to 
++ * enable kernel poll (+K true) support via the epoll mechanism in Linux 2.6
++ * Portions created by SIPphone Inc. are Copyright 2005, SIPphone Inc.
++ * These modifications are released under the Erlang Public License.
++ *
+  *     $Id$
+  */
+ 
+@@ -50,6 +56,9 @@
+ #      define USE_DEVPOLL
+ #      include <sys/devpoll.h>
+ #    endif
++#    ifdef HAVE_LINUX_EPOLL_H /* Too minimize code changes, we pretend we have HAVE_LINUX_KPOLL_H as well */
++#      define HAVE_LINUX_KPOLL_H 1
++#    endif
+ #    ifdef HAVE_LINUX_KPOLL_H
+ #      define USE_DEVPOLL
+ #      include <asm/page.h>
+@@ -58,7 +67,11 @@
+ #      ifndef POLLREMOVE
+ #        define POLLREMOVE 0x1000 /* some day it will make it to bits/poll.h ;-) */
+ #      endif
+-#      include <linux/kpoll.h>
++#      ifdef HAVE_LINUX_EPOLL_H
++#        include <sys/epoll.h>
++#      else
++#        include <linux/kpoll.h>
++#      endif
+ #    endif
+ #    ifdef USE_DEVPOLL /* can only use one of them ... */
+ #      ifdef USE_KQUEUE
+@@ -201,8 +214,17 @@
+ 
+ static int             dev_poll_fd;   /* fd for /dev/poll */
+ #ifdef HAVE_LINUX_KPOLL_H
++
++#ifdef HAVE_LINUX_EPOLL_H
++static struct epoll_event* dev_epoll_map;
++/* XXX Implement correct mapping from POLLIN/POLLOUT to/from EPOLLIN/EPOLLOUT */
++/* Currenltly POLLIN/POLLOUT == EPOLLIN/EPOLLOUT. So these macros will work */
++#define EPOLL_TO_POLL(bit_map) (bit_map)
++#define POLL_TO_EPOLL(bit_map) (bit_map & (EPOLLIN|EPOLLOUT))
++#else
+ static char *          dev_poll_map;  /* mmap'ed area from kernel /dev/kpoll */
+ static struct k_poll   dev_poll;      /* control block for /dev/kpoll */
++#endif /* HAVE_LINUX_EPOLL_H */
+ static int max_poll_idx;              /* highest non /dev/kpoll fd */
+ 
+ static void kpoll_enable();
+@@ -212,7 +234,7 @@
+ static struct pollfd*  dev_poll_rfds = NULL; /* Allocated at startup */
+ 
+ static void devpoll_init(void);
+-static void devpoll_update_pix(int pix);
++static void devpoll_update_pix(int pix, int old_events);
+ #ifdef HAVE_SYS_DEVPOLL_H
+ static void devpoll_clear_pix(int pix);
+ #endif /* HAVE_SYS_DEVPOLL_H */
+@@ -2021,7 +2043,7 @@
+ 
+ #ifdef USE_DEVPOLL
+ 	    if (poll_fds[pix].events != old_events) 
+-                devpoll_update_pix(pix);
++                devpoll_update_pix(pix, old_events);
+ #endif
+ #ifdef USE_KQUEUE
+ 	    if (poll_fds[pix].events != old_events) 
+@@ -2077,7 +2099,7 @@
+ 	    if ( old_events && (dev_poll_fd != -1) ) {
+ 	       /* Tell /dev/[k]poll that we are not interested any more ... */
+ 	       poll_fds[pix].events = POLLREMOVE;
+-	       devpoll_update_pix(pix);
++	       devpoll_update_pix(pix, old_events);
+ 	       /* devpoll_update_pix may change the pix */
+ 	       pix = fd_data[fd].pix;
+ 	       poll_fds[pix].events = 0;
+@@ -2134,7 +2156,7 @@
+ #ifdef HAVE_SYS_DEVPOLL_H
+ 	    devpoll_clear_pix(pix);
+ #endif /* HAVE_SYS_DEVPOLL_H */
+-	    devpoll_update_pix(pix);
++	    devpoll_update_pix(pix, old_events);
+ 	}
+ #endif
+ #ifdef USE_KQUEUE
+@@ -2692,6 +2714,27 @@
+ 	nof_ready_fds = vr;
+ 
+ #if HAVE_LINUX_KPOLL_H
++#ifdef HAVE_LINUX_EPOLL_H
++	if ( do_event_poll ) {
++           if ((r = epoll_wait(dev_poll_fd,dev_epoll_map,max_fd_plus_one,0)) > 0) {
++	    for (i = 0; (i < r); i++) {
++	      short revents = dev_epoll_map[i].events;
++
++	      if (revents != 0) {
++	        int fd = dev_epoll_map[i].data.fd;
++		rp->pfd.fd = fd;
++		rp->pfd.events = poll_fds[fd_data[fd].pix].events;
++		rp->pfd.revents = EPOLL_TO_POLL(revents);
++		rp->iport = fd_data[fd].inport;
++		rp->oport = fd_data[fd].outport;
++		rp++;
++	        nof_ready_fds ++;
++	      } 
++	    }
++           }
++        }
++
++#else
+ 	if ( do_event_poll ) {
+ 	  /* Now do the fast poll */
+ 	  dev_poll.kp_timeout = 0;
+@@ -2714,6 +2757,7 @@
+ 	    nof_ready_fds += r;
+ 	  }
+ 	}
++#endif /*HAVE_LINUX_EPOLL_H */
+ #endif
+ 
+       } else {
+@@ -3622,6 +3666,20 @@
+     poll_fds[pix].revents = 0;
+ }
+ 
++#ifdef HAVE_LINUX_EPOLL_H
++static void epoll_init()
++{
++    /* max_files is just a hint to the kernel */
++    if ( (dev_poll_fd=epoll_create(max_files)) < 0 ) {
++        DEBUGF(("Will use poll()\n"));
++        dev_poll_fd = -1; /* We will not use ekpoll */
++    } else {
++        DEBUGF(("Will use epoll\n"));
++        dev_epoll_map = (struct epoll_event *) erts_alloc(ERTS_ALC_T_POLL_FDS, (sizeof(struct epoll_event) * max_files));
++	erts_sys_misc_mem_sz += sizeof(struct epoll_event) * max_files;
++    }
++}
++#else
+ static void kpoll_init()
+ {
+     if ( (dev_poll_fd=open("/dev/kpoll",O_RDWR)) < 0 ) {
+@@ -3643,6 +3701,7 @@
+       dev_poll_rfds =  NULL;
+     }
+ }
++#endif /* HAVE_LINUX_EPOLL_H */
+ 
+ #endif /* HAVE_LINUX_KPOLL_H */
+ 
+@@ -3672,7 +3731,11 @@
+     } else {
+         /* Determine use of poll vs. /dev/poll at runtime */
+ #ifdef HAVE_LINUX_KPOLL_H
++#ifdef HAVE_LINUX_EPOLL_H
++        epoll_init();
++#else
+         kpoll_init();
++#endif
+ #else
+ #ifdef HAVE_SYS_DEVPOLL_H
+         solaris_devpoll_init();
+@@ -3698,7 +3761,7 @@
+     return count;
+ }
+ 
+-static void devpoll_update_pix(int pix)
++static void devpoll_update_pix(int pix, int old_events)
+ {
+     int res;
+ 
+@@ -3713,10 +3776,33 @@
+ 
+ #endif
+     if ( dev_poll_fd != -1 ) {
++#ifdef HAVE_LINUX_EPOLL_H
++       int events = poll_fds[pix].events;
++       int fd = poll_fds[pix].fd;
++       if (old_events && events & POLLREMOVE) {
++            /* Delete file descriptor from epoll list */
++            res = epoll_ctl(dev_poll_fd,EPOLL_CTL_DEL,fd,NULL);
++            /* XXX check return code */
++       } else {
++            struct epoll_event epoll_ctl_event;
++            epoll_ctl_event.data.fd = fd;
++            epoll_ctl_event.events = POLL_TO_EPOLL(events);
++            if (old_events) {
++                /* Modify exiting fd */
++                res = epoll_ctl(dev_poll_fd,EPOLL_CTL_MOD,fd,&epoll_ctl_event);
++                /* XXX check return code */
++            } else {
++                /* Add fd to epoll list */
++                res = epoll_ctl(dev_poll_fd,EPOLL_CTL_ADD,fd,&epoll_ctl_event);
++                /* XXX check return code */
++            } 
++       }
++#else
+         if ( (res=devpoll_write(dev_poll_fd,&poll_fds[pix],sizeof(struct pollfd))) != 
+              (sizeof(struct pollfd)) ) {
+             erl_exit(1,"Can't write to /dev/poll\n");
+         }
++#endif /* HAVE_LINUX_EPOLL_H */
+     }
+ #if HAVE_LINUX_KPOLL_H
+     } else {
--- erlang-10.b.9.orig/debian/patches/42man.dpatch
+++ erlang-10.b.9/debian/patches/42man.dpatch
@@ -0,0 +1,24 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 40man.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -ruNad erlang-10.b.9.orig/erts/etc/common/erlexec.c erlang-10.b.9/erts/etc/common/erlexec.c
+--- erlang-10.b.9.orig/erts/etc/common/erlexec.c	2005-10-24 13:42:59.000000000 +0400
++++ erlang-10.b.9/erts/etc/common/erlexec.c	2006-05-28 21:22:32.251569704 +0400
+@@ -474,8 +474,11 @@
+ 			error("-man not supported on Windows");
+ #else
+ 			argv[i] = "man";
+-			sprintf(tmpStr, "MANPATH=%s/man", rootdir);
+-			putenv(strsave(tmpStr));
++			//sprintf(tmpStr, "MANPATH=%s/man", rootdir);
++		       /*
++			* Conform to erlang-manpages content.
++			*/
++		        putenv(strsave("MANSECT=1:3erl:4:6"));
+ 			execvp("man", argv+i);
+ 			error("Could not execute the 'man' command.");
+ #endif
--- erlang-10.b.9.orig/debian/patches/02Makefile.in.dpatch
+++ erlang-10.b.9/debian/patches/02Makefile.in.dpatch
@@ -0,0 +1,272 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01Makefile.in.dpatch by  <neumann@lostwebsite.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: [Old] Makefile.in changes
+
+@DPATCH@
+
+#DPATCHLEVEL=1
+--- erlang-10.b.7.orig/lib/asn1/c_src/Makefile.in
++++ erlang-10.b.7/lib/asn1/c_src/Makefile.in
+@@ -74,7 +74,7 @@
+ EI_INCLUDES = -I$(ERL_TOP)/lib/erl_interface/include
+ DRIVER_INCLUDES = -I$(ERL_TOP)/erts/emulator/beam \
+ 	-I$(ERL_TOP)/erts/emulator/sys/$(ERLANG_OSTYPE)
+-CFLAGS = $(DRIVER_INCLUDES) $(EI_INCLUDES) @DED_CFLAGS@
++CFLAGS = -fPIC $(DRIVER_INCLUDES) $(EI_INCLUDES) @DED_CFLAGS@
+ LDFLAGS = @DED_LDFLAGS@
+ 
+ LD_INCL_EI = -L$(EI_LIBDIR)
+
+--- erlang-10.b.7.orig/lib/erl_interface/src/Makefile.in
++++ erlang-10.b.7/lib/erl_interface/src/Makefile.in
+@@ -97,7 +97,7 @@
+ ifneq ($(findstring ose,$(TARGET)),ose)
+ CFLAGS = @DED_CFLAGS@ $(WARNFLAGS) $(INCFLAGS) $(TYPE_FLAGS)
+ else
+-CFLAGS = @CFLAGS@ $(INCFLAGS)
++CFLAGS = -fPIC @CFLAGS@ $(INCFLAGS)
+ endif
+ PROG_CFLAGS = @CFLAGS@ $(WARNFLAGS) $(INCFLAGS) $(TYPE_FLAGS) -Ilegacy
+ 
+--- erlang-10.b.7.orig/lib/ic/c_src/Makefile.in
++++ erlang-10.b.7/lib/ic/c_src/Makefile.in
+@@ -110,7 +110,7 @@
+ 
+ OBJ_FILES= $(C_FILES:%.c=$(OBJDIR)/%.o) 
+ 
+-ALL_CFLAGS = @CFLAGS@ @DEFS@ -I$(INCDIR) $(ERL_INTERFACE_FLAGS) $(CFLAGS) 
++ALL_CFLAGS = -fPIC @CFLAGS@ @DEFS@ -I$(INCDIR) $(ERL_INTERFACE_FLAGS) $(CFLAGS) 
+ 
+ # ----------------------------------------------------
+ # Targets
+--- erlang-10.b.7.orig/lib/megaco/src/flex/Makefile.in
++++ erlang-10.b.7/lib/megaco/src/flex/Makefile.in
+@@ -150,7 +150,7 @@
+ CFLAGS += -DMFS_DEBUG=true
+ endif
+ 
+-CFLAGS += $(DRIVER_INCLUDES) $(DRV_FLAGS) -funroll-loops -Wall 
++CFLAGS += -fPIC $(DRIVER_INCLUDES) $(DRV_FLAGS) -funroll-loops -Wall 
+ 
+ ifeq ($(ENABLE_MEGACO_FLEX_SCANNER_LINENO),true)
+ LEX_FLAGS = -Ca
+--- erlang-10.b.7.orig/lib/odbc/c_src/Makefile.in
++++ erlang-10.b.7/lib/odbc/c_src/Makefile.in
+@@ -77,7 +77,7 @@
+ # FLAGS
+ # ----------------------------------------------------
+ CC =  @CC@
+-CFLAGS = $(TYPEFLAGS) @CFLAGS@
++CFLAGS = -fPIC $(TYPEFLAGS) @CFLAGS@
+ EI_LDFLAGS = -L$(EI_ROOT)/obj$(TYPEMARKER)/$(TARGET)
+ LD = @DED_LD@
+ LDFLAGS =  $(ODBC_LIB) $(EI_LDFLAGS)
+--- erlang-10.b.7.orig/lib/orber/c_src/Makefile.in
++++ erlang-10.b.7/lib/orber/c_src/Makefile.in
+@@ -64,7 +64,7 @@
+ TARGET_FILES= $(PROGRAMS:%=$(BINDIR)/%)
+ OBJ_FILES= $(C_FILES:%.c=$(OBJDIR)/%.o) 
+ 
+-ALL_CFLAGS = @CFLAGS@ @DEFS@ $(CFLAGS) 
++ALL_CFLAGS = -fPIC @CFLAGS@ @DEFS@ $(CFLAGS) 
+ 
+ # ----------------------------------------------------
+ # Targets
+--- erlang-10.b.7.orig/lib/os_mon/c_src/Makefile.in
++++ erlang-10.b.7/lib/os_mon/c_src/Makefile.in
+@@ -72,7 +72,7 @@
+ 
+ TARGET_FILES= $(PROGRAMS:%=$(BINDIR)/%)
+ 
+-ALL_CFLAGS = @CFLAGS@ @DEFS@ $(CFLAGS)
++ALL_CFLAGS = -fPIC @CFLAGS@ @DEFS@ $(CFLAGS)
+ 
+ # ----------------------------------------------------
+ # Targets
+--- erlang-10.b.7.orig/lib/ssl/c_src/Makefile.in
++++ erlang-10.b.7/lib/ssl/c_src/Makefile.in
+@@ -44,7 +44,7 @@
+ # Includes and libs
+ # ----------------------------------------------------
+ 
+-ALL_CFLAGS = @WFLAGS@ @CFLAGS@ @DEFS@ $(TYPE_FLAGS)
++ALL_CFLAGS = -fPIC @WFLAGS@ @CFLAGS@ @DEFS@ $(TYPE_FLAGS)
+ TARGET = @host@
+ 
+ ifeq ($(TYPE),debug)
+@@ -103,9 +103,11 @@
+ CC_R_FLAG =
+ else
+ ifeq ($(findstring osf,$(TARGET)),osf)		# osf1: -Wl,-rpath,
+-CC_R_FLAG = -Wl,-rpath,
++#CC_R_FLAG = -Wl,-rpath,
++CC_R_FLAG =
+ else						# Default: -Wl,-R
+-CC_R_FLAG = -Wl,-R
++#CC_R_FLAG = -Wl,-R
++CC_R_FLAGS =
+ endif
+ endif
+ 
+--- erlang-10.b.7.orig/erts/emulator/Makefile.in
++++ erlang-10.b.7/erts/emulator/Makefile.in
+@@ -31,7 +31,7 @@
+ PURIFY =
+ TYPEMARKER = .debug
+ THR_LIB_SFX = .debug
+-TYPE_FLAGS = @DEBUG_CFLAGS@ -DDEBUG
++TYPE_FLAGS = @DEBUG_CFLAGS@ -fPIC -DDEBUG
+ ENABLE_ALLOC_TYPE_VARS += debug
+ ifeq ($(TARGET),win32)
+ TYPE_FLAGS += -DNO_JUMP_TABLE
+@@ -41,20 +41,20 @@
+ ifeq ($(TYPE),shared)
+ PURIFY =
+ TYPEMARKER = .shared
+-TYPE_FLAGS = @CFLAGS@ -DSHARED_HEAP
++TYPE_FLAGS = @CFLAGS@ -fPIC -DSHARED_HEAP
+ ENABLE_ALLOC_TYPE_VARS += shared_heap
+ else
+ ifeq ($(TYPE),hybrid)
+ PURIFY =
+ TYPEMARKER = .hybrid
+-TYPE_FLAGS = @CFLAGS@ -DHYBRID
++TYPE_FLAGS = @CFLAGS@ -fPIC -DHYBRID
+ ENABLE_ALLOC_TYPE_VARS += hybrid
+ else
+ ifeq ($(TYPE),purify)
+ PURIFY = purify $(PURIFY_BUILD_OPTIONS)
+ TYPEMARKER = .purify
+ THR_LIB_SFX = .purify
+-TYPE_FLAGS = @CFLAGS@ -DPURIFY -DNO_JUMP_TABLE -DERTS_MSEG_FAKE_SEGMENTS
++TYPE_FLAGS = @CFLAGS@ -fPIC -DPURIFY -DNO_JUMP_TABLE -DERTS_MSEG_FAKE_SEGMENTS
+ ENABLE_ALLOC_TYPE_VARS += purify
+ else
+ ifeq ($(TYPE),quantify)
+@@ -63,22 +63,22 @@
+ THR_LIB_SFX = .quantify
+ ENABLE_ALLOC_TYPE_VARS += quantify
+ ifeq ($(findstring ose,$(TARGET)),ose)
+-  TYPE_FLAGS = @CFLAGS@ -DQUANTIFY
++  TYPE_FLAGS = @CFLAGS@ -fPIC -DQUANTIFY
+ else
+-  TYPE_FLAGS = @CFLAGS@ -g -O2 -DQUANTIFY -DNO_JUMP_TABLE
++  TYPE_FLAGS = @CFLAGS@ -fPIC -g -O2 -DQUANTIFY -DNO_JUMP_TABLE
+ endif
+ else
+ ifeq ($(TYPE),purecov)
+ PURIFY = purecov --follow-child-processes=yes $(PURECOV_BUILD_OPTIONS)
+ TYPEMARKER = .purecov
+ THR_LIB_SFX = .purecov
+-TYPE_FLAGS = @DEBUG_CFLAGS@ -DPURECOV -DNO_JUMP_TABLE
++TYPE_FLAGS = @DEBUG_CFLAGS@ -fPIC -DPURECOV -DNO_JUMP_TABLE
+ ENABLE_ALLOC_TYPE_VARS += purecov
+ else
+ TYPE=opt
+ PURIFY =
+ TYPEMARKER =
+-TYPE_FLAGS = @CFLAGS@
++TYPE_FLAGS = @CFLAGS@ -fPIC 
+ endif
+ endif
+ endif
+@@ -94,7 +94,7 @@
+ OPSYSCFLAGS=$($(OPSYS)CFLAGS)
+ ARCH=@ARCH@
+ ultrasparcCFLAGS=-Wa,-xarch=v8plusa
+-ARCHCFLAGS=$($(ARCH)CFLAGS)
++ARCHCFLAGS=$($(ARCH)CFLAGS) -fPIC
+ 
+ ifdef HIPE_ENABLED
+ ifeq ($(OPSYS),linux)
+@@ -129,7 +129,7 @@
+ PERL    = @PERL@
+ 
+ ifeq ($(CC), gcc)
+-GEN_OPT_FLGS = -O3 -fomit-frame-pointer
++GEN_OPT_FLGS = -O2 -fomit-frame-pointer
+ UNROLL_FLG = -funroll-loops
+ else
+ ifeq ($(TARGET), win32)
+--- erlang-10.b.7.orig/erts/emulator/zlib/Makefile.in
++++ erlang-10.b.7/erts/emulator/zlib/Makefile.in
+@@ -17,7 +17,7 @@
+ else
+   TYPE_FLAGS = -O3
+ endif
+-CFLAGS = @CFLAGS@ @DEFS@ @EMU_THR_DEFS@ $(TYPE_FLAGS)
++CFLAGS = -fPIC @CFLAGS@ @DEFS@ @EMU_THR_DEFS@ $(TYPE_FLAGS)
+ #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+ #CFLAGS=-g -DDEBUG
+ #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+--- erlang-10.b.7.orig/erts/epmd/src/Makefile.in
++++ erlang-10.b.7/erts/epmd/src/Makefile.in
+@@ -51,7 +51,7 @@
+ 
+ CC      = @CC@
+ WFLAGS  = @WFLAGS@
+-CFLAGS  = @CFLAGS@ @DEFS@ $(TYPE_FLAGS) $(WFLAGS)
++CFLAGS  = @CFLAGS@ @DEFS@ $(TYPE_FLAGS) $(WFLAGS) -fPIC
+ LD      = @LD@
+ LIBS    = @LIBS@
+ LDFLAGS = @LDFLAGS@
+--- erlang-10.b.7.orig/erts/etc/common/Makefile.in
++++ erlang-10.b.7/erts/etc/common/Makefile.in
+@@ -43,7 +43,7 @@
+ CC        = @CC@
+ WFLAGS    = @WFLAGS@
+ CFLAGS    = @CFLAGS@ @DEFS@ $(TYPE_FLAGS) @WFLAGS@ -I$(SYSDIR) -I$(EMUDIR) \
+-            -DOTP_SYSTEM_VERSION=\"$(SYSTEM_VSN)\"
++            -DOTP_SYSTEM_VERSION=\"$(SYSTEM_VSN)\" -fPIC
+ LD        = @LD@
+ LIBS      = @LIBS@
+ LDFLAGS   = @LDFLAGS@
+--- erlang-10.b.7.orig/erts/lib_src/Makefile.in
++++ erlang-10.b.7/erts/lib_src/Makefile.in
+@@ -33,7 +33,7 @@
+ ERLANG_OSTYPE=@ERLANG_OSTYPE@
+ 
+ ifeq ($(TYPE),debug)
+-CFLAGS=@DEBUG_CFLAGS@ -DDEBUG
++CFLAGS=@DEBUG_CFLAGS@ -DDEBUG -fPIC
+ TYPE_SUFFIX=.debug
+ ifeq ($(TARGET),win32)
+ LD_FLAGS += -g
+@@ -43,22 +43,22 @@
+ else
+ 
+ ifeq ($(TYPE),purify)
+-CFLAGS=@CFLAGS@ -DPURIFY
++CFLAGS=@CFLAGS@ -DPURIFY -fPIC
+ TYPE_SUFFIX=.purify
+ PRE_LD=purify $(PURIFY_BUILD_OPTIONS)
+ else
+ ifeq ($(TYPE),quantify)
+-CFLAGS=@CFLAGS@ -DQUANTIFY
++CFLAGS=@CFLAGS@ -DQUANTIFY -fPIC
+ TYPE_SUFFIX=.quantify
+ PRE_LD=quantify $(QUANTIFY_BUILD_OPTIONS)
+ else
+ ifeq ($(TYPE),purecov)
+-CFLAGS=@DEBUG_CFLAGS@ -DPURECOV
++CFLAGS=@DEBUG_CFLAGS@ -DPURECOV -fPIC
+ TYPE_SUFFIX=.purecov
+ PRE_LD=purecov $(PURECOV_BUILD_OPTIONS)
+ else
+ override TYPE=opt
+-CFLAGS=@CFLAGS@
++CFLAGS=@CFLAGS@ -fPIC
+ TYPE_SUFFIX=
+ PRE_LD=
+ endif
+@@ -66,7 +66,7 @@
+ endif
+ endif
+ 
+-CFLAGS += @WFLAGS@ @DEFS@
++CFLAGS += @WFLAGS@ @DEFS@ -fPIC
+ 
+ LIBS=@LIBS@
+ 
--- erlang-10.b.9.orig/debian/patches/40supervisor.dpatch
+++ erlang-10.b.9/debian/patches/40supervisor.dpatch
@@ -0,0 +1,92 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 40supervisor.dpatch by Sergei Golovan <sgolovan@nes.ru>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patched supervisor uses dictionaries instead of lists, which
+## DP: greatly improves performance.
+
+@DPATCH@
+diff -ruNad erlang-10.b.9.orig/lib/stdlib/src/supervisor.erl erlang-10.b.9/lib/stdlib/src/supervisor.erl
+--- erlang-10.b.9.orig/lib/stdlib/src/supervisor.erl	2004-09-14 15:40:53.000000000 +0400
++++ erlang-10.b.9/lib/stdlib/src/supervisor.erl	2006-05-28 21:22:32.175581256 +0400
+@@ -32,10 +32,12 @@
+ -export([init/1, handle_call/3, handle_info/2, terminate/2, code_change/3]).
+ -export([handle_cast/2]).
+ 
++-define(DICT, dict).
++
+ -record(state, {name,
+ 		strategy,
+ 		children = [],
+-		dynamics = [],
++		dynamics = ?DICT:new(),
+ 		intensity,
+ 		period,
+ 		restarts = [],
+@@ -218,11 +220,11 @@
+     case do_start_child_i(M, F, Args) of
+ 	{ok, Pid} ->
+ 	    NState = State#state{dynamics = 
+-				 [{Pid, Args}|State#state.dynamics]},
++				 ?DICT:store(Pid, Args, State#state.dynamics)},
+ 	    {reply, {ok, Pid}, NState};
+ 	{ok, Pid, Extra} ->
+ 	    NState = State#state{dynamics = 
+-				 [{Pid, Args}|State#state.dynamics]},
++				 ?DICT:store(Pid, Args, State#state.dynamics)},
+ 	    {reply, {ok, Pid, Extra}, NState};
+ 	What ->
+ 	    {reply, What, State}
+@@ -284,7 +286,7 @@
+ handle_call(which_children, _From, State) when ?is_simple(State) ->
+     [#child{child_type = CT, modules = Mods}] = State#state.children,
+     Reply = lists:map(fun({Pid, _}) -> {undefined, Pid, CT, Mods} end,
+-		      State#state.dynamics),
++		      ?DICT:to_list(State#state.dynamics)),
+     {reply, Reply, State};
+ 
+ handle_call(which_children, _From, State) ->
+@@ -439,14 +441,14 @@
+ %%% ---------------------------------------------------
+ 
+ restart_child(Pid, Reason, State) when ?is_simple(State) ->
+-    case lists:keysearch(Pid, 1, State#state.dynamics) of
+-	{value, {_Pid, Args}} ->
++    case ?DICT:find(Pid, State#state.dynamics) of
++	{ok, Args} ->
+ 	    [Child] = State#state.children,
+ 	    RestartType = Child#child.restart_type,
+ 	    {M, F, _} = Child#child.mfa,
+ 	    NChild = Child#child{pid = Pid, mfa = {M, F, Args}},
+ 	    do_restart(RestartType, Reason, NChild, State);
+-	_ ->
++	error ->
+ 	    {ok, State}
+     end;
+ restart_child(Pid, Reason, State) ->
+@@ -488,13 +490,13 @@
+ 
+ restart(simple_one_for_one, Child, State) ->
+     #child{mfa = {M, F, A}} = Child,
+-    Dynamics = lists:keydelete(Child#child.pid,1,State#state.dynamics),
++    Dynamics = ?DICT:erase(Child#child.pid, State#state.dynamics),
+     case do_start_child_i(M, F, A) of
+ 	{ok, Pid} ->
+-	    NState = State#state{dynamics = [{Pid, A} | Dynamics]},
++	    NState = State#state{dynamics = ?DICT:store(Pid, A, Dynamics)},
+ 	    {ok, NState};
+ 	{ok, Pid, _Extra} ->
+-	    NState = State#state{dynamics = [{Pid, A} | Dynamics]},
++	    NState = State#state{dynamics = ?DICT:store(Pid, A, Dynamics)},
+ 	    {ok, NState};
+ 	{error, Error} ->
+ 	    report_error(start_error, Error, Child, State#state.name),
+@@ -638,7 +640,7 @@
+ %% Child/State manipulating functions.
+ %%-----------------------------------------------------------------
+ state_del_child(#child{pid = Pid}, State) when ?is_simple(State) ->
+-    NDynamics = lists:keydelete(Pid, 1, State#state.dynamics),
++    NDynamics = ?DICT:erase(Pid, State#state.dynamics),
+     State#state{dynamics = NDynamics};
+ state_del_child(Child, State) ->
+     NChildren = del_child(Child#child.name, State#state.children),
--- erlang-10.b.9.orig/debian/patches/04configure.ac.dpatch
+++ erlang-10.b.9/debian/patches/04configure.ac.dpatch
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+## preserve_bootstrap.dpatch
+##
+## DP: "Port" the configure.in files to autoconf 2.5.
+
+dpatch_patch () 
+{
+    for i in `find -name configure.in` 
+    do
+      mv -v ${i} `dirname ${i}`/configure.ac
+    done
+}
+
+dpatch_unpatch ()
+{
+    for i in `find -name configure.ac`
+    do
+      mv -v ${i} `dirname ${i}`/configure.in
+    done
+}
+
+DPATCH_LIB_NO_DEFAULT=1
+
+. /usr/share/dpatch/dpatch.lib.sh
--- erlang-10.b.9.orig/debian/patches/10Install.dpatch
+++ erlang-10.b.9/debian/patches/10Install.dpatch
@@ -0,0 +1,171 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10Install.dpatch by  <neumann@lostwebsite.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad --exclude=CVS --exclude=.svn ./erts/etc/common/Install /tmp/dpep-work.sxKrGc/erlang-10.b.7/erts/etc/common/Install
+--- ./erts/etc/common/Install	1969-12-31 19:00:00.000000000 -0500
++++ /tmp/dpep-work.sxKrGc/erlang-10.b.7/erts/etc/common/Install	2005-09-13 21:13:17.000000000 -0400
+@@ -0,0 +1,160 @@
++#!/bin/sh
++# 
++#  Patch $ERL_ROOT/emulator/obj/Makefile.dist & make
++#
++#
++start_option=query
++while [ $# -ne 0 ]; do
++	case $1 in
++		-minimal) start_option=minimal ;;
++		-sasl)    start_option=sasl    ;;
++		*)        ERL_ROOT=$1          ;;
++	esac
++	shift
++done
++
++if [ -z "$ERL_ROOT" -o ! -d "$ERL_ROOT" ]
++then
++	echo "Install: need ERL_ROOT directory as argument"
++	exit 1
++fi
++
++if [ `echo $ERL_ROOT | awk '{ print substr($1,1,1) }'` != "/" ]
++then
++	echo "Install: need an absolute path to ERL_ROOT"
++	exit 1
++fi
++
++if [ ! -d $ERL_ROOT/erts-5.4.6/bin ]
++then
++	echo "Install: The directory $ERL_ROOT/erts-5.4.6/bin does not exist"
++	echo "         Bad location or erts module not un-tared"
++	exit 1
++fi
++
++if [ -d $ERL_ROOT/erts-5.4.6/obj ]
++then
++	cd $ERL_ROOT/erts-5.4.6/obj
++	sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" Makefile.src > Makefile
++fi
++
++if [ ! -d $ERL_ROOT/bin ]
++then
++        mkdir $ERL_ROOT/bin
++fi
++
++#
++# Fetch target system.
++#
++SYS=`(uname -s) 2>/dev/null` || SYS=unknown
++REL=`(uname -r) 2>/dev/null` || REL=unknown
++case $SYS:$REL in
++	        SunOS:5.*)
++	                TARGET=sunos5 ;;
++	        Linux:*)
++	                TARGET=linux ;;
++	        *)
++	                TARGET="" ;;
++esac
++
++cd $ERL_ROOT/erts-5.4.6/bin
++
++sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" erl.src > erl
++chmod 755 erl
++
++#
++# Create start file for embedded system use,
++#
++(cd $ERL_ROOT/erts-5.4.6/bin;
++  sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" start.src > start;
++  chmod 755 start)
++
++cd $ERL_ROOT/bin
++
++cp -p $ERL_ROOT/erts-5.4.6/bin/erl .
++cp -p $ERL_ROOT/erts-5.4.6/bin/erlc .
++
++#
++# Set a soft link to epmd
++# This should not be done for an embedded system!
++#
++
++# Remove old links first.
++if [ -h epmd ]; then
++  /bin/rm -f epmd
++fi
++
++ln -s $ERL_ROOT/erts-5.4.6/bin/epmd epmd
++
++cp -p $ERL_ROOT/erts-5.4.6/bin/run_erl .
++cp -p $ERL_ROOT/erts-5.4.6/bin/to_erl .
++cp -p $ERL_ROOT/erts-5.4.6/bin/start .
++sed -e "s;%EMU%;beam;" $ERL_ROOT/erts-5.4.6/bin/start_erl.src > start_erl
++chmod 755 start_erl
++
++if [ -d $ERL_ROOT/lib/sasl* ]
++then
++    (cd $ERL_ROOT/releases
++     echo 5.4.6 R10B > start_erl.data)
++     echo ""
++    (cd $ERL_ROOT/releases/R10B
++     echo ""
++     echo "Building SASL boot script ..."
++#     ERCL_EMULATOR="$ERL_ROOT/bin/erl +B -boot ./start" $ERL_ROOT/bin/erlc -s start_sasl.rel
++     $ERL_ROOT/bin/erl -noinput +B -boot ./start -s systools make_script start_sasl -s erlang halt
++     $ERL_ROOT/bin/erl -noinput +B -boot ./start -s release_handler create_RELEASES $ERL_ROOT start_sasl.rel -s erlang halt
++     echo "")
++fi
++
++
++if [ -f $ERL_ROOT/releases/R10B/start_sasl.boot ] && \
++   [ "$start_option" = "query" ]
++then
++    echo "Do you want to use a minimal system startup"
++    echo "instead of the SASL startup? (y/n) [n]: " | tr -d '\012'
++    read reply
++    case $reply in
++    [Yy]*)
++	start_option=minimal ;;
++    *)
++	start_option=sasl ;;
++    esac
++fi
++
++case $start_option in
++    minimal)
++	Name=start_clean ;;
++    sasl)
++	Name=start_sasl  ;;
++    *)
++	Name=start_sasl  ;;
++esac
++
++cp -p ../releases/R10B/start_*.boot .
++cp -p $Name.boot start.boot
++cp -p ../releases/R10B/$Name.script start.script
++
++#
++# We always run ranlib unless Solaris/SunOS 5
++# but ignore failures.
++#
++if [ "X$TARGET" != "Xsunos5" -a -d $ERL_ROOT/usr/lib ]; then 
++    cd $ERL_ROOT/usr/lib
++    for library in lib*.a
++    do
++	(ranlib $library) > /dev/null 2>&1
++    done
++fi
++
++
++#
++# Fixing the man pages
++#
++
++if [ -d $ERL_ROOT/man ]
++then
++    cd $ERL_ROOT
++    ./misc/format_man_pages $ERL_ROOT
++fi
++
++
--- erlang-10.b.9.orig/debian/patches/11config.dpatch
+++ erlang-10.b.9/debian/patches/11config.dpatch
@@ -0,0 +1,28 @@
+#! /bin/sh -e
+## config.dpatch
+## Ralf Treinen <treinen@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: replace all config.{guess,sub} by the vesion installed in
+## DP: /usr/share/misc
+
+dpatch_patch ()
+{
+	find . -name config.guess -o -name config.sub \
+	 	| tar cf debian/patched/config.guess+sub.tar -T -
+	find . -name config.guess \
+		-exec ln -sf /usr/share/misc/config.guess '{}' \;
+	find . -name config.sub \
+		-exec ln -sf /usr/share/misc/config.sub '{}' \;
+}
+
+dpatch_unpatch ()
+{
+	tar xf debian/patched/config.guess+sub.tar
+}
+
+DPATCH_LIB_NO_DEFAULT=1
+
+. /usr/share/dpatch/dpatch.lib.sh
+
+# arch-tag: 8a610a57-687b-4395-8ff2-79265c0a4eb3
--- erlang-10.b.9.orig/debian/patches/30kfreebsd.dpatch
+++ erlang-10.b.9/debian/patches/30kfreebsd.dpatch
@@ -0,0 +1,28 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 30kfreebsd.dpatch by  <neumann@lostwebsite.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad erlang-10.b.9~/erts/configure.in erlang-10.b.9/erts/configure.in
+--- erlang-10.b.9~/erts/configure.in	2006-05-14 21:44:35.000000000 -0400
++++ erlang-10.b.9/erts/configure.in	2006-05-14 21:45:46.000000000 -0400
+@@ -142,7 +142,7 @@
+ 
+ dnl NOTE: CPPFLAGS will be included in CFLAGS at the end
+ case $host_os in
+-    linux*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE";; 
++    *gnu*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE";; 
+     *) ;;
+ esac
+ 
+@@ -464,7 +464,7 @@
+ 	ENABLE_ALLOC_TYPE_VARS="$ENABLE_ALLOC_TYPE_VARS threads"
+ 	case $host_os in
+ 	    solaris*) AC_DEFINE(ENABLE_CHILD_WAITER_THREAD) ;;
+-	    linux*)
++	    *gnu*)
+ 		AC_DEFINE(USE_RECURSIVE_MALLOC_MUTEX)
+ 		# -D_GNU_SOURCE already defined in CFLAGS remove it
+ 		# from EMU_THR_DEFS
--- erlang-10.b.9.orig/debian/patches/01extract.dpatch
+++ erlang-10.b.9/debian/patches/01extract.dpatch
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+## preserve_bootstrap.dpatch
+##
+## DP: extract the main tarball.
+
+dpatch_patch () 
+{
+	tar -zxvf otp_src*.tar.gz
+	mv otp_src_R*/* .
+}
+
+dpatch_unpatch ()
+{
+	find -maxdepth 1 \
+		! -name "debian" -and \
+		! -name "otp_src_*.tar.gz" \
+		  -exec rm -rvf '{}' \;
+}
+
+DPATCH_LIB_NO_DEFAULT=1
+
+. /usr/share/dpatch/dpatch.lib.sh
--- erlang-10.b.9.orig/debian/patches/06install.dpatch
+++ erlang-10.b.9/debian/patches/06install.dpatch
@@ -0,0 +1,172 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 06install.dpatch by  <neumann@lostwebsite.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: [Old] Install changes
+
+@DPATCH@
+
+#DPATCHLEVEL=1
+--- erlang-10.b.7.orig/erts/etc/common/Install
++++ erlang-10.b.7/erts/etc/common/Install
+@@ -0,0 +1,160 @@
++#!/bin/sh
++# 
++#  Patch $ERL_ROOT/emulator/obj/Makefile.dist & make
++#
++#
++start_option=query
++while [ $# -ne 0 ]; do
++	case $1 in
++		-minimal) start_option=minimal ;;
++		-sasl)    start_option=sasl    ;;
++		*)        ERL_ROOT=$1          ;;
++	esac
++	shift
++done
++
++if [ -z "$ERL_ROOT" -o ! -d "$ERL_ROOT" ]
++then
++	echo "Install: need ERL_ROOT directory as argument"
++	exit 1
++fi
++
++if [ `echo $ERL_ROOT | awk '{ print substr($1,1,1) }'` != "/" ]
++then
++	echo "Install: need an absolute path to ERL_ROOT"
++	exit 1
++fi
++
++if [ ! -d $ERL_ROOT/erts-5.4.9/bin ]
++then
++	echo "Install: The directory $ERL_ROOT/erts-5.4.9/bin does not exist"
++	echo "         Bad location or erts module not un-tared"
++	exit 1
++fi
++
++if [ -d $ERL_ROOT/erts-5.4.9/obj ]
++then
++	cd $ERL_ROOT/erts-5.4.9/obj
++	sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" Makefile.src > Makefile
++fi
++
++if [ ! -d $ERL_ROOT/bin ]
++then
++        mkdir $ERL_ROOT/bin
++fi
++
++#
++# Fetch target system.
++#
++SYS=`(uname -s) 2>/dev/null` || SYS=unknown
++REL=`(uname -r) 2>/dev/null` || REL=unknown
++case $SYS:$REL in
++	        SunOS:5.*)
++	                TARGET=sunos5 ;;
++	        Linux:*)
++	                TARGET=linux ;;
++	        *)
++	                TARGET="" ;;
++esac
++
++cd $ERL_ROOT/erts-5.4.9/bin
++
++sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" erl.src > erl
++chmod 755 erl
++
++#
++# Create start file for embedded system use,
++#
++(cd $ERL_ROOT/erts-5.4.9/bin;
++  sed -e "s;%FINAL_ROOTDIR%;$ERL_ROOT;" start.src > start;
++  chmod 755 start)
++
++cd $ERL_ROOT/bin
++
++cp -p $ERL_ROOT/erts-5.4.9/bin/erl .
++cp -p $ERL_ROOT/erts-5.4.9/bin/erlc .
++
++#
++# Set a soft link to epmd
++# This should not be done for an embedded system!
++#
++
++# Remove old links first.
++if [ -h epmd ]; then
++  /bin/rm -f epmd
++fi
++
++ln -s $ERL_ROOT/erts-5.4.9/bin/epmd epmd
++
++cp -p $ERL_ROOT/erts-5.4.9/bin/run_erl .
++cp -p $ERL_ROOT/erts-5.4.9/bin/to_erl .
++cp -p $ERL_ROOT/erts-5.4.9/bin/start .
++sed -e "s;%EMU%;beam;" $ERL_ROOT/erts-5.4.9/bin/start_erl.src > start_erl
++chmod 755 start_erl
++
++if [ -d $ERL_ROOT/lib/sasl* ]
++then
++    (cd $ERL_ROOT/releases
++     echo 5.4.9 R10B > start_erl.data)
++     echo ""
++    (cd $ERL_ROOT/releases/R10B
++     echo ""
++     echo "Building SASL boot script ..."
++#     ERCL_EMULATOR="$ERL_ROOT/bin/erl +B -boot ./start" $ERL_ROOT/bin/erlc -s start_sasl.rel
++     $ERL_ROOT/bin/erl -noinput +B -boot ./start -s systools make_script start_sasl -s erlang halt
++     $ERL_ROOT/bin/erl -noinput +B -boot ./start -s release_handler create_RELEASES $ERL_ROOT start_sasl.rel -s erlang halt
++     echo "")
++fi
++
++
++if [ -f $ERL_ROOT/releases/R10B/start_sasl.boot ] && \
++   [ "$start_option" = "query" ]
++then
++    echo "Do you want to use a minimal system startup"
++    echo "instead of the SASL startup? (y/n) [n]: " | tr -d '\012'
++    read reply
++    case $reply in
++    [Yy]*)
++	start_option=minimal ;;
++    *)
++	start_option=sasl ;;
++    esac
++fi
++
++case $start_option in
++    minimal)
++	Name=start_clean ;;
++    sasl)
++	Name=start_sasl  ;;
++    *)
++	Name=start_sasl  ;;
++esac
++
++cp -p ../releases/R10B/start_*.boot .
++cp -p $Name.boot start.boot
++cp -p ../releases/R10B/$Name.script start.script
++
++#
++# We always run ranlib unless Solaris/SunOS 5
++# but ignore failures.
++#
++if [ "X$TARGET" != "Xsunos5" -a -d $ERL_ROOT/usr/lib ]; then 
++    cd $ERL_ROOT/usr/lib
++    for library in lib*.a
++    do
++	(ranlib $library) > /dev/null 2>&1
++    done
++fi
++
++
++#
++# Fixing the man pages
++#
++
++if [ -d $ERL_ROOT/man ]
++then
++    cd $ERL_ROOT
++    ./misc/format_man_pages $ERL_ROOT
++fi
++
++
--- erlang-10.b.9.orig/debian/patches/12preserve_bootstrap.dpatch
+++ erlang-10.b.9/debian/patches/12preserve_bootstrap.dpatch
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+## preserve_bootstrap.dpatch
+##
+## DP: "Port" the configure.in files to autoconf 2.5.
+
+dpatch_patch () 
+{
+    for i in `find -name configure.in` 
+    do
+      mv ${i} `dirname ${i}`/configure.ac
+    done
+}
+
+dpatch_unpatch ()
+{
+    for i in `find -name configure.ac`
+    do
+      mv ${i} `dirname ${i}`/configure.in
+    done
+}
+
+DPATCH_LIB_NO_DEFAULT=1
+
+. /usr/share/dpatch/dpatch.lib.sh
--- erlang-10.b.9.orig/debian/compat
+++ erlang-10.b.9/debian/compat
@@ -0,0 +1 @@
+4
--- erlang-10.b.9.orig/debian/erlang-base.patterns
+++ erlang-10.b.9/debian/erlang-base.patterns
@@ -0,0 +1,25 @@
+.*\.o$
+.*\.so$
+.*\.a$
+./usr/lib/erlang/Install
+./usr/lib/erlang/misc/format_man_pages
+./usr/lib/erlang/misc/makewhatis
+./usr/lib/erlang/releases.*$
+./usr/lib/erlang/bin/erl$
+./usr/lib/erlang/bin/erlc$
+./usr/lib/erlang/bin/run_erl$
+./usr/lib/erlang/bin/to_erl$
+./usr/lib/erlang/bin/start
+./usr/lib/erlang/bin/start_erl
+./usr/lib/erlang/bin/start_clean.boot
+./usr/lib/erlang/bin/start_sasl.boot
+./usr/lib/erlang/bin/start.boot
+./usr/lib/erlang/bin/start.script
+./usr/lib/erlang/lib/erl_interface-.*/bin/erl_call$
+./usr/lib/erlang/lib/orber-.*/priv/bin/obj_init_port$
+./usr/lib/erlang/lib/os_mon-.*/priv/bin/memsup$
+./usr/lib/erlang/lib/ssl-.*/priv/bin/ssl_esock$
+./usr/lib/erlang/lib/kernel-.*/ebin
+./usr/lib/erlang/lib/sasl-.*/ebin
+./usr/lib/erlang/lib/stdlib-.*/ebin
+./usr/lib/erlang/erts.*$
--- erlang-10.b.9.orig/debian/control
+++ erlang-10.b.9/debian/control
@@ -0,0 +1,143 @@
+Source: erlang
+Maintainer: Erlang Packagers <erlang-pkg-devel@lists.berlios.de>
+Uploaders: Torsten Werner <twerner@debian.org>
+Section: interpreters
+Priority: optional
+Standards-Version: 3.7.2
+Build-Depends: perl5, debhelper (>= 4.0.0), autoconf (>= 2.50), gawk | awk, openssl, libssl-dev, m4, libncurses5-dev, dpatch, autotools-dev
+
+
+Package: erlang-x11
+Architecture: all
+Pre-Depends: dpkg (>= 1.4.1.17)
+Depends: debianutils (>= 1.13.1), erlang-base (= ${Source-Version}) | erlang-base-hipe (= ${Source-Version}), erlang-nox (= ${Source-Version}), tk8.4 | wish
+Conflicts: erlang-base (<< ${Source-Version}), erlang-jams, erlang-jams-erl, erlang-dev, erlang-manpages (<< ${Bare-Source-Version}), erlang-doc-html (<< ${Bare-Source-Version}), erlang-src (<< ${Source-Version})
+Replaces: erlang (<< ${Source-Version})
+Suggests: erlang-manpages, erlang-doc-html
+Description: Concurrent, real-time, distributed functional language (X11 deps)
+ Open Source Erlang is a functional programming language designed at
+ the Ericsson Computer Science Laboratory.
+ .
+ Some of Erlang main features are:
+  Clear declarative syntax and is largely free from side-effects;
+  Builtin support for real-time, concurrent and distributed programming;
+  Designed for development of robust and continously operated programs;
+  Dynamic code replacement at runtime.
+ .
+ This package contains the architecture independent files which requires
+ tk8.4 which requires X11.
+
+
+Package: erlang-nox
+Architecture: all
+Pre-Depends: dpkg (>= 1.4.1.17)
+Depends: debianutils (>= 1.13.1), erlang-base (= ${Source-Version}) | erlang-base-hipe (= ${Source-Version})
+Conflicts: erlang-base (<< ${Source-Version}), erlang-jams, erlang-jams-erl, erlang-dev, erlang-manpages (<< ${Bare-Source-Version}), erlang-doc-html (<< ${Bare-Source-Version}), erlang-src (<< ${Source-Version})
+Replaces: erlang (<< ${Source-Version})
+Suggests: erlang-manpages, erlang-doc-html
+Description: Concurrent, real-time, distributed functional language (no X11 deps)
+ Open Source Erlang is a functional programming language designed at
+ the Ericsson Computer Science Laboratory.
+ .
+ Some of Erlang main features are:
+  Clear declarative syntax and is largely free from side-effects;
+  Builtin support for real-time, concurrent and distributed programming;
+  Designed for development of robust and continously operated programs;
+  Dynamic code replacement at runtime.
+ .
+ This package contains the architecture independent files that do not
+ depend on tk8.4.
+
+
+Package: erlang-base
+Architecture: any
+Recommends: erlang (= ${Source-Version})
+Depends: debconf (>=0.4.00) | debconf-2.0, ${shlibs:Depends}
+Conflicts: erlang (<< ${Source-Version}), erlang-base-hipe, erlang-src (<< ${Source-Version})
+Replaces: erlang (<< ${Source-Version}), erlang-base-hipe (<< ${Source-Version}), erlang-nox (<< ${Source-Version})
+Description: Concurrent, real-time, distributed functional language (virtual machine)
+ Open Source Erlang is a functional programming language designed at
+ the Ericsson Computer Science Laboratory.
+ .
+ Some of Erlang main features are:
+  Clear declarative syntax and is largely free from side-effects;
+  Builtin support for real-time, concurrent and distributed programming;
+  Designed for development of robust and continously operated programs;
+  Dynamic code replacement at runtime.
+ .
+ This package contains the architecture-specific runtime implementation,
+ which is configured and built without HIPE support and minimal set of
+ Erlang applications (kernel, sasl, stdlib).
+
+
+Package: erlang-base-hipe
+Architecture: any
+Recommends: erlang (= ${Source-Version})
+Depends: debconf (>=0.4.00) | debconf-2.0, ${shlibs:Depends}
+Conflicts: erlang (<< ${Source-Version}), erlang-base, erlang-src (<< ${Source-Version})
+Replaces: erlang (<< ${Source-Version}), erlang-base (<< ${Source-Version}), erlang-nox (<< ${Source-Version})
+Description: Concurrent, real-time, distributed functional language (HIPE virtual machine)
+ Open Source Erlang is a functional programming language designed at
+ the Ericsson Computer Science Laboratory.
+ .
+ Some of Erlang main features are:
+  Clear declarative syntax and is largely free from side-effects;
+  Builtin support for real-time, concurrent and distributed programming;
+  Designed for development of robust and continously operated programs;
+  Dynamic code replacement at runtime.
+ .
+ This package contains the architecture-specific runtime implementation,
+ which is configured and built with HIPE support and minimal set of
+ Erlang applications (kernel, sasl, stdlib).
+
+
+Package: erlang-src
+Architecture: all
+Recommends: erlang (= ${Source-Version})
+Depends: debconf (>=0.4.00) | debconf-2.0
+Conflicts: erlang (<< ${Source-Version}), erlang-base (<< ${Source-Version}), erlang-base-hipe (<< ${Source-Version}), erlang-nox (<< ${Source-Version}), erlang-x11 (<< ${Source-Version})
+Replaces: erlang (<< ${Source-Version})
+Description: Concurrent, real-time, distributed functional language (application sources)
+ Open Source Erlang is a functional programming language designed at
+ the Ericsson Computer Science Laboratory.
+ .
+ Some of Erlang main features are:
+  Clear declarative syntax and is largely free from side-effects;
+  Builtin support for real-time, concurrent and distributed programming;
+  Designed for development of robust and continously operated programs;
+  Dynamic code replacement at runtime.
+ .
+ This package contains the erlang source to all the applications in the
+ Erlang/OTP system.
+
+
+Package: erlang-mode
+Architecture: all
+Depends: erlang-base (= ${Source-Version}) | erlang-base-hipe (= ${Source-Version}), erlang-nox (= ${Source-Version}), emacsen-common
+Conflicts: erlang-manpages (<< ${Bare-Source-Version}), erlang-doc-html (<< ${Bare-Source-Version})
+Suggests: erlang-manpages, erlang-doc-html
+Description: Concurrent, real-time, distributed functional language (editing mode for Emacs)
+ This package includes the mode for editing Erlang programs in GNU Emacs.
+ This is the official software provided with the default Erlang/OTP
+ distribution from www.erlang.org
+
+
+Package: erlang
+Architecture: all
+Pre-Depends: dpkg (>= 1.4.1.17)
+Depends: erlang-base (= ${Source-Version}) | erlang-base-hipe (= ${Source-Version}), erlang-nox (= ${Source-Version}), erlang-x11 (= ${Source-Version}), erlang-mode (= ${Source-Version}), erlang-src (= ${Source-Version})
+Conflicts: erlang-jams, erlang-jams-erl, erlang-dev, erlang-manpages (<< ${Bare-Source-Version}), erlang-doc-html (<< ${Bare-Source-Version})
+Replaces: erlang-base (<< ${Source-Version}), erlang-base-hipe (<< ${Source-Version}), erlang-nox (<< ${Source-Version}), erlang-x11 (<< ${Source-Version}), erlang-mode (<< ${Source-Version}), erlang-src (<< ${Source-Version})
+Suggests: erlang-manpages, erlang-doc-html
+Description: Concurrent, real-time, distributed functional language
+ Open Source Erlang is a functional programming language designed at
+ the Ericsson Computer Science Laboratory.
+ .
+ Some of Erlang main features are:
+  Clear declarative syntax and is largely free from side-effects;
+  Builtin support for real-time, concurrent and distributed programming;
+  Designed for development of robust and continously operated programs;
+  Dynamic code replacement at runtime.
+ .
+ This package will install erlang librarires and runtime and the
+ Erlang editing mode for Emacs.
--- erlang-10.b.9.orig/debian/copyright
+++ erlang-10.b.9/debian/copyright
@@ -0,0 +1,338 @@
+This package was debianized by Brent A. Fulgham <bfulgham@debian.org> on
+Sat, 10 Aug 2002 23:16:47 -0700
+
+It was downloaded from the Erlang OTP Homepage at http://www.erlang.org.
+
+Authors:  (In Alphabetical Order)
+	  Stefan Anbratt, Ingela Anderton, Joe Armstrong, Gordon Beaton,
+	  Martin Bjorklund, Johan Blom, Hans Bolinder, Kent Boortz,
+	  Pascal Brisset, Richard Carlsson, Maurice Castro, Anders Dahlin,
+	  Jan-Erik Dahlin, Mick Dwyer, Klas Eriksson, Magnus Frieberg,
+	  Luke Gorrie <luke@vegetable.org>, Joakim Grebeno, Rickard Green,
+	  Dan Gudmundsson, Bjorn Gustavsson, Fredrik Gustafson,
+	  Bogumil Hausman, Per Hedeland, Peter Hogfeldt, Gunilla Hugosson,
+	  Erik Johansson, Arndt Jonasson, Micael Karlberg, Janne Lindblad,
+	  Anders Lindgren, Peter Lundel, Kenneth Lundin <kenneth@erix.ericsson.se>,
+	  Ulf Magnusson, Horkan Mattsson, Ingvar Meyer, Hans Nilsson,
+	  Mattias Nilsson, Raimo Niskanen, Patrik Nyblom, Sven-Olof Nystrom,
+	  Lennart Ohman, Peter Olin, Shawn Pearce <pearcs@rpi.edu>,
+	  Mikael Pettersson, Tony Rogvail <tony.rogvail@bluetail.com>,
+	  Kostis Sagonas, Ola Samuelsson, Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>,
+	  Sebastian Strollo <sebastian.strollo@bluetail.com>, Lars Thorsen,
+	  Fredrik Tillman, Torbjorn Tornquist, Markus Torpvret,
+	  Esko Vierumski, Robert Virding, Carl Wilhelm Welin, Sverker Wiberg,
+	  Jesper Wilhelmsson, Mike Williams, Claes Wikstrom, Patrik Winroth,
+	  Geoff Wong, Babbis Xagorarakis
+
+============================================================================
+This licence applies to lib/edoc and lib/syntax_tools
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+On Debian systems, the complete text of the GNU Lesser General Public
+License, version 2.1, can be found in /usr/share/common-licenses/LGPL-2.1
+
+============================================================================
+
+ERLANG PUBLIC LICENSE
+Version 1.1
+
+1. Definitions.
+
+1.1. ``Contributor'' means each entity that creates or contributes to
+the creation of Modifications.
+
+1.2. ``Contributor Version'' means the combination of the Original
+Code, prior Modifications used by a Contributor, and the Modifications
+made by that particular Contributor.
+
+1.3. ``Covered Code'' means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case
+including portions thereof.
+
+1.4. ``Electronic Distribution Mechanism'' means a mechanism generally
+accepted in the software development community for the electronic
+transfer of data.
+
+1.5. ``Executable'' means Covered Code in any form other than Source
+Code.
+
+1.6. ``Initial Developer'' means the individual or entity identified
+as the Initial Developer in the Source Code notice required by Exhibit
+A.
+
+1.7. ``Larger Work'' means a work which combines Covered Code or
+portions thereof with code not governed by the terms of this License.
+
+1.8. ``License'' means this document.
+
+1.9. ``Modifications'' means any addition to or deletion from the
+substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:
+
+A. Any addition to or deletion from the contents of a file containing
+   Original Code or previous Modifications. 
+
+B. Any new file that contains any part of the Original Code or
+   previous Modifications. 
+
+1.10. ``Original Code'' means Source Code of computer software code
+which is described in the Source Code notice required by Exhibit A as
+Original Code, and which, at the time of its release under this
+License is not already Covered Code governed by this License.
+
+1.11. ``Source Code'' means the preferred form of the Covered Code for
+making modifications to it, including all modules it contains, plus
+any associated interface definition files, scripts used to control
+compilation and installation of an Executable, or a list of source
+code differential comparisons against either the Original Code or
+another well known, available Covered Code of the Contributor's
+choice. The Source Code can be in a compressed or archival form,
+provided the appropriate decompression or de-archiving software is
+widely available for no charge.
+
+1.12. ``You'' means an individual or a legal entity exercising rights
+under, and complying with all of the terms of, this License. For legal
+entities,``You'' includes any entity which controls, is controlled by,
+or is under common control with You. For purposes of this definition,
+``control'' means (a) the power, direct or indirect, to cause the
+direction or management of such entity, whether by contract or
+otherwise, or (b) ownership of fifty percent (50%) or more of the
+outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and
+    distribute the Original Code (or portions thereof) with or without
+    Modifications, or as part of a Larger Work; and 
+
+(b) under patents now or hereafter owned or controlled by Initial
+    Developer, to make, have made, use and sell (``Utilize'') the
+    Original Code (or portions thereof), but solely to the extent that
+    any such patent is reasonably necessary to enable You to Utilize
+    the Original Code (or portions thereof) and not to any greater
+    extent that may be necessary to Utilize further Modifications or
+    combinations. 
+
+2.2. Contributor Grant.
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and
+    distribute the Modifications created by such Contributor (or
+    portions thereof) either on an unmodified basis, with other
+    Modifications, as Covered Code or as part of a Larger Work; and 
+
+(b) under patents now or hereafter owned or controlled by Contributor,
+    to Utilize the Contributor Version (or portions thereof), but
+    solely to the extent that any such patent is reasonably necessary
+    to enable You to Utilize the Contributor Version (or portions
+    thereof), and not to any greater extent that may be necessary to
+    Utilize further Modifications or combinations. 
+
+3. Distribution Obligations.
+
+3.1. Application of License.
+The Modifications which You contribute are governed by the terms of
+this License, including without limitation Section 2.2. The Source
+Code version of Covered Code may be distributed only under the terms
+of this License, and You must include a copy of this License with
+every copy of the Source Code You distribute. You may not offer or
+impose any terms on any Source Code version that alters or restricts
+the applicable version of this License or the recipients' rights
+hereunder. However, You may include an additional document offering
+the additional rights described in Section 3.5. 
+
+3.2. Availability of Source Code.
+Any Modification which You contribute must be made available in Source
+Code form under the terms of this License either on the same media as
+an Executable version or via an accepted Electronic Distribution
+Mechanism to anyone to whom you made an Executable version available;
+and if made available via Electronic Distribution Mechanism, must
+remain available for at least twelve (12) months after the date it
+initially became available, or at least six (6) months after a
+subsequent version of that particular Modification has been made
+available to such recipients. You are responsible for ensuring that
+the Source Code version remains available even if the Electronic
+Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which you contribute to contain a
+file documenting the changes You made to create that Covered Code and
+the date of any change. You must include a prominent statement that
+the Modification is derived, directly or indirectly, from Original
+Code provided by the Initial Developer and including the name of the
+Initial Developer in (a) the Source Code, and (b) in any notice in an
+Executable version or related documentation in which You describe the
+origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims.
+    If You have knowledge that a party claims an intellectual property
+    right in particular functionality or code (or its utilization
+    under this License), you must include a text file with the source
+    code distribution titled ``LEGAL'' which describes the claim and
+    the party making the claim in sufficient detail that a recipient
+    will know whom to contact. If you obtain such knowledge after You
+    make Your Modification available as described in Section 3.2, You
+    shall promptly modify the LEGAL file in all copies You make
+    available thereafter and shall take other steps (such as notifying
+    appropriate mailing lists or newsgroups) reasonably calculated to
+    inform those who received the Covered Code that new knowledge has
+    been obtained. 
+
+(b) Contributor APIs.
+    If Your Modification is an application programming interface and
+    You own or control patents which are reasonably necessary to
+    implement that API, you must also include this information in the
+    LEGAL file. 
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source
+Code, and this License in any documentation for the Source Code, where
+You describe recipients' rights relating to Covered Code. If You
+created one or more Modification(s), You may add your name as a
+Contributor to the notice described in Exhibit A. If it is not
+possible to put such notice in a particular Source Code file due to
+its structure, then you must include such notice in a location (such
+as a relevant directory file) where a user would be likely to look for
+such a notice. You may choose to offer, and to charge a fee for,
+warranty, support, indemnity or liability obligations to one or more
+recipients of Covered Code. However, You may do so only on Your own
+behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear than any such warranty,
+support, indemnity or liability obligation is offered by You alone,
+and You hereby agree to indemnify the Initial Developer and every
+Contributor for any liability incurred by the Initial Developer or
+such Contributor as a result of warranty, support, indemnity or
+liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the
+requirements of Section 3.1-3.5 have been met for that Covered Code,
+and if You include a notice stating that the Source Code version of
+the Covered Code is available under the terms of this License,
+including a description of how and where You have fulfilled the
+obligations of Section 3.2. The notice must be conspicuously included
+in any notice in an Executable version, related documentation or
+collateral in which You describe recipients' rights relating to the
+Covered Code. You may distribute the Executable version of Covered
+Code under a license of Your choice, which may contain terms different
+from this License, provided that You are in compliance with the terms
+of this License and that the license for the Executable version does
+not attempt to limit or alter the recipient's rights in the Source
+Code version from the rights set forth in this License. If You
+distribute the Executable version under a different license You must
+make it absolutely clear that any terms which differ from this License
+are offered by You alone, not by the Initial Developer or any
+Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code
+not governed by the terms of this License and distribute the Larger
+Work as a single product. In such a case, You must make sure the
+requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Code due to statute
+or regulation then You must: (a) comply with the terms of this License
+to the maximum extent possible; and (b) describe the limitations and
+the code they affect. Such description must be included in the LEGAL
+file described in Section 3.4 and must be included with all
+distributions of the Source Code. Except to the extent prohibited by
+statute or regulation, such description must be sufficiently detailed
+for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+
+This License applies to code to which the Initial Developer has
+attached the notice in Exhibit A, and to related Covered Code.
+
+6. CONNECTION TO MOZILLA PUBLIC LICENSE
+
+This Erlang License is a derivative work of the Mozilla Public
+License, Version 1.0. It contains terms which differ from the Mozilla
+Public License, Version 1.0.
+
+7. DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS'' BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR
+NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF
+THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE
+IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
+CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
+CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART
+OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER
+EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. All
+sublicenses to the Covered Code which are properly granted shall
+survive any termination of this License. Provisions which, by their
+nature, must remain in effect beyond the termination of this License
+shall survive.
+
+9. DISCLAIMER OF LIABILITY
+Any utilization of Covered Code shall not cause the Initial Developer
+or any Contributor to be liable for any damages (neither direct nor
+indirect).
+
+10. MISCELLANEOUS
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision is held to be unenforceable, such
+provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be construed by and in accordance with
+the substantive laws of Sweden. Any dispute, controversy or claim
+arising out of or relating to this License, or the breach, termination
+or invalidity thereof, shall be subject to the exclusive jurisdiction
+of Swedish courts, with the Stockholm City Court as the first
+instance.
+	
+EXHIBIT A.
+
+``The contents of this file are subject to the Erlang Public License,
+Version 1.1, (the "License"); you may not use this file except in
+compliance with the License. You should have received a copy of the
+Erlang Public License along with this software. If not, it can be
+retrieved via the world wide web at http://www.erlang.org/.
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+the License for the specific language governing rights and limitations
+under the License.
+
+The Initial Developer of the Original Code is Ericsson Utvecklings AB.
+Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
+AB. All Rights Reserved.''
+
--- erlang-10.b.9.orig/debian/rules
+++ erlang-10.b.9/debian/rules
@@ -0,0 +1,352 @@
+#!/usr/bin/make -f 
+
+# Please don't mind too much about BUILD_DIR,
+# it was originally from an experiment that I did
+# not keep in the package.  F-D
+
+DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+BUILD_HIPE := $(shell echo ${DEB_HOST_GNU_TYPE} | egrep -c "mipsel.*|sparc.*|s390.*|arm.*|mips.*|m68k.*|hppa.*" | sed -es/1/no/ -es/0/yes/)
+REL=$(shell ls -d otp_src_R*.tar.gz | sed "s/otp_src_//" | sed "s/\.tar.gz//")
+DH_VERBOSE=1
+BUILD_DIR=.
+VERSION=$(shell cat ${BUILD_DIR}/erts/vsn.mk | grep "^VSN" | sed "s/VSN = //")
+TOOLS_VSN=$(shell cat ${BUILD_DIR}/lib/tools/vsn.mk | grep "^TOOLS_VSN" | sed "s/TOOLS_VSN = //")
+SOURCE_VERSION=$(shell dpkg-parsechangelog | sed -ne's!^Version: \(.*\)-.*!\1!p')
+
+ifeq ($(BUILD_HIPE), no)
+ARCH_TARGETS=install-erlang-base
+INDEP_TARGETS=install-meta-erlang install-erlang-src install-erlang-mode install-erlang-x11 install-erlang-nox
+INSTALL_RULE=install-std
+else
+ARCH_TARGETS=install-erlang-base-hipe install-erlang-base
+INDEP_TARGETS=install-meta-erlang install-erlang-src install-erlang-mode install-erlang-x11 install-erlang-nox
+INSTALL_RULE=install-std install-hipe
+endif
+
+.PHONY: patch unpatch clean automake install build postinstall
+.PHONY: configure-std build-std install-std
+.PHONY: configure-hipe build-hipe install-hipe
+.PHONY: install-meta-erlang install-erlang-base install-erlang-base-hipe
+.PHONY: install-erlang-src install-erlang-nox install-erlang-x11 install-erlang-mode
+
+unpatch:
+	dh_testdir
+	dpatch deapply-all
+
+patch:
+	dh_testdir
+	dpatch apply-all
+
+automake: automake-stamp
+automake-stamp:
+	-for i in `find ${BUILD_DIR} -name configure.in -printf "%h\n"`; \
+	do \
+		echo "autoconf'ing $${i}"; \
+		(cd $${i} && autoconf) \
+	done
+	touch automake-stamp
+
+clean: patch
+	dh_testdir
+	dh_testroot
+
+	#-test -r /usr/share/misc/config.sub && \
+	#	cp -f /usr/share/misc/config.sub erts/autoconf/config.guess && \
+	#	cp -f /usr/share/misc/config.sub lib/erl_interface/src/auxdir/config.guess
+	#-test -r /usr/share/misc/config.guess && \
+	#	cp -f /usr/share/misc/config.guess erts/autoconf/config.sub && \
+	#	cp -f /usr/share/misc/config.guess lib/erl_interface/src/auxdir/config.sub
+
+	-rm -f *-stamp
+	-(cd ${BUILD_DIR} && ${MAKE} clean)
+	dh_clean
+
+configure-hipe: configure-hipe-stamp 
+configure-hipe-stamp: automake
+	dh_testdir
+	dh_testroot
+
+	-${MAKE} clean
+
+	(cd ${BUILD_DIR} && \
+	./configure --prefix=/usr --libexecdir=/usr/bin \
+		--infodir=/usr/share/info --mandir=/usr/share/man \
+		--enable-threads --enable-hipe --enable-kernel-poll)
+
+	echo "BUILDING WITH HIPE:" $(BUILD_HIPE)
+
+	touch configure-hipe-stamp
+
+configure-std: configure-std-stamp
+configure-std-stamp: automake
+	dh_testdir
+	dh_testroot
+
+	-${MAKE} clean
+
+	(cd ${BUILD_DIR} && \
+	./configure --prefix=/usr --libexecdir=/usr/bin			\
+		--infodir=/usr/share/info --mandir=/usr/share/man	\
+		--enable-threads --disable-hipe --enable-kernel-poll)
+	touch configure-std-stamp
+
+define do-install 
+	echo "*** do-install called."
+
+# Calls make install.
+	 (cd $(BUILD_DIR) && \
+	 ${MAKE} INSTALL_PREFIX=$(INSTALL_DIR) install)
+
+# Replace ROOTDIR in "erl" and "start" scripts for real rootdir
+# If there's no erl or start then it's better to fail than silently continue
+	for dir in $(INSTALL_DIR)/usr/lib/erlang/erts-$(VERSION)/bin		\
+		   $(INSTALL_DIR)/usr/lib/erlang/bin; do			\
+	    for val in erl start; do						\
+		sed -i 's!ROOTDIR=.*!ROOTDIR=/usr/lib/erlang!' $${dir}/$${val}; \
+	    done;								\
+	done
+
+# Correct ERL_ROOT in RELEASES file
+	sed 's!%ERL_ROOT%!/usr/lib/erlang!' \
+	    $(INSTALL_DIR)/usr/lib/erlang/releases/RELEASES.src \
+	    >$(INSTALL_DIR)/usr/lib/erlang/releases/RELEASES
+	-rm -f $(INSTALL_DIR)/usr/lib/erlang/releases/RELEASES.src
+
+# Get rid of windows cruft
+	-find $(INSTALL_DIR) -name *.bat -exec rm {} \;
+
+# Fix permissions
+	-mv $(INSTALL_DIR)/usr/lib/erlang/erts-$(VERSION)/bin/start_erl.src \
+	    $(INSTALL_DIR)/usr/lib/erlang/erts-$(VERSION)/bin/start_erl
+	-chmod 755 $(INSTALL_DIR)/usr/lib/erlang/erts-$(VERSION)/bin/start_erl
+	-chmod 644 $(INSTALL_DIR)/usr/lib/erlang/bin/start.script
+
+# Remove script sources
+	-rm -f $(INSTALL_DIR)/usr/lib/erlang/erts-$(VERSION)/bin/*.src
+
+# Remove useless ssl and crypto object files
+	-rm -rf $(INSTALL_DIR)/usr/lib/erlang/lib/crypto-*/priv/obj
+	-rm -rf $(INSTALL_DIR)/usr/lib/erlang/lib/ssl-*/priv/obj
+
+# Get rid of bad link in erlang package
+	-rm -f $(INSTALL_DIR)/usr/lib/erlang/bin/epmd
+	-find $(INSTALL_DIR)/usr/lib/erlang/lib -name info -exec rm {} \;
+	-rm -rf $(INSTALL_DIR)/usr/lib/erlang/erts-$(VERSION)/doc
+
+	-rm -rf $(INSTALL_DIR)/usr/bin/ear
+	-rm -rf $(INSTALL_DIR)/usr/bin/ecc
+	-rm -rf $(INSTALL_DIR)/usr/bin/elink
+	-rm -rf $(INSTALL_DIR)/usr/bin/escript
+endef
+
+# CC_R_FLAG and LD_R_FLAG are empty because Debian doesn't recommend
+# RPATH definition in binaries
+build-hipe: build-hipe-stamp 
+build-hipe-stamp: configure-hipe
+	dh_testdir
+	(cd ${BUILD_DIR} && ${MAKE} CC_R_FLAG= LD_R_FLAG=)
+	touch build-hipe-stamp
+
+build-std: build-std-stamp
+build-std-stamp: configure-std
+	dh_testdir
+	(cd ${BUILD_DIR} && ${MAKE} CC_R_FLAG= LD_R_FLAG=)
+	touch build-std-stamp
+
+install-hipe: install-hipe-stamp
+install-hipe-stamp: INSTALL_DIR=$(shell pwd)/debian/erlang-hipe
+install-hipe-stamp: build-hipe
+	dh_testdir
+	dh_testroot
+	$(do-install)
+	touch install-hipe-stamp
+
+install-std: install-std-stamp
+install-std-stamp: INSTALL_DIR=$(shell pwd)/debian/erlang-std
+install-std-stamp: build-std
+	dh_testdir
+	dh_testroot
+	$(do-install)
+	touch install-std-stamp
+
+# Very accurately place each installed file into the proper package
+# See this script and the debian/*.patterns files for more informations.
+postinstall: postinstall-stamp
+postinstall-stamp: ${INSTALL_RULE}
+	dh_testdir
+	sh debian/analyse.sh
+	(cd debian && \
+	 for i in *.in ; do \
+	     sed -e's/@VERSION@/$(VERSION)/g ; s/@TOOLS_VSN@/$(TOOLS_VSN)/g' <$$i >`basename $$i .in` ; \
+	 done)
+	 touch postinstall-stamp
+
+install-meta-erlang: postinstall
+	dh_testdir -perlang
+	dh_testroot -perlang
+	dh_installchangelogs -perlang
+	dh_installdocs -perlang
+	dh_link -perlang
+	dh_strip -perlang
+	dh_compress -perlang
+	dh_fixperms -perlang
+	dh_makeshlibs -perlang
+	dh_installdeb -perlang
+	echo "Bare-Source-Version=$(SOURCE_VERSION)" >> debian/erlang.substvars
+	dh_gencontrol -perlang
+	dh_md5sums -perlang
+	dh_builddeb -perlang
+
+install-erlang-base-hipe: install-hipe postinstall
+	dh_testdir
+	dh_testroot
+
+	dh_install --sourcedir=debian/erlang-hipe -perlang-base-hipe
+	install -D -m 644 debian/erlang-base-hipe.lintian-override \
+		`pwd`/debian/erlang-base-hipe/usr/share/lintian/overrides/erlang-base-hipe
+
+	dh_installdirs -perlang-base-hipe
+	dh_installdocs -perlang-base-hipe
+	dh_installexamples -perlang-src
+	dh_installchangelogs -perlang-base-hipe
+	dh_installmenu -perlang-base-hipe
+	dh_link -perlang-base-hipe
+	dh_strip -perlang-base-hipe
+	dh_compress -perlang-base-hipe
+	dh_fixperms -perlang-base-hipe
+	dh_installdeb -perlang-base-hipe
+	dh_shlibdeps -perlang-base-hipe
+	echo "Bare-Source-Version=$(SOURCE_VERSION)" >> debian/erlang-base-hipe.substvars
+	dh_gencontrol -perlang-base-hipe
+	dh_makeshlibs -perlang-base-hipe
+	dh_md5sums -perlang-base-hipe
+	dh_builddeb -perlang-base-hipe
+
+install-erlang-src: postinstall
+	dh_testdir
+	dh_testroot
+
+	dh_install --sourcedir=debian/erlang-std -perlang-src
+
+	dh_installdirs -perlang-src
+	dh_installdocs -perlang-src
+	dh_installexamples -perlang-src
+	dh_installchangelogs -perlang-src
+	dh_installmenu -perlang-src
+	dh_link -perlang-src
+	dh_strip -perlang-src
+	dh_compress -perlang-src
+	dh_fixperms -perlang-src
+	dh_installdeb -perlang-src
+	dh_shlibdeps -perlang-src
+	echo "Bare-Source-Version=$(SOURCE_VERSION)" >> debian/erlang-src.substvars
+	dh_gencontrol -perlang-src
+	dh_makeshlibs -perlang-src
+	dh_md5sums -perlang-src
+	dh_builddeb -perlang-src
+
+install-erlang-base: install-std postinstall
+	dh_testdir
+	dh_testroot
+
+	dh_install --sourcedir=debian/erlang-std -perlang-base 
+	install -D -m 644 debian/erlang-base.lintian-override \
+		`pwd`/debian/erlang-base/usr/share/lintian/overrides/erlang-base
+
+	dh_installdirs -perlang-base
+	dh_installdocs -perlang-base
+	dh_installexamples -perlang-base
+	dh_installchangelogs -perlang-base
+	dh_installmenu -perlang-base
+	dh_link -perlang-base
+	dh_strip -perlang-base
+	dh_compress -perlang-base
+	dh_fixperms -perlang-base
+	dh_installdeb -perlang-base
+	dh_shlibdeps -perlang-base
+	echo "Bare-Source-Version=$(SOURCE_VERSION)" >> debian/erlang-base.substvars
+	dh_gencontrol -perlang-base
+	dh_makeshlibs -perlang-base
+	dh_md5sums -perlang-base
+	dh_builddeb -perlang-base
+
+install-erlang-nox: postinstall
+	dh_testdir
+	dh_testroot
+
+	mkdir -p debian/erlang-nox/usr/share/icons
+	install -m 644 `pwd`/debian/erlang.xpm `pwd`/debian/erlang-nox/usr/share/icons/
+	install -D -m 644 debian/erlang-nox.lintian-override \
+		`pwd`/debian/erlang-nox/usr/share/lintian/overrides/erlang-nox
+	dh_install --sourcedir=debian/erlang-std -perlang-nox 
+
+	dh_installdirs -perlang-nox
+	dh_installdocs -perlang-nox
+	dh_installexamples -perlang-nox
+	dh_installmenu -perlang-nox
+	dh_installchangelogs -perlang-nox
+	dh_link -perlang-nox
+	dh_strip -perlang-nox
+	dh_compress -perlang-nox
+	dh_fixperms -perlang-nox
+	dh_installdeb -perlang-nox
+	dh_shlibdeps -perlang-nox
+	echo "Bare-Source-Version=$(SOURCE_VERSION)" >> debian/erlang-nox.substvars
+	dh_gencontrol -perlang-nox
+	dh_makeshlibs -perlang-nox
+	dh_md5sums -perlang-nox
+	dh_builddeb -perlang-nox
+
+install-erlang-x11: postinstall
+	dh_testdir
+	dh_testroot
+
+	install -D -m 644 debian/erlang-x11.lintian-override \
+		`pwd`/debian/erlang-x11/usr/share/lintian/overrides/erlang-x11
+	dh_install --sourcedir=debian/erlang-std -perlang-x11
+
+	dh_installdirs -perlang-x11
+	dh_installdocs -perlang-x11
+	dh_installexamples -perlang-x11
+	dh_installmenu -perlang-x11
+	dh_installchangelogs -perlang-x11
+	dh_link -perlang-x11
+	dh_strip -perlang-x11
+	dh_compress -perlang-x11
+	dh_fixperms -perlang-x11
+	dh_installdeb -perlang-x11
+	dh_shlibdeps -perlang-x11
+	echo "Bare-Source-Version=$(SOURCE_VERSION)" >> debian/erlang-x11.substvars
+	dh_gencontrol -perlang-x11
+	dh_makeshlibs -perlang-x11
+	dh_md5sums -perlang-x11
+	dh_builddeb -perlang-x11
+
+install-erlang-mode: postinstall
+	dh_testdir
+	dh_testroot
+	dh_installdirs -perlang-mode
+	dh_installdocs -perlang-mode
+	dh_installemacsen -perlang-mode
+	dh_link -perlang-mode
+	dh_installchangelogs -perlang-mode
+	dh_strip -perlang-mode
+	dh_compress -perlang-mode
+	dh_installdeb -perlang-mode
+	echo "Bare-Source-Version=$(SOURCE_VERSION)" >> debian/erlang-mode.substvars
+	dh_gencontrol -perlang-mode
+	dh_md5sums -perlang-mode
+	dh_builddeb -perlang-mode
+
+binary-std: install-erlang-base
+binary-hipe:  install-erlang-mode install-erlang-nox install-erlang-x11 install-erlang-base-hipe install-erlang-src
+
+#binary-arch: install-erlang-base-hipe install-erlang-base
+#binary-indep: install-meta-erlang install-erlang-src install-erlang-mode install-erlang-x11 install-erlang-nox
+binary-arch: ${ARCH_TARGETS}
+binary-indep: ${INDEP_TARGETS}
+
+source diff:                                                                  
+	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+binary: binary-indep binary-arch
--- erlang-10.b.9.orig/debian/erlang-nox.lintian-override
+++ erlang-10.b.9/debian/erlang-nox.lintian-override
@@ -0,0 +1,2 @@
+erlang-nox: image-file-in-usr-lib
+erlang-nox: menu-command-not-in-package
--- erlang-10.b.9.orig/debian/erlang-base.lintian-override
+++ erlang-10.b.9/debian/erlang-base.lintian-override
@@ -0,0 +1,2 @@
+erlang-base: binary-without-manpage erlc
+erlang-base: binary-without-manpage erl
--- erlang-10.b.9.orig/debian/erlang-mode.emacsen-remove
+++ erlang-10.b.9/debian/erlang-mode.emacsen-remove
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+# /usr/lib/emacsen-common/packages/remove/#PACKAGE#
+
+FLAVOR=$1
+PACKAGE=erlang
+
+if [ ${FLAVOR} != emacs ]; then
+    if test -x /usr/sbin/install-info-altdir; then
+        echo remove/${PACKAGE}: removing Info links for ${FLAVOR}
+        install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/#PACKAGE#.info.gz
+    fi
+
+    echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR}
+    rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+fi
--- erlang-10.b.9.orig/debian/erlang-base-hipe.patterns
+++ erlang-10.b.9/debian/erlang-base-hipe.patterns
@@ -0,0 +1,26 @@
+.*\.o$
+.*\.so$
+.*\.a$
+./usr/lib/erlang/Install
+./usr/lib/erlang/misc/format_man_pages
+./usr/lib/erlang/misc/makewhatis
+./usr/lib/erlang/releases.*$
+./usr/lib/erlang/bin/erl$
+./usr/lib/erlang/bin/erlc$
+./usr/lib/erlang/bin/run_erl$
+./usr/lib/erlang/bin/to_erl$
+./usr/lib/erlang/bin/start
+./usr/lib/erlang/bin/start_erl
+./usr/lib/erlang/bin/start_clean.boot
+./usr/lib/erlang/bin/start_sasl.boot
+./usr/lib/erlang/bin/start.boot
+./usr/lib/erlang/bin/start.script
+./usr/lib/erlang/lib/erl_interface-.*/bin/erl_call$
+./usr/lib/erlang/lib/orber-.*/priv/bin/obj_init_port$
+./usr/lib/erlang/lib/os_mon-.*/priv/bin/memsup$
+./usr/lib/erlang/lib/ssl-.*/priv/bin/ssl_esock$
+./usr/lib/erlang/lib/hipe.*/ebin/.*$
+./usr/lib/erlang/lib/kernel-.*/ebin
+./usr/lib/erlang/lib/sasl-.*/ebin
+./usr/lib/erlang/lib/stdlib-.*/ebin
+./usr/lib/erlang/erts.*$
--- erlang-10.b.9.orig/debian/erlang-mode.emacsen-startup
+++ erlang-10.b.9/debian/erlang-mode.emacsen-startup
@@ -0,0 +1,12 @@
+;; installed in a subdirectory of the respective site-lisp directory.
+;; We have to add this to the load-path:
+(setq load-path (cons (concat "/usr/share/"
+		(symbol-name debian-emacs-flavor)
+		"/site-lisp/erlang") load-path))
+(setq erlang-root-dir "/usr/lib/erlang")
+(setq exec-path (cons "/usr/lib/erlang/bin" exec-path))
+(require 'erlang-start)
+
+;; (setq auto-mode-alist (cons '("\\.erl$" . erlang-mode) auto-mode-alist))
+;; (setq auto-mode-alist (cons '("\\.hrl$" . erlang-mode) auto-mode-alist))
+																						  
--- erlang-10.b.9.orig/debian/erlang-base.links.in
+++ erlang-10.b.9/debian/erlang-base.links.in
@@ -0,0 +1,3 @@
+usr/lib/erlang/erts-@VERSION@/bin/epmd	usr/lib/erlang/bin/epmd
+usr/lib/erlang/bin/erlc		usr/bin/erlc
+usr/lib/erlang/erts-@VERSION@/bin/erl         usr/bin/erl
--- erlang-10.b.9.orig/debian/analyse.sh
+++ erlang-10.b.9/debian/analyse.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+echo "Determining which files goes where through \
+the magic of regular expressions."
+
+# Pretty dead simple.  The pattern files include
+# regular expression that match some files.  Files that
+# match patterns in binary.patterns go into the base
+# package.  Same goes for the X11 package.  Files
+# that don't match anything go into the NO-X package etc.
+
+# Files that match here might also go into
+# erlang-base-hipe.install.
+
+echo "erlang-base"
+find debian/erlang-std -type f | \
+    grep -E -f debian/erlang-base.patterns | \
+    cut -c 19- > debian/erlang-base.install
+
+echo "erlang-base-hipe"
+find debian/erlang-hipe -type f | \
+    grep -E -f debian/erlang-base-hipe.patterns | \
+    cut -c 20- > debian/erlang-base-hipe.install
+
+# Here, files that matched above shouldn't
+# be looked at.
+
+echo "erlang-x11"
+find debian/erlang-std -type f | \
+    grep -v -E -f debian/erlang-base.patterns | \
+    grep -v -E -f debian/erlang-base-hipe.patterns | \
+    grep -E -f debian/erlang-x11.patterns | \
+    cut -c 19- > debian/erlang-x11.install
+
+echo "erlang-src"
+find debian/erlang-std -type f | \
+    grep -E -e './usr/lib/erlang/usr/include' | \
+    cut -c 19- | sed -e 's!$! usr/include/erlang!' > debian/erlang-src.install
+
+find debian/erlang-std -type f | \
+    grep -v -E -f debian/erlang-base.patterns | \
+    grep -v -E -f debian/erlang-base-hipe.patterns | \
+    grep -v -E -f debian/erlang-x11.patterns | \
+    grep -E -f debian/erlang-src.patterns | \
+    cut -c 19- >> debian/erlang-src.install
+
+echo "erlang-nox"
+find debian/erlang-std -type f | \
+    grep -v -E -f debian/erlang-base.patterns | \
+    grep -v -E -f debian/erlang-base-hipe.patterns | \
+    grep -v -E -f debian/erlang-x11.patterns | \
+    grep -v -E -e './usr/lib/erlang/usr/include' | \
+    grep -v -E -f debian/erlang-src.patterns | \
+    cut -c 19- > debian/erlang-nox.install
+
--- erlang-10.b.9.orig/debian/erlang-mode.emacsen-install
+++ erlang-10.b.9/debian/erlang-mode.emacsen-install
@@ -0,0 +1,46 @@
+#! /bin/sh -e
+# /usr/lib/emacsen-common/packages/install/#PACKAGE#
+
+# Written by Jim Van Zandt <jrv@vanzandt.mv.com>, borrowing heavily
+# from the install scripts for gettext by Santiago Vila
+# <sanvila@ctv.es> and octave by Dirk Eddelbuettel <edd@debian.org>.
+
+FLAVOR=$1
+PACKAGE=erlang
+
+if [ ${FLAVOR} = emacs ]; then exit 0; fi
+
+echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
+
+FLAVORTEST=`echo $FLAVOR | cut -c-6`
+if [ ${FLAVORTEST} = xemacs ] ; then
+    SITEFLAG="-no-site-file"
+else
+    SITEFLAG="--no-site-file"
+fi
+FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"
+
+ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
+ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+
+# Install-info-altdir does not actually exist. 
+# Maybe somebody will write it.
+if test -x /usr/sbin/install-info-altdir; then
+    echo install/${PACKAGE}: install Info links for ${FLAVOR}
+    install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/info/${PACKAGE}.info.gz
+fi
+
+install -m 755 -d ${ELCDIR}
+cd ${ELDIR}
+FILES=`echo *.el`
+cp ${FILES} ${ELCDIR}
+cd ${ELCDIR}
+
+cat << EOF > path.el
+(setq load-path (cons "." load-path) byte-compile-warnings nil)
+EOF
+${FLAVOR} ${FLAGS} ${FILES}
+rm -f *.el path.el
+
+exit 0
+
--- erlang-10.b.9.orig/debian/erlang.xpm
+++ erlang-10.b.9/debian/erlang.xpm
@@ -0,0 +1,41 @@
+/* XPM */
+static char * erlang_xpm[] = {
+"32 32 6 1",
+" 	c None",
+".	c #FFFFFF",
+"+	c #800000",
+"@	c #808080",
+"#	c #FF0000",
+"$	c #000000",
+"................................",
+".++++...........+...........+++.",
+".+++..........+++++.........+++.",
+".+++.........+++++++........@++.",
+".++.........++++++++.........++.",
+".++.........++++++++.........++.",
+".+............................+.",
+".+............................+.",
+".+............................+.",
+".+............................+.",
+".+............................+.",
+".+..........+++++++++++++++++++.",
+".+..........+++++++++++++++++++.",
+".+..........+++++++++++++++++++.",
+".+..........+++++++++++++++++++.",
+".+..........+++++++++++++++++++.",
+".+..........+++++++++++++..++++.",
+".++..........++++++++++++...@++.",
+".++..........@++++++++++......+.",
+".+++..........+++++++++.......+.",
+".+++...........+++++++.......++.",
+".+++#............+++........@++.",
+".++++.......................+++.",
+"................................",
+"................................",
+"................................",
+".$$..$$$...$....$$...$..$...$$$.",
+".$...$..$..$....$$...$$.$..$....",
+".$$..$$$...$....$$...$.$$..$.$$.",
+".$...$.$...$...$$$$..$..$..$..$.",
+".$$..$..$..$$$.$..$..$..$...$$..",
+"................................"};
--- erlang-10.b.9.orig/debian/erlang-x11.patterns
+++ erlang-10.b.9/debian/erlang-x11.patterns
@@ -0,0 +1,18 @@
+./usr/lib/erlang/lib/gs-.*/ebin/.*$
+./usr/lib/erlang/lib/gs-.*/priv/.*$
+./usr/lib/erlang/lib/gs-.*/contribs/bonk/.*$
+./usr/lib/erlang/lib/gs-.*/contribs/cols/.*$
+./usr/lib/erlang/lib/gs-.*/contribs/mandel/.*$
+./usr/lib/erlang/lib/gs-.*/contribs/othello/.*$
+./usr/lib/erlang/lib/pman-.*/ebin/.*$
+./usr/lib/erlang/lib/pman-.*/priv/.*$
+./usr/lib/erlang/lib/appmon-.*/ebin/.*$
+./usr/lib/erlang/lib/appmon-.*/priv/.*$
+./usr/lib/erlang/lib/debugger-.*/ebin/.*$
+./usr/lib/erlang/lib/debugger-.*/priv/.*$
+./usr/lib/erlang/lib/toolbar-.*/ebin/.*$
+./usr/lib/erlang/lib/tv-.*/ebin/.*$
+./usr/lib/erlang/lib/tv-.*/priv/.*$
+./usr/lib/erlang/lib/et-.*/ebin/.*$
+./usr/lib/erlang/lib/observer-.*/ebin/.*$
+./usr/lib/erlang/lib/observer-.*/priv/.*$	
--- erlang-10.b.9.orig/debian/changelog
+++ erlang-10.b.9/debian/changelog
@@ -0,0 +1,599 @@
+erlang (1:10.b.9-5ipsyn) unstable; urgency=low
+
+  * backport to sarge 
+
+ -- JLB <jlb@ipsyn.net>  Wed,  7 Jun 2006 17:29:20 +0200
+
+erlang (1:10.b.9-5) unstable; urgency=low
+
+  * Sergei Golovan noticed that on platforms supporting HiPE, erlang-
+    base and erlang-base-hipe and configured the same way.  Fixed.
+  * New maintainers: Erlang Packagers
+  [ Sergei Golovan ]
+  * Removed unused files (updvsn, preservebeam, extrafiles, erlang-doc.docs,
+    *.install).
+  * Removed unnecessary patches from patches/00list.
+  * Made templates from erlang-base.links, erlang-mode.links,
+    erlang-base-hipe.links. Replaced explicit version numbers to version
+    templates.
+  * Corrected dependencies in control file (replaced erlang-base-hipe by
+    erlang-base because erlang-base-hipe is not always available, made all
+    packages conflict with erlang-manpages and erlang-doc-html with
+    incompatible versions).
+  * Cleaned up lintian override files.
+  * Made installing erlang with and without HIPE to debian/erlang-hipe and
+    debian/erlang-std respectively (making debugging easier). Rewrote install
+    part of the script (made it removing some src files and object files from
+    ssl and crypto applications). Made some cleanups in rules.
+  * Fixed warnings of missing final newline in several files.
+  * Added menu entries to erlang-nox and erlang-x11 packages (since they use
+    /usr/bin/erl which is not present in these packages, there are also new
+    entries in lintian override files).
+  * Added supervisor performance improvement patch
+    (http://support.process-one.net/browse/EJAB-19).
+  * Added epoll support patch
+    (http://developer.sipphone.com/ejabberd/erlang_epoll_patch/).
+  * Restored patch which makes erl -man searching manual pages in the
+    standard locations.
+  * Moved sasl and stdlib beams from erlang-nox to erlang-base-hipe and
+    erlang-base packages making them usable without erlang-nox.
+  * Closes: #367996
+  * Replaced Ericcson by Ericsson in control file (Closes: #368808)
+  * Added conflicts of erlang-nox, erlang-x11, erlang-base, erlang-base-hipe
+    with erlang-src of incompatible version.
+
+ -- Erlang Packagers <erlang-pkg-devel@lists.berlios.de>  Mon, 29 May 2006 00:48:11 +0400
+
+erlang (1:10.b.9-4) unstable; urgency=low
+
+  [ Francois-Denis Gonthier ]
+  * Disables HiPE build for hppa64 and m68k.
+  * Upgraded policy version.
+
+  [ Torsten Werner ]
+  * disabled HiPE build an arm (not only armv4l)
+  * added myself to the Uploaders: field in debian/control
+
+ -- Torsten Werner <twerner@debian.org>  Tue, 16 May 2006 17:35:41 +0200
+
+erlang (1:10.b.9-3) unstable; urgency=low
+
+  * Closes: #366398: Same has #358410.
+  * Closes: #357134: NMU of Luk Claes.  Most of those errors were already
+    fixed in the new package.  Thanks.
+  * Closes: #358179: Removed the copy of the LGPL in the copyright file.
+    I've put the required shorter text.
+  * Disabled HiPE build for mips, arm, mipsel, s390 and sparc, in hope
+    that it fixe FTBS on those platforms.
+  * Closes: #358410.  erlang-src and erlang-mode are now Architecture:
+    all.
+  * erlang-nox and erlang-x11 are now built as arch-dependant targets
+    since, practically, they depend on one of erlang-runtime to be
+    built.
+  * Added a link from /usr/lib/erlang/usr/include to /usr/include/erlang
+    to fix potential FTBS of dependencies of Erlang.
+  * cant install erlang package (dependencie problem) (Closes: #366398)
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Mon,  8 May 2006 21:06:21 -0400
+
+erlang (1:10.b.9-2) unstable; urgency=low
+
+  * Closes: #333853, moved driver_int.h and erl_driver.h to
+    /usr/include.
+  * Closes: #331817, added debconf-2.0 alternative to erlang
+    dependencies.
+  * Closes: #344118, added a missing "," in Depends in the
+    control file.
+  * Removed dependency to bash v3, which means Erlang 10.b.9-2 is
+    backportable to Sarge thanks to Sergei Golovan.
+  * 10.b.9-1 was a test version that was announced on the erlang-
+    questions mailing list.
+  * erlang-manpages: Manpages are not where erl -man looks for them
+    (Closes: #348333). erl -man is now using the standard manual path
+    and MANSECT=1:3erl:4:6.
+  * /usr/bin/ear is a dangling symlink (Closes: #346548)
+  * Removed ear, ecc, elink, escript, which are bad links produced even
+    by the standard erlang install (I sure should ask erlang-questions
+    about those).
+  * FTBFS: build-depends on removed xlibs-dev (Closes: #346655)
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Tue, 24 Jan 2006 13:07:19 -0500
+
+erlang (1:10.b.9-1) unstable; urgency=low
+
+  * New upstream version.
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Wed, 14 Dec 2005 11:42:47 -0500
+
+erlang (1:10.b.8-2) unstable; urgency=low
+
+  * HiPE-enabled binaries are now put in their own package.
+  * Source files (*.erl, *.hrl, *.c and *.h) are now put in their own
+    package since they are not required to use the system.
+  * Well, I have dpatch'ified the thing but since I now use svn-
+    buildpackage locally, the patches are not rather useless.
+  * Closes: #333853
+  * Closes: #331817
+  * Major rules overhaul.  I've had some problems getting some targets
+    to run twice but I worked around them.
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Mon, 28 Nov 2005 14:44:55 -0500
+
+erlang (1:10.b.8-1) unstable; urgency=low
+
+  * new upstream version
+  * fully dpatch'ified.
+  * Emacs editing mode pulled from the main package and put into it's
+    own erlang-mode package.
+  * As it was suggested a few times, I've splitted the main arch-
+    independent package in two.  There is now an erlang-nox package
+    which include the base applications that don't require tk8.4 to
+    work.  The applications that depend on gs and thus on tk8.4 and now
+    in erlang-x11.
+  * The files that go in the 3 packages are now determined using regular
+    expressions.  See analyse.sh for details.
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Tue,  1 Nov 2005 23:24:01 -0500
+
+erlang (1:10.b.7-2) unstable; urgency=low
+
+  * Now using autooconf2.5x
+  * The whole package is now dpatch'ified.
+  * I've simplified the aggressive cleaning done in the clean phase of
+    debian/rules.  It doesn't mean that it was wrong, but right now I
+    don't fully understand the need for it.  I take care of preserving
+    the pristine content of the bootstrap directory instead of using the
+    weird preservebeam script.  I suspect that might be causing some
+    problems on some plateforms althought I don't really know why.
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Wed, 28 Sep 2005 00:02:28 -0400
+
+erlang (1:10.b.7-1) unstable; urgency=low
+
+  * new upstream version
+  * Closes: #317456 #310741
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Mon,  5 Sep 2005 20:59:45 -0400
+
+erlang (1:10.b.5-1) unstable; urgency=low
+
+  * new upstream version
+  * Still Closes: #307725
+  * A remaining rpath problem has been fixed by a change in
+    make/configure.in.  I hope it won't break anything else.
+  * Moved a few binary file from erlang to erlang-base.  Apparently they
+    were binary executable files.
+  * I guess it Closes: #298076 too.
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Sat, 14 May 2005 17:47:38 -0400
+
+erlang (1:10.b.4-3) unstable; urgency=low
+
+  * Fixes updvsn which did not detect all version change and left some
+    old directories behind.
+  * Change O3 for O2 in erts/emulator/Makefile.in (thanks Will Newton)
+  * Still not uploaded so: New Maintainer (Closes: #307725)
+  * Removed dependency on sed since it's a build essential
+  * Removed debian/conffiles, which is not useful.
+  * Manually removed SSH & ODBC apps which were empty (thanks Nicolas
+    Niclausse)
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Wed, 11 May 2005 10:58:03 -0400
+
+erlang (1:10.b.4-2) unstable; urgency=low
+
+  * New maintainer (Closes: #307725)
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Mon,  9 May 2005 23:17:42 -0400
+
+erlang (1:10.b.4-1) unstable; urgency=low
+
+  * new upstream version
+
+ -- Francois-Denis Gonthier <neumann@lostwebsite.net>  Thu,  5 May 2005 14:45:00 -0400
+
+erlang (1:10.b.1a-2.2) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * High-urgency upload for sarge-targetted RC bugfix
+  * Build with --disable-hipe on everything but amd64 (not just on i386),
+    for compatibility with 2.4 kernels in sarge; thanks to Lars
+    Wirzenius for tracking this down.  Closes: #276800.
+
+ -- Steve Langasek <vorlon@debian.org>  Sat, 12 Mar 2005 01:27:58 -0800
+
+erlang (1:10.b.1a-2.1) unstable; urgency=high
+
+   * NMU
+   * configure --disable-hipe on i386, (Closes: #276800)
+
+ -- Frank Lichtenheld <djpig@debian.org>  Sat, 12 Mar 2005 14:50:16 +0100
+
+erlang (1:10.b.1a-2) unstable; urgency=low
+
+  * Rebuild with corrected pathnames to libraries (remove duplicates).
+  * Compiled with -fPIC to support RISC (among others).
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Wed, 24 Nov 2004 20:07:57 -0800
+
+erlang (1:10.b.1a-1) unstable; urgency=low
+
+  * New upstream release:
+    - Compiler optimizations.
+    - Runtime memory use error.
+    - Better support for the new try/catch syntax.
+    - Emulator crash with bignums corrected.
+    - HIPE updated to correct a bug that caused the emulator to crash.
+  * Added a 'conflicts' with libxmerl-erlang, since 'xmerl' is now
+    distributed with Erlang OTP.  Perhaps we need some way to allow this
+    to be upgraded if xmerl has interim releases...
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Fri, 19 Nov 2004 23:36:41 -0800
+
+erlang (1:10.b.0-2) unstable; urgency=low
+
+  * Fix erlc:  VSN value changed and I didn't catch it.  Revised build
+    script to extract correct version from sources so I don't make this
+    mistake again.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sun, 10 Oct 2004 14:01:06 -0700
+
+erlang (1:10.b.0-1) unstable; urgency=low
+
+  * New upstream release.
+  * Numbering now matches upstream.
+  * Correct package description duplication.  (Closes:#275595)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Wed,  6 Oct 2004 22:07:42 -0700
+
+erlang (1:9.2.2-6) unstable; urgency=low
+
+  * Include crypto support.  (Closes:#270629)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Mon, 27 Sep 2004 21:12:45 -0700
+
+erlang (1:9.2.2-5) unstable; urgency=low
+
+  * Correct s390 build bug (autoconf/config.guess returns triplet
+    s390-ibm-linux, rather than the s390-ibm-linux-gnu expected by
+    config.sub and others.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Thu,  2 Sep 2004 00:29:45 -0700
+
+erlang (1:9.2.2-4) unstable; urgency=low
+
+  * A few more cleanups.  (Closes:#263590).
+  * Add lintian-override for binaries-without-manpage, since these
+    manpages are all provided in the erlang-manpages package.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sat, 28 Aug 2004 17:12:12 -0700
+
+erlang (1:9.2.2-3) unstable; urgency=low
+
+  * Build with Tcl/Tk 8.4 to be more "modern".
+  * Provide better cleanup.  Thanks to David N. Welton for
+    the fix.  (Closes#263590).
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Fri,  6 Aug 2004 23:36:28 -0700
+
+erlang (1:9.2.2-2) unstable; urgency=low
+
+  * Include dependency on Tcl/Tk 8.3 to allow gs to work.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sat, 31 Jul 2004 18:53:58 -0700
+
+erlang (1:9.2.2-1) unstable; urgency=low
+
+  * New upstream release.
+  * Highlights:  Some performance improvements, some bug fixes.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Thu, 24 Jun 2004 22:49:25 -0700
+
+erlang (1:9.2.1-5) unstable; urgency=low
+
+  * Before someone files a bug:  ecc conflicts with elastiC, so
+    change link to "erl-ecc".
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sat, 19 Jun 2004 09:24:24 -0700
+
+erlang (1:9.2.1-4) unstable; urgency=low
+
+  * A few straggling links to ear, escript.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sun, 13 Jun 2004 00:55:23 -0700
+
+erlang (1:9.2.1-3) unstable; urgency=low
+
+  * Ugh!  Links didn't get picked up after the migration of platform
+    independent files.  (Closes:#253988)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sat, 12 Jun 2004 09:25:40 -0700
+
+erlang (1:9.2.1-2) unstable; urgency=low
+
+  * Make upgrade easier.  (Closes:#253914)
+  * Clean up various lintian warnings.  (Made icon 32x32)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Fri, 11 Jun 2004 23:42:45 -0700
+
+erlang (1:9.2.1-1) unstable; urgency=low
+
+  * New upstream release.(Closes:#253116)
+  * Correct Emacs handling.  (Closes:#240235).
+  * Never uploaded 9.2-6 -- make sure (Closes:#237653)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Wed,  9 Jun 2004 22:57:36 -0700
+
+erlang (1:9.2-6) unstable; urgency=low
+
+  * Reconfigure a few things:  Make the 'erlang' package hold the
+    architecture-independent files.  Make the 'erlang-base' package hold
+    the base virtual machine (platform-dependent).
+  * Remove duplicates where possible.  (Closes:#237653)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Mon, 15 Mar 2004 21:10:42 -0800
+
+erlang (1:9.2-5) unstable; urgency=low
+
+  * Regenerate configure stuff in the hopes that this will help HPPA builds.
+  * Updated config.guess, config.sub to most recent version for autoconf2.13
+    series.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Mon,  9 Feb 2004 21:37:33 -0800
+
+erlang (1:9.2-4) unstable; urgency=low
+
+  * Add ia64 to buildable architectures (now that it builds!).
+    (Closes:#142642, #161266, #225226)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sun,  8 Feb 2004 00:33:38 -0800
+
+erlang (1:9.2-3) unstable; urgency=low
+
+  * Minor fixes to build packages.
+  * Incorporate Daniel Schepler's patch (Closes:#196247)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sat,  8 Nov 2003 21:00:56 -0800
+
+erlang (1:9.2-2) unstable; urgency=low
+
+  * Correct bad 'WWW' path.  (Closes:#207375).
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Wed, 27 Aug 2003 23:41:08 -0700
+
+erlang (1:9.2-1) unstable; urgency=low
+
+  * The Erlang 9RC Release.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Thu, 14 Aug 2003 21:25:25 -0700
+
+erlang (1:9.1-3) unstable; urgency=low
+
+  * Declare platform dependencies only on architectures supported by upstream.
+    The proper place for these to be fixed is in a real porting effort, not
+    by keeping Erlang out of stable.
+    (Closes:#142642), (Closes:#161266), (Closes:#179803), (Closes:#189591)
+  * Correct bad symlink to epmd (among others).  (Closes:#196268)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Mon, 23 Jun 2003 23:30:16 -0700
+
+erlang (1:9.1-2) unstable; urgency=low
+
+  * Incorporate Laurent Bonnaud's patch for allowing the Erlang mode to
+    work under XEmacs.  (Closes:#179277)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Tue, 18 Mar 2003 21:43:28 -0800
+
+erlang (1:9.1-1) unstable; urgency=low
+
+  * New upstream release.  Highlights:
+    + Constant expressions now evaluated at compile time.
+    + "," and "and" guards now handled properly.
+    + Corrections for floating point problems.
+    + Some 64-bit architecture fixes.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Fri, 14 Mar 2003 22:19:50 -0800
+
+erlang (1:9.0-10) unstable; urgency=low
+
+  * Correct settings of ERLDIR to not include quotes.  This corrects a problem
+        that kept Yaws from building properly "out of the box."  A tip 'o the
+        hat to Jimmie Houchin for noticing.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sun,  2 Mar 2003 20:33:22 -0800
+
+erlang (1:9.0-9) unstable; urgency=low
+
+  * Add conflicts to elastic-base.  (Closes:Bug#179816)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Tue,  4 Feb 2003 22:11:08 -0800
+
+erlang (1:9.0-8) unstable; urgency=low
+
+  * Remove dangling symlinks from bad earlier package.  (Closes:#170528)
+  * Remove HIPE support for SPARC.  SPARC only supports HIPE under
+    SOLARIS (for now), so this causes build failures.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sun,  2 Feb 2003 20:38:37 -0800
+
+erlang (1:9.0-7) unstable; urgency=low
+
+  * HPPA built on Paer, so I'm opening up the architecture to 'any'.
+  * Changed 'gawk' dependency to plain 'awk'.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sat,  1 Feb 2003 23:09:23 -0800
+
+erlang (1:9.0-6) unstable; urgency=low
+
+  * Erlang won't build on other architectures because of my monkeying
+    around with 'ecc'.  Too many scripts depende on it being named
+    'ecc' and located in /usr/bin/ecc.  And I'm not sure how many
+    external Erlang programs make this assumption.  Going back to
+    conflicting with Elastic.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sat,  1 Feb 2003 10:29:31 -0800
+
+erlang (1:9.0-5) unstable; urgency=low
+
+  * Fix some lintian warnings.
+  * Move all Java stuff into erlang-base, declare as binary-indep, and
+    remove build-depends on Java (since autobuilders don't need to build
+    these parts.)  Since the java-stuff is not critical to the function
+    of Erlang, modify build rules to ignore failure if 'javac' does not
+    exist, for example.
+  * Incorporated translations for German, Spanish, and Japanese.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Thu, 30 Jan 2003 21:46:22 -0800
+
+erlang (1:9.0-4) unstable; urgency=low
+
+  * More fun with 'ecc'.  I stupidly copied this into my own /usr/bin, so of
+    course everything works just fine on my system.  I figured out where this
+    is referenced in the erlc source and *hopefully* have this fixed so it
+    can coexist with the 'elastic' compiler.  (Closes: #172931)
+  * Changed dependency to xlibs-dev (Closes: #170156)
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sat, 14 Dec 2002 16:52:18 -0800
+
+erlang (1:9.0-3) unstable; urgency=low
+
+  * Well, it appears bad paths continue to be a problem.  With some
+    messy sed scripts, this is now corrected.  "INSTALL_PREFIX" does
+    not seem to be honored by the installation rules from Ericsson
+    (unfortunately).
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Wed, 13 Nov 2002 23:31:55 -0800
+
+erlang (1:9.0-2) unstable; urgency=low
+
+  * Correct a link to empd in the runtime.
+  * Provide a menu entry.
+  * Add a conflict with the 'elastic' compiler, which also defines
+    a /usr/bin/ecc. (Closes:Bug#168407)
+  * Use "INSTALL_PREFIX" to avoid all of those bad paths in the compiled
+    scripts.  Surprised no one saw this!
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sun, 10 Nov 2002 00:00:51 -0800
+
+erlang (1:9.0-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Thu,  7 Nov 2002 21:15:57 -0800
+
+erlang (1:8.2-1) unstable; urgency=low
+
+  * New maintainer.
+  * New upstream version.
+  * Correct a few lintian warnings, eject 'java' package that caused the
+    Debian install system to complain.
+
+ -- Brent A. Fulgham <bfulgham@debian.org>  Sat, 10 Aug 2002 23:16:47 -0700
+
+erlang (49.1-10.1) stable; urgency=high
+
+  * Non-maintainer upload by the Security Team
+  * Apply patch for double-free bug to included copy of zlib
+
+ -- Matt Zimmerman <mdz@debian.org>  Thu, 14 Feb 2002 04:38:23 +0000
+
+erlang (49.1-10) frozen unstable; urgency=low
+
+  * Incorporate bug fixes only from upstream maintainer. The bug could lead
+    in database deadlock in some situations.
+
+ -- Samuel Tardieu <sam@debian.org>  Sun, 27 Feb 2000 15:27:34 +0100
+
+erlang (49.1-9) frozen unstable; urgency=low
+
+  * Add a tiny patch to avoid a duplicate case clause on Sparc, because the
+    latest /usr/include/asm/signal.h files have the same value for
+    SIGLOST and SIGPWR. Closes an unreported important bug (this package
+    could not be rebuilt on Sparc). This 4 lines patch is the only code
+    change in this revision.
+  * Add libncurses5-dev to the Build-Depends list. Closes: #58151.
+  * Remove c-shell from the Depends list. Closes: #58152.
+
+ -- Samuel Tardieu <sam@debian.org>  Tue, 15 Feb 2000 13:58:41 +0100
+
+erlang (49.1-8) frozen unstable; urgency=low
+
+  * Apply latest upstream patches for the build process.
+    Closes: #57349, #57350. No new functionality has been added.
+
+ -- Samuel Tardieu <sam@debian.org>  Tue,  8 Feb 2000 13:38:34 +0100
+
+erlang (49.1-7) frozen unstable; urgency=low
+
+  * Remove Alpha from list of supported targets. Obviously, this code is
+    32 bits specific. Closes: #55237.
+
+ -- Samuel Tardieu <sam@debian.org>  Mon, 17 Jan 2000 17:11:31 +0100
+
+erlang (49.1-6) unstable; urgency=low
+
+  * Remove the etkdir.dpatch patch as it is not necessary.
+
+ -- Samuel Tardieu <sam@debian.org>  Mon, 13 Dec 1999 13:05:11 +0100
+
+erlang (49.1-5) unstable; urgency=low
+
+  * Apply patch from upstream to build Erlang libraries with proper dynamic
+    flags.
+  * Apply patch from upstream to put etk in the right directory.
+
+ -- Samuel Tardieu <sam@debian.org>  Sat, 11 Dec 1999 16:59:37 +0100
+
+erlang (49.1-4) unstable; urgency=low
+
+  * Add a patch to fix multicast bug. Submitted to upstream authors.
+
+ -- Samuel Tardieu <sam@debian.org>  Wed,  8 Dec 1999 18:48:31 +0100
+
+erlang (49.1-3) unstable; urgency=low
+
+  * Add Pre-Depends lines for dpkg.
+  * Apply unofficial patch for building ETK library.
+  * Change status of two patches from unofficial to official.
+  * Apply official patch for fixing netadm functions.
+
+ -- Samuel Tardieu <sam@debian.org>  Mon,  6 Dec 1999 13:14:50 +0100
+
+erlang (49.1-2) unstable; urgency=low
+
+  * Split this file into different package, to avoid duplication of
+    architecture independent files.
+  * Remove dependency on java. Closes: #51383.
+  * Remove hard-coded path inherited at installation time.
+
+ -- Samuel Tardieu <sam@debian.org>  Mon, 29 Nov 1999 15:42:55 +0100
+
+erlang (49.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * New maintainer.
+  * New packages.
+
+ -- Samuel Tardieu <sam@debian.org>  Thu, 25 Nov 1999 11:26:58 +0100
+
+erlang (47.4.1-2) unstable; urgency=low
+
+  * Closed bugs: #38119, #38265 - sparc, alpha ports and clean target.
+  
+ -- Mark Ng <ng@debian.org>  Mon,  21 Jun 1999 21:45:00 +1100
+
+erlang (47.4.1-1) unstable; urgency=low
+
+  * the .erl files now have their own package, giving a total of 5 packages.
+  * moved the .jam files and docs into their arch independant packages.
+  * New upsteam release.
+  
+ -- Mark Ng <ng@debian.org>  Sat,  8 May 1999 16:45:00 +1100
+
+erlang (47.4.0-1) unstable; urgency=low
+
+  * Initial Release.
+  * Split into  -base and -dev packages
+  * Erlang sources for libraries and tools are removed from the bin dist.
+
+ -- Mark Ng <ng@debian.org>  Thu,  4 Feb 1999 23:21:00 +1100
--- erlang-10.b.9.orig/debian/erlang-base-hipe.lintian-override
+++ erlang-10.b.9/debian/erlang-base-hipe.lintian-override
@@ -0,0 +1,2 @@
+erlang-base-hipe: binary-without-manpage erlc
+erlang-base-hipe: binary-without-manpage erl
--- erlang-10.b.9.orig/debian/erlang-mode.links.in
+++ erlang-10.b.9/debian/erlang-mode.links.in
@@ -0,0 +1,3 @@
+usr/lib/erlang/lib/tools-@TOOLS_VSN@/emacs/erlang-start.el     usr/share/emacs/site-lisp/erlang/erlang-start.el
+usr/lib/erlang/lib/tools-@TOOLS_VSN@/emacs/erlang.el     usr/share/emacs/site-lisp/erlang/erlang.el
+usr/lib/erlang/lib/tools-@TOOLS_VSN@/emacs/README     usr/share/emacs/site-lisp/erlang/README
--- erlang-10.b.9.orig/debian/erlang-base.files
+++ erlang-10.b.9/debian/erlang-base.files
@@ -0,0 +1,34 @@
+usr/lib/erlang/bin/erlc
+usr/lib/erlang/bin/run_erl
+usr/lib/erlang/bin/to_erl
+usr/lib/erlang/erts-*/bin/beam
+usr/lib/erlang/erts-*/bin/beam.elib
+usr/lib/erlang/erts-*/bin/beam.elib.shared
+usr/lib/erlang/erts-*/bin/beam.shared
+usr/lib/erlang/erts-*/bin/child_setup
+usr/lib/erlang/erts-*/bin/child_setup.shared
+usr/lib/erlang/erts-*/bin/epmd
+usr/lib/erlang/erts-*/bin/erlc
+usr/lib/erlang/erts-*/bin/erlexec
+usr/lib/erlang/erts-*/bin/heart
+usr/lib/erlang/erts-*/bin/inet_gethost
+usr/lib/erlang/erts-*/bin/run_erl
+usr/lib/erlang/erts-*/bin/to_erl
+usr/lib/erlang/erts-*/lib/internal/*.a
+usr/lib/erlang/erts-*/bin/beam.hybrid
+usr/lib/erlang/erts-*/bin/child_setup.hybrid
+usr/lib/erlang/lib/odbc-*/priv/bin/odbcserver
+usr/lib/erlang/lib/asn1-*/priv/lib/*.so
+usr/lib/erlang/lib/crypto-*/priv/lib/*.o
+usr/lib/erlang/lib/crypto-*/priv/lib/*.so
+usr/lib/erlang/lib/crypto-*/priv/obj/*.o
+usr/lib/erlang/lib/erl_interface-*/bin/erl_call
+usr/lib/erlang/lib/erl_interface-*/lib/*.a
+usr/lib/erlang/lib/ic-*/priv/lib/*.a
+usr/lib/erlang/lib/megaco-*/priv/lib/*.so
+usr/lib/erlang/lib/orber-*/priv/bin/obj_init_port
+usr/lib/erlang/lib/os_mon-*/priv/bin/memsup
+usr/lib/erlang/lib/runtime_tools-*/priv/lib/*.so
+usr/lib/erlang/lib/ssl-*/priv/bin/ssl_esock
+usr/lib/erlang/lib/ssl-*/priv/obj/*.o
+
--- erlang-10.b.9.orig/debian/erlang-x11.menu
+++ erlang-10.b.9/debian/erlang-x11.menu
@@ -0,0 +1,6 @@
+?package(erlang-x11):needs="x11" \
+	section="Apps/Programming" title="Erlang Toolbar" \
+	longtitle="Erlang Toplevel with Toolbar" \
+	hints="erlang" \
+	command="/usr/bin/erl -s toolbar" \
+	icon="/usr/share/icons/erlang.xpm"
--- erlang-10.b.9.orig/debian/erlang-base-hipe.links.in
+++ erlang-10.b.9/debian/erlang-base-hipe.links.in
@@ -0,0 +1,3 @@
+usr/lib/erlang/erts-@VERSION@/bin/epmd	usr/lib/erlang/bin/epmd
+usr/lib/erlang/bin/erlc		usr/bin/erlc
+usr/lib/erlang/erts-@VERSION@/bin/erl         usr/bin/erl
--- erlang-10.b.9.orig/debian/erlang-x11.lintian-override
+++ erlang-10.b.9/debian/erlang-x11.lintian-override
@@ -0,0 +1,3 @@
+erlang-x11: image-file-in-usr-lib
+erlang-x11: menu-icon-missing
+erlang-x11: menu-command-not-in-package
--- erlang-10.b.9.orig/debian/erlang-mode.dirs
+++ erlang-10.b.9/debian/erlang-mode.dirs
@@ -0,0 +1 @@
+usr/share/emacs/site-lisp/erlang
--- erlang-10.b.9.orig/debian/dirs
+++ erlang-10.b.9/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/sbin
--- erlang-10.b.9.orig/debian/TODO
+++ erlang-10.b.9/debian/TODO
@@ -0,0 +1,22 @@
+Things we hope in the next versions of this package:
+
+* Split erlang-src package into erlang-dev (should contain development
+files, mostly includes) and erlang-src (all other files). Or may be
+better approach is to move includes to erlang-nox and erlang-x11.
+
+* Maybe put the ODBC application into its own package since it's not
+really required by the reste of the Erlang applications.
+
+* Make a package of the SSL application.  I think it requires a
+package which isn't free and thus not in Main.  That is a Bad Thing.
+
+* Pull the erl_jinterface in its own package.  JInterface is not built
+in the main package since it doesn't not depend on Java.
+
+* Add an init.d entry for epmd, the erlang port mapper. I need for
+that to see how ejabberd loads epmd when and if required.
+
+* Currently ejabberd is not restarted when erlang is upgraded. Probably
+it's a good idea to allow registering applications, which depend on
+erlang and restart them (or run provided during registration script)
+after upgrade.
--- erlang-10.b.9.orig/debian/erlang-src.patterns
+++ erlang-10.b.9/debian/erlang-src.patterns
@@ -0,0 +1,123 @@
+./usr/lib/erlang/usr/include=usr/include/erlang
+./usr/lib/erlang/usr/include/obsolete=usr/include/erlang
+./usr/lib/erlang/erts-.*/src
+./usr/lib/erlang/erts-.*/include
+./usr/lib/erlang/erts-.*/include/internal
+./usr/lib/erlang/lib/stdlib-.*/src
+./usr/lib/erlang/lib/stdlib-.*/include
+./usr/lib/erlang/lib/stdlib-.*/examples
+./usr/lib/erlang/lib/sasl-.*/src
+./usr/lib/erlang/lib/kernel-.*/src
+./usr/lib/erlang/lib/kernel-.*/include
+./usr/lib/erlang/lib/kernel-.*/examples/uds_dist/src
+./usr/lib/erlang/lib/kernel-.*/examples/uds_dist/c_src
+./usr/lib/erlang/lib/compiler-.*/src
+./usr/lib/erlang/lib/tools-.*/src
+./usr/lib/erlang/lib/tools-.*/examples
+./usr/lib/erlang/lib/snmp-.*/src/compiler
+./usr/lib/erlang/lib/snmp-.*/src/app
+./usr/lib/erlang/lib/snmp-.*/src/misc
+./usr/lib/erlang/lib/snmp-.*/src/agent
+./usr/lib/erlang/lib/snmp-.*/src/manager
+./usr/lib/erlang/lib/snmp-.*/include
+./usr/lib/erlang/lib/snmp-.*/examples/ex1
+./usr/lib/erlang/lib/otp_mibs-.*/src
+./usr/lib/erlang/lib/otp_mibs-.*/include
+./usr/lib/erlang/lib/appmon-.*/src
+./usr/lib/erlang/lib/erl_interface-.*/include
+./usr/lib/erlang/lib/erl_interface-.*/src/connect
+./usr/lib/erlang/lib/erl_interface-.*/src/decode
+./usr/lib/erlang/lib/erl_interface-.*/src/encode
+./usr/lib/erlang/lib/erl_interface-.*/src/epmd
+./usr/lib/erlang/lib/erl_interface-.*/src/legacy
+./usr/lib/erlang/lib/erl_interface-.*/src/misc
+./usr/lib/erlang/lib/erl_interface-.*/src/prog
+./usr/lib/erlang/lib/erl_interface-.*/src/registry
+./usr/lib/erlang/lib/asn1-.*/src
+./usr/lib/erlang/lib/asn1-.*/c_src
+./usr/lib/erlang/lib/debugger-.*/src
+./usr/lib/erlang/lib/gs-.*/src
+./usr/lib/erlang/lib/gs-.*/ebin
+./usr/lib/erlang/lib/gs-.*/examples/src
+./usr/lib/erlang/lib/inets-.*/src
+./usr/lib/erlang/lib/ic-.*/src
+./usr/lib/erlang/lib/ic-.*/examples/c-client
+./usr/lib/erlang/lib/ic-.*/examples/c-server
+./usr/lib/erlang/lib/ic-.*/examples/erl-plain
+./usr/lib/erlang/lib/ic-.*/examples/erl-genserv
+./usr/lib/erlang/lib/ic-.*/examples/all-against-all
+./usr/lib/erlang/lib/ic-.*/examples/pre_post_condition
+./usr/lib/erlang/lib/ic-.*/c_src
+./usr/lib/erlang/lib/ic-.*/include
+./usr/lib/erlang/lib/mnesia-.*/src
+./usr/lib/erlang/lib/mnesia-.*/include
+./usr/lib/erlang/lib/mnesia-.*/examples
+./usr/lib/erlang/lib/mnesia-.*/examples/bench
+./usr/lib/erlang/lib/mnemosyne-.*/src
+./usr/lib/erlang/lib/mnemosyne-.*/include
+./usr/lib/erlang/lib/mnemosyne-.*/examples
+./usr/lib/erlang/lib/mnesia_session-.*/src
+./usr/lib/erlang/lib/mnesia_session-.*/include
+./usr/lib/erlang/lib/crypto-.*/src
+./usr/lib/erlang/lib/orber-.*/COSS/CosNaming
+./usr/lib/erlang/lib/orber-.*/src
+./usr/lib/erlang/lib/orber-.*/include
+./usr/lib/erlang/lib/orber-.*/examples/Stack
+./usr/lib/erlang/lib/os_mon-.*/src
+./usr/lib/erlang/lib/os_mon-.*/include
+./usr/lib/erlang/lib/parsetools-.*/src
+./usr/lib/erlang/lib/parsetools-.*/include
+./usr/lib/erlang/lib/pman-.*/src
+./usr/lib/erlang/lib/ssl-.*/include
+./usr/lib/erlang/lib/ssl-.*/pkix
+./usr/lib/erlang/lib/ssl-.*/src
+./usr/lib/erlang/lib/ssl-.*/examples/certs/src
+./usr/lib/erlang/lib/ssl-.*/examples/src
+./usr/lib/erlang/lib/toolbar-.*/src
+./usr/lib/erlang/lib/tv-.*/src
+./usr/lib/erlang/lib/observer-.*/src
+./usr/lib/erlang/lib/observer-.*/include
+./usr/lib/erlang/lib/odbc-.*/src
+./usr/lib/erlang/lib/odbc-.*/include
+./usr/lib/erlang/lib/runtime_tools-.*/src
+./usr/lib/erlang/lib/runtime_tools-.*/include
+./usr/lib/erlang/lib/cosTransactions-.*/src
+./usr/lib/erlang/lib/cosTransactions-.*/include
+./usr/lib/erlang/lib/cosEvent-.*/src
+./usr/lib/erlang/lib/cosEvent-.*/include
+./usr/lib/erlang/lib/cosTime-.*/src
+./usr/lib/erlang/lib/cosTime-.*/include
+./usr/lib/erlang/lib/cosNotification-.*/src
+./usr/lib/erlang/lib/cosNotification-.*/include
+./usr/lib/erlang/lib/cosProperty-.*/src
+./usr/lib/erlang/lib/cosProperty-.*/include
+./usr/lib/erlang/lib/cosFileTransfer-.*/src
+./usr/lib/erlang/lib/cosFileTransfer-.*/include
+./usr/lib/erlang/lib/cosEventDomain-.*/src
+./usr/lib/erlang/lib/cosEventDomain-.*/include
+./usr/lib/erlang/lib/et-.*/src
+./usr/lib/erlang/lib/et-.*/include
+./usr/lib/erlang/lib/et-.*/examples
+./usr/lib/erlang/lib/megaco-.*/src/engine
+./usr/lib/erlang/lib/megaco-.*/src/text
+./usr/lib/erlang/lib/megaco-.*/src/flex
+./usr/lib/erlang/lib/megaco-.*/src/binary
+./usr/lib/erlang/lib/megaco-.*/src/tcp
+./usr/lib/erlang/lib/megaco-.*/src/udp
+./usr/lib/erlang/lib/megaco-.*/include
+./usr/lib/erlang/lib/megaco-.*/examples/simple
+./usr/lib/erlang/lib/megaco-.*/examples/meas
+./usr/lib/erlang/lib/webtool-.*/src
+./usr/lib/erlang/lib/syntax_tools-.*/src
+./usr/lib/erlang/lib/xmerl-.*/src
+./usr/lib/erlang/lib/xmerl-.*/include
+./usr/lib/erlang/lib/edoc-.*/src
+./usr/lib/erlang/lib/ssh-.*/src
+./usr/lib/erlang/lib/ssh-.*/include
+./usr/lib/erlang/lib/hipe-.*/rtl
+./usr/lib/erlang/lib/hipe-.*/misc
+./usr/lib/erlang/lib/hipe-.*/main
+./usr/lib/erlang/lib/hipe-.*/cerl
+./usr/lib/erlang/lib/hipe-.*/icode
+./usr/lib/erlang/lib/hipe-.*/flow
+./usr/lib/erlang/lib/hipe-.*/util
--- erlang-10.b.9.orig/debian/erlang-nox.docs
+++ erlang-10.b.9/debian/erlang-nox.docs
@@ -0,0 +1,2 @@
+otp-src*/README
+otp-src*/AUTHORS
--- erlang-10.b.9.orig/debian/patched/02Makefile.in.dpatch
+++ erlang-10.b.9/debian/patched/02Makefile.in.dpatch
@@ -0,0 +1,16 @@
+patching file lib/asn1/c_src/Makefile.in
+patching file lib/erl_interface/src/Makefile.in
+patching file lib/ic/c_src/Makefile.in
+patching file lib/megaco/src/flex/Makefile.in
+Hunk #1 succeeded at 154 with fuzz 1 (offset 4 lines).
+patching file lib/odbc/c_src/Makefile.in
+patching file lib/orber/c_src/Makefile.in
+patching file lib/os_mon/c_src/Makefile.in
+patching file lib/ssl/c_src/Makefile.in
+Hunk #2 succeeded at 104 (offset 1 line).
+patching file erts/emulator/Makefile.in
+patching file erts/emulator/zlib/Makefile.in
+patching file erts/epmd/src/Makefile.in
+patching file erts/etc/common/Makefile.in
+patching file erts/lib_src/Makefile.in
+Hunk #3 succeeded at 66 with fuzz 2.
--- erlang-10.b.9.orig/debian/patched/06install.dpatch
+++ erlang-10.b.9/debian/patched/06install.dpatch
@@ -0,0 +1 @@
+patching file erts/etc/common/Install
--- erlang-10.b.9.orig/debian/patched/40supervisor.dpatch
+++ erlang-10.b.9/debian/patched/40supervisor.dpatch
@@ -0,0 +1 @@
+patching file lib/stdlib/src/supervisor.erl
--- erlang-10.b.9.orig/debian/patched/41epoll.dpatch
+++ erlang-10.b.9/debian/patched/41epoll.dpatch
@@ -0,0 +1,5 @@
+patching file erts/acconfig.h
+patching file erts/config.h.in
+patching file erts/configure
+patching file erts/configure.in
+patching file erts/emulator/sys/unix/sys.c
--- erlang-10.b.9.orig/debian/patched/42man.dpatch
+++ erlang-10.b.9/debian/patched/42man.dpatch
@@ -0,0 +1 @@
+patching file erts/etc/common/erlexec.c
--- erlang-10.b.9.orig/debian/erlang-src.links
+++ erlang-10.b.9/debian/erlang-src.links
@@ -0,0 +1 @@
+usr/include/erlang /usr/lib/erlang/usr/include
--- erlang-10.b.9.orig/debian/erlang-nox.menu
+++ erlang-10.b.9/debian/erlang-nox.menu
@@ -0,0 +1,6 @@
+?package(erlang-nox):needs="text" \
+	section="Apps/Programming" title="Erlang" \
+	longtitle="Erlang Toplevel" \
+	hints="erlang" \
+	command="/usr/bin/erl" \
+	icon="/usr/share/icons/erlang.xpm"
--- erlang-10.b.9.orig/debian/README.Debian
+++ erlang-10.b.9/debian/README.Debian
@@ -0,0 +1,73 @@
+This project is hosted on Berlios.de:
+
+http://erlang-pkg.berlios.de (website)
+http://developer.berlios.de/projects/erlang-pkg (project page)
+http://svn.berlios.de/viewcvs/erlang-pkg/ (ViewCVS)
+
+Erlang Packagers <erlang-pkg-devel@lists.berlios.de>
+
+----------------
+
+Open Source Erlang for DEBIAN
+-----------------------------
+
+Erlang is a programming language designed at the Ericsson Computer
+Science Laboratory.  Open-Source Erlang was released to help encourage
+the spread of Erlang outside of Ericsson.
+
+(From the White Paper:  http://erlang.org/white_paper.html)
+
+Erlang is characterized by the following features:
+     
+*  Concurrency - Erlang has extremely lightweight processes whose memory
+   requirements can vary dynamically. Processes have no shared memory and
+   communicate by asynchronous message passing. Erlang supports
+   applications with very large numbers of concurrent processes. No
+   requirements for concurrency are placed on the host operating system.
+					     
+*  Distribution - Erlang is designed to be run in a distributed
+   environment. An Erlang virtual machine is called an Erlang node. A
+   distributed Erlang system is a network of Erlang nodes (typically one
+   per processor). An Erlang node can create parallel processes running  
+   on other nodes, which perhaps use other operating systems. Processes  
+   residing on different nodes communicate in exactly the same was as   
+   processes residing on the same node.
+										                                        
+*  Robustness - Erlang has various error detection primitives which can 
+   be used to structure fault-tolerant systems. For example, processes  
+   can monitor the status and activities of other processes, even if    
+   these processes are executing on other nodes. Processes in a
+   distributed system can be configured to fail-over to other nodes in
+   case of failures and automatically migrate back to recovered nodes.
+*  Soft real-time - Erlang supports programming "soft" real-time systems,
+   which require response times in the order of milliseconds. Long
+   garbage collection delays in such systems are unacceptable, so Erlang
+   uses incremental garbage collection techniques.
+
+*  Hot code upgrade - Many systems cannot be stopped for software
+   maintenance. Erlang allows program code to be changed in a running
+   system. Old code can be phased out and replaced by new code. During  
+   the transition, both old code and new code can coexist. It is thus    
+   possible to install bug fixes and upgrades in a running system without
+   disturbing its operation.
+
+*  Incremental code loading - Users can control in detail how code is
+   loaded. In embedded systems, all code is usually loaded at boot time.
+   In development systems, code is loaded when it is needed, even when  
+   the system is running. If testing uncovers bugs, only the buggy code 
+   need be replaced.
+
+*  External interfaces - Erlang processes communicate with the outside
+   world using the same message passing mechanism as used between Erlang
+   processes. This mechanism is used for communication with the host
+   operating system and for interaction with programs written in other
+   languages. If required for reasons of efficiency, a special version of
+   this concept allows e.g. C programs to be directly linked into the
+   Erlang runtim
+
+The how's and why of Erlang are discussed at the website
+at: http://erlang.org
+
+Enjoy Erlang! :-)
+
+Brent A. Fulgham <bfulgham@debian.org>  Sat, 10 Aug 2002 23:16:47 -0700
