Best actually attach the patch I s'pose...
diff -Nur vserver-0.22/Makefile vserver-0.22-dsvr/Makefile
--- vserver-0.22/Makefile 2002-11-14 16:44:55.000000000 +0000
+++ vserver-0.22-dsvr/Makefile 2003-03-06 09:45:08.000000000 +0000
@@ -4,6 +4,9 @@
vcheck vserver-stat showattr vdu showperm capchroot vfiles \
ifspec filetime listdevip fakerunlevel
GCCOPTS=-funsigned-char -Wall -g -O
+
+PERL_INC=#/usr/lib/perl5/5.6.1/i386-linux-thread-multi/CORE
+
all: $(PROGS)
proto:
@@ -81,13 +84,45 @@
fakerunlevel: fakerunlevel.cc
gcc $(GCCOPTS) -DVERSION=\"$(PACKAGE_REV)\" fakerunlevel.cc -o fakerunlevel
+s_context_wrap.c: s_context.swig swig-new-perl.patch swig-old-perl.patch
+ swig -perl5 s_context.swig
+ifneq ("old",$(grep "void,boot_s_context" s_context_wrap.c && echo "old"))
+ patch < swig-old-perl.patch
+else
+ patch < swig-new-perl.patch
+endif
+
+s_context.so: s_context_wrap.c syscall.o
+ifeq (,$(PERL_INC))
+ @echo "ERROR: Need to manually set PERL_INC in Makefile"
+else
+ gcc -fpic -c s_context_wrap.c -DPERL_POLLUTE -Dbool=char -I$(PERL_INC)
+ gcc -shared s_context_wrap.o syscall.o -o s_context.so
+endif
+
+.PHONY: perl
+perl: s_context.so
+
clean:
- rm -f $(PROGS) *.bak *~ *.o */*.bak */*~
+ rm -f $(PROGS) *.bak *~ *.o */*.bak */*~ s_context_wrap.* s_context.{pm,so}
make -C tests clean
USR_SBIN=/usr/sbin
USR_LIB_VSERVER=/usr/lib/vserver
-install:
+
+# If you want make install to install the ctx_syscalls perl module specify a location:
+PERL_INSTALL=#/usr/lib/perl5/5.6.1/i386-linux-thread-multi
+
+perl_install: perl
+ifeq (,$(PERL_INSTALL))
+ @echo "INFO: To install s_context perl module, set PERL_INSTALL to directory
for s_context.pm in Makefile"
+else
+ mkdir -p $(PERL_INSTALL)/auto/s_context
+ install -m 644 s_context.pm $(PERL_INSTALL)
+ install -m 644 s_context.so $(PERL_INSTALL)/auto/s_context
+endif
+
+install: perl_install
mkdir -p $(RPM_BUILD_ROOT)$(USR_SBIN)
mkdir -p $(RPM_BUILD_ROOT)$(USR_LIB_VSERVER)
mkdir -p $(RPM_BUILD_ROOT)/etc/init.d
@@ -146,7 +181,6 @@
install -m 644 distrib/mdk8.2-minimum $(RPM_BUILD_ROOT)$(USR_LIB_VSERVER)
-
buildrpm: buildspec
RPMTOPDIR=/usr/src/redhat
diff -Nur vserver-0.22/s_context.swig vserver-0.22-dsvr/s_context.swig
--- vserver-0.22/s_context.swig 1970-01-01 01:00:00.000000000 +0100
+++ vserver-0.22-dsvr/s_context.swig 2003-03-05 14:42:59.000000000 +0000
@@ -0,0 +1,14 @@
+%module s_context
+%{
+%}
+
+%name(new_s_context) int call_new_s_context(int newctx, int remove_cap, int flags,
char* name);
+%name(set_ipv4root) int call_set_ipv4root (unsigned long ip[], int nb, unsigned long
bcast);
+int kernel_has_ctx();
+
+const int INFO_LOCK = 1;
+const int INFO_SCHED = 2;
+const int INFO_NPROC = 4;
+const int INFO_PRIVATE = 8;
+const int INFO_INIT = 16;
+const int INFO_HIDEINFO = 32;
diff -Nur vserver-0.22/swig-new-perl.patch vserver-0.22-dsvr/swig-new-perl.patch
--- vserver-0.22/swig-new-perl.patch 1970-01-01 01:00:00.000000000 +0100
+++ vserver-0.22-dsvr/swig-new-perl.patch 2003-02-24 14:32:54.000000000 +0000
@@ -0,0 +1,7 @@
+--- s_context_wrap.c 2003-02-19 10:15:34.000000000 +0000
++++ s_context_wrap.c 2003-02-19 10:15:25.000000000 +0000
+@@ -430,3 +430,3 @@
+ #ifndef PERL_OBJECT
+-SWIGEXPORT(void) boot_s_context(CV* cv);
++XS(boot_s_context);
+ #else
diff -Nur vserver-0.22/swig-old-perl.patch vserver-0.22-dsvr/swig-old-perl.patch
--- vserver-0.22/swig-old-perl.patch 1970-01-01 01:00:00.000000000 +0100
+++ vserver-0.22-dsvr/swig-old-perl.patch 2003-02-24 14:32:54.000000000 +0000
@@ -0,0 +1,7 @@
+--- s_context_wrap.c 2003-02-19 10:15:34.000000000 +0000
++++ s_context_wrap.c 2003-02-19 10:15:25.000000000 +0000
+@@ -430,3 +430,3 @@
+ #ifndef PERL_OBJECT
+-SWIGEXPORT(void,boot_s_context)(CV* cv);
++XS(boot_s_context);
+ #else
pgp00000.pgp
Description: PGP signature
