tags 483328 + patch
thanks

I've succeeded in getting pvm to build, and fixed some of the more
significant breakages. I'm *not* NMUing this at this stage, because I have no
idea how to test that it's still functional. The diff so far is
attached.

Also, I've fixed the "incompatible implicit declaration of built-in
function" warnings, but adding -Wall causes many implicit declaration
warnings for (presumably) libpvm internals. This means it might well
segfault on architectures where the int and pointer are different
sizes...

    Simon
    at the Cambridge BSP
diff -u pvm-3.4.5/debian/patches/series pvm-3.4.5/debian/patches/series
--- pvm-3.4.5/debian/patches/series
+++ pvm-3.4.5/debian/patches/series
@@ -21,0 +22,2 @@
+21-soname-related-sanity.patch
+22-explicit-is-better-than-implicit.patch
diff -u pvm-3.4.5/debian/rules pvm-3.4.5/debian/rules
--- pvm-3.4.5/debian/rules
+++ pvm-3.4.5/debian/rules
@@ -8,8 +8,11 @@
 SHELL=/bin/bash
 
 PVM_ARCH=`sh debian/getpvmarch`
-version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
-version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')
+# upstream version
+version=$(shell dpkg-parsechangelog | grep Version: | cut -d ' ' -f 2 | cut -d '-' -f 1)
+# Version from SONAME (.so.3 => 3)
+# deliberately hard-coded - if this changes we definitely want to know about it
+soversion=3
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 OPT = -O0
@@ -20,10 +23,7 @@
 INSTALL_PROGRAM += -s
 endif										
 
-# yes, I know this will define RSHCOMMAND twice and generate a warning.
-# I'm not modifying gcc. -dld
-#
-AIMKSTR	= -here -f ./conf/$(PVM_ARCH).def -f ./Makefile.aimk CFLOPTS='"-g $(OPT) -DRSHCOMMAND=\\\"/usr/lib/pvm3/bin/rsh\\\" -DPVMDPATH=\\\"pvmd\\\" -DPVMDFILE=\\\"/usr/bin/pvmd\\\" -DPVM_DEFAULT_ROOT=\\\"/usr/lib/pvm3\\\" -DOVERLOADHOST"'
+AIMKSTR	= -here -f ./conf/$(PVM_ARCH).def -f ./Makefile.aimk CFLOPTS='"-g -Wall $(OPT) -URSHCOMMAND -DRSHCOMMAND=\\\"/usr/lib/pvm3/bin/rsh\\\" -DPVMDPATH=\\\"pvmd\\\" -DPVMDFILE=\\\"/usr/bin/pvmd\\\" -DPVM_DEFAULT_ROOT=\\\"/usr/lib/pvm3\\\" -DOVERLOADHOST -DHASSTDLIB -DSYSVSTR"'
 
 build: patch build-stamp
 build-stamp:
@@ -78,10 +78,10 @@
 	ln -sf libgpvm3.so.$(version) debian/pvm-dev/usr/lib/libgpvm3.so
 	
 	# libpvm3 package
-	cp lib/$(PVM_ARCH)/libpvm3.so debian/libpvm3/usr/lib/libpvm3.so.$(version)
-	ln -s libpvm3.so.$(version) debian/libpvm3/usr/lib/libpvm3.so.$(version_major)
-	cp lib/$(PVM_ARCH)/libgpvm3.so debian/libpvm3/usr/lib/libgpvm3.so.$(version)
-	ln -s libgpvm3.so.$(version) debian/libpvm3/usr/lib/libgpvm3.so.$(version_major)
+	cp lib/$(PVM_ARCH)/libpvm3.so.$(soversion) debian/libpvm3/usr/lib/libpvm3.so.$(version)
+	ln -s libpvm3.so.$(version) debian/libpvm3/usr/lib/libpvm3.so.$(soversion)
+	cp lib/$(PVM_ARCH)/libgpvm3.so.$(soversion) debian/libpvm3/usr/lib/libgpvm3.so.$(version)
+	ln -s libgpvm3.so.$(version) debian/libpvm3/usr/lib/libgpvm3.so.$(soversion)
 
 	# pvm-examples package
 	mv bin/$(PVM_ARCH)/gs debian/pvm-examples/usr/bin/gs.pvm
diff -u pvm-3.4.5/debian/changelog pvm-3.4.5/debian/changelog
--- pvm-3.4.5/debian/changelog
+++ pvm-3.4.5/debian/changelog
@@ -1,3 +1,26 @@
+pvm (3.4.5-10.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload from the Cambridge BSP.
+  * debian/patches/21-soname-related-sanity.patch: in the patched upstream
+    build system, build the shared libraries with output filenames that
+    matches their SONAMEs. Also link libgpvm3 against libpvm3 for
+    self-containedness
+  * debian/rules: #define HASSTDLIB and SYSVSTR so we get <stdlib.h> and
+    <string.h>, to avoid implicit declarations (which might cause segfaults
+    on non-ILP32 architectures)
+  * debian/rules: undefine RSHCOMMAND before redefining it, suppressing a
+    warning
+  * debian/patches/22-explicit-is-better-than-implicit.patch: include assorted
+    C standard library headers to avoid implicit declarations
+  * debian/rules: don't assume that the source directory name ends with the
+    upstream version number, fixing FTBFS if this is not true. Also hard-code
+    the version for the SONAME rather than assuming it equals the upstream
+    major version, since SONAMEs and release numbers should not be assumed
+    to be synchronized. (Closes: #483328; thanks to Peter Green for the initial
+    patch)
+
+ -- Simon McVittie <[EMAIL PROTECTED]>  Sun, 29 Jun 2008 14:08:45 +0100
+
 pvm (3.4.5-10) unstable; urgency=low
 
   * Resync with Ubuntu.
only in patch2:
unchanged:
--- pvm-3.4.5.orig/debian/patches/22-explicit-is-better-than-implicit.patch
+++ pvm-3.4.5/debian/patches/22-explicit-is-better-than-implicit.patch
@@ -0,0 +1,373 @@
+Index: pvm-3.4.5-31337/examples/bwtest.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/bwtest.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/bwtest.c	2008-06-29 14:38:13.000000000 +0000
+@@ -40,6 +40,7 @@
+  * This is a PVM test code
+  */
+ 
++#include <stdlib.h>
+ #include "pvm3.h"
+ #include "stdio.h"		/* needed to help 64bit compilers understand printf */
+ #ifndef SAMPLE
+Index: pvm-3.4.5-31337/examples/hello.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/hello.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/hello.c	2008-06-29 14:38:13.000000000 +0000
+@@ -31,6 +31,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "pvm3.h"
+ 
+ main()
+Index: pvm-3.4.5-31337/examples/hello_other.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/hello_other.c	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/examples/hello_other.c	2008-06-29 14:38:13.000000000 +0000
+@@ -30,6 +30,8 @@
+  * the National Science Foundation and the State of Tennessee.
+  */
+ 
++#include <stdlib.h>
++#include <string.h>
+ #include "pvm3.h"
+ 
+ main()
+Index: pvm-3.4.5-31337/examples/inherit1.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/inherit1.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/inherit1.c	2008-06-29 14:38:13.000000000 +0000
+@@ -36,6 +36,8 @@
+  *  support program for inherita.c - read docs in that file
+  */
+ 
++#include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/inherit3.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/inherit3.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/inherit3.c	2008-06-29 14:38:13.000000000 +0000
+@@ -36,6 +36,8 @@
+  *  support program for inherita.c - read docs in that file
+  */
+ 
++#include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/inherita.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/inherita.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/inherita.c	2008-06-29 14:38:13.000000000 +0000
+@@ -55,6 +55,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/inheritb.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/inheritb.c	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/examples/inheritb.c	2008-06-29 14:38:13.000000000 +0000
+@@ -47,6 +47,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/lmbi.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/lmbi.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/lmbi.c	2008-06-29 14:38:13.000000000 +0000
+@@ -67,6 +67,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/mhf_server.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/mhf_server.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/mhf_server.c	2008-06-29 14:38:13.000000000 +0000
+@@ -46,6 +46,8 @@
+ ***************************************************************/
+ 
+ #include "stdio.h"
++#include <stdlib.h>
++#include <string.h>
+ #include "pvm3.h"
+ 
+ #define NOISE1 1	 /* sets level of program noise  - minimum noise */
+Index: pvm-3.4.5-31337/examples/mhf_tickle.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/mhf_tickle.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/mhf_tickle.c	2008-06-29 14:38:13.000000000 +0000
+@@ -49,6 +49,7 @@
+ ***************************************************************/
+ 
+ #include "stdio.h"
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <sys/errno.h>
+ #else
+@@ -141,7 +142,7 @@
+ 		}
+ 	}
+ 
+-	s[i] = (char) NULL;
++	s[i] = '\0';
+ 
+ 	eat_line( c );	/* eat the remaining characters on this line */
+ 
+@@ -339,7 +340,7 @@
+ void
+ press_enter_key( message )
+ char *message;
+-{	char c = (char) NULL;
++{	char c = '\0';
+ 	printf( "%s", message );
+ 	eat_line( c );
+ } /* press_enter_key */
+@@ -381,7 +382,7 @@
+ 	/* note that this may result in one-less than the maximum number of chars available being read 	*/
+ 	while ( isspace( s[--i] ) ) { /* do nothing... */ }
+ 
+-	s[++i] = (char) NULL;
++	s[++i] = '\0';
+ 
+ 	eat_line( c );	/* eat the remaining characters on this line */
+ 
+Index: pvm-3.4.5-31337/examples/rme.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/rme.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/rme.c	2008-06-29 14:38:13.000000000 +0000
+@@ -48,6 +48,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/task0.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/task0.c	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/examples/task0.c	2008-06-29 14:38:13.000000000 +0000
+@@ -57,6 +57,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/task1.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/task1.c	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/examples/task1.c	2008-06-29 14:38:13.000000000 +0000
+@@ -58,6 +58,8 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/task_end.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/task_end.c	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/examples/task_end.c	2008-06-29 14:38:13.000000000 +0000
+@@ -45,6 +45,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/taskf.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/taskf.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/taskf.c	2008-06-29 14:38:13.000000000 +0000
+@@ -41,6 +41,8 @@
+  *
+  *********************************************************************/
+ 
++#include <stdlib.h>
++#include <string.h>
+ #include "stdio.h"
+ #include "pvm3.h"
+ 
+Index: pvm-3.4.5-31337/gexamples/trsg.c
+===================================================================
+--- pvm-3.4.5-31337.orig/gexamples/trsg.c	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/gexamples/trsg.c	2008-06-29 14:38:13.000000000 +0000
+@@ -43,6 +43,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "pvm3.h"
+ 
+ #define MAXNDATA  20
+Index: pvm-3.4.5-31337/pvmgs/pvmgsu_aux.c
+===================================================================
+--- pvm-3.4.5-31337.orig/pvmgs/pvmgsu_aux.c	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/pvmgs/pvmgsu_aux.c	2008-06-29 14:38:13.000000000 +0000
+@@ -42,6 +42,7 @@
+ #include <stdlib.h>
+ #endif
+ #include <stdio.h>
++#include <strings.h>
+ #include <pvm3.h>
+ #include "pvmalloc.h"
+ #include "bfunc.h"
+Index: pvm-3.4.5-31337/rm/srm.c
+===================================================================
+--- pvm-3.4.5-31337.orig/rm/srm.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/rm/srm.c	2008-06-29 14:38:13.000000000 +0000
+@@ -32,6 +32,7 @@
+ 
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <sys/time.h>
+ #include <signal.h>
+Index: pvm-3.4.5-31337/examples/gmbi.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/gmbi.c	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/examples/gmbi.c	2008-06-29 14:38:13.000000000 +0000
+@@ -55,6 +55,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/inherit2.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/inherit2.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/inherit2.c	2008-06-29 14:38:13.000000000 +0000
+@@ -37,6 +37,8 @@
+  *    - read docs in those files.
+  */
+ 
++#include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <unistd.h>		/* for gethostname */
+ #else
+Index: pvm-3.4.5-31337/examples/master1.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/master1.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/master1.c	2008-06-29 14:38:13.000000000 +0000
+@@ -31,6 +31,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "pvm3.h"
+ #define SLAVENAME "slave1"
+ 
+Index: pvm-3.4.5-31337/gexamples/tst.c
+===================================================================
+--- pvm-3.4.5-31337.orig/gexamples/tst.c	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/gexamples/tst.c	2008-06-29 14:38:13.000000000 +0000
+@@ -34,6 +34,8 @@
+ 	test groups
+ */
+ 
++#include <stdio.h>
++
+ int
+ main(argc, argv)
+ int argc;
+Index: pvm-3.4.5-31337/examples/spmd.c
+===================================================================
+--- pvm-3.4.5-31337.orig/examples/spmd.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/examples/spmd.c	2008-06-29 14:38:13.000000000 +0000
+@@ -37,6 +37,7 @@
+ */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include "pvm3.h"
+ #define MAXNPROC 32
+Index: pvm-3.4.5-31337/src/hoster.c
+===================================================================
+--- pvm-3.4.5-31337.orig/src/hoster.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/src/hoster.c	2008-06-29 14:38:13.000000000 +0000
+@@ -230,6 +230,7 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
++#include <unistd.h>
+ #endif
+ 
+ #ifdef NEEDSSELECTH
+Index: pvm-3.4.5-31337/src/lpvm.c
+===================================================================
+--- pvm-3.4.5-31337.orig/src/lpvm.c	2008-06-29 14:36:32.000000000 +0000
++++ pvm-3.4.5-31337/src/lpvm.c	2008-06-29 14:38:13.000000000 +0000
+@@ -560,10 +560,11 @@
+ #include <process.h>
+ #include <stdlib.h>
+ #include <search.h>
++#else
++#include <unistd.h>
+ #endif
+ 
+ #include <stdio.h>
+-#include <stdlib.h>
+ 
+ #ifdef IMA_TITN
+ #include <bsd/sys/types.h>
+Index: pvm-3.4.5-31337/libfpvm/pvmfperror.m4
+===================================================================
+--- pvm-3.4.5-31337.orig/libfpvm/pvmfperror.m4	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/libfpvm/pvmfperror.m4	2008-06-29 14:38:13.000000000 +0000
+@@ -2,6 +2,8 @@
+ /* $Id: pvmfperror.m4,v 1.2 1996/10/04 15:27:26 pvmsrc Exp $ */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include "pvm3.h"
+ #include "pvm_consts.h"
+ 
+@@ -14,7 +16,6 @@
+ {
+ 	static char *buf = 0;
+ 	static int buflen = 0;
+-	char *malloc();
+ 
+ 	/*
+ 	 * Have to have a NUL at the end of the string, and
+Index: pvm-3.4.5-31337/libfpvm/pvmfstartpvmd.m4
+===================================================================
+--- pvm-3.4.5-31337.orig/libfpvm/pvmfstartpvmd.m4	2008-06-29 14:36:31.000000000 +0000
++++ pvm-3.4.5-31337/libfpvm/pvmfstartpvmd.m4	2008-06-29 14:38:13.000000000 +0000
+@@ -15,6 +15,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <string.h>
+ #include "pvm3.h"
+ #include "pvm_consts.h"
+ #include "pvmalloc.h"
only in patch2:
unchanged:
--- pvm-3.4.5.orig/debian/patches/21-soname-related-sanity.patch
+++ pvm-3.4.5/debian/patches/21-soname-related-sanity.patch
@@ -0,0 +1,145 @@
+Index: pvm-3.4.5-31337/src/Makefile.aimk
+===================================================================
+--- pvm-3.4.5-31337.orig/src/Makefile.aimk	2008-06-29 14:35:03.000000000 +0000
++++ pvm-3.4.5-31337/src/Makefile.aimk	2008-06-29 14:35:03.000000000 +0000
+@@ -73,6 +73,10 @@
+ 
+ LIBPREFIX	=	lib
+ LIBPVM		=	$(LIBPREFIX)pvm3
++# Debian-specific: the shared library is $(LIBPVM).so.$(SOVERSION). Change
++# this if there is ABI breakage.
++# (this ought to be set by upstream, but, whatever...)
++SOVERSION	=	3
+ 
+ #
+ # GNU Regular Expression Defines - set if needed
+@@ -203,7 +207,7 @@
+ 
+ OS2TARGETS		=	$(LIBDIR)/pvmd3-os2 $(LIBDIR)/lib-os2
+ 
+-all:	pvmd3$(EXESFX) $(LIBPVM).a $(LIBPVM).so
++all:	pvmd3$(EXESFX) $(LIBPVM).a $(LIBPVM).so $(LIBPVM).so.$(SOVERSION)
+ 
+ all-shm:	pvmd3-shm lib-shm $(LIBPVM)s.a
+ 
+@@ -213,7 +217,7 @@
+ 
+ all-os2:	pvmd3-os2 lib-os2
+ 
+-install:	$(LIBDIR) $(LIBDIR)/pvmd3$(EXESFX) $(LIBDIR)/$(LIBPVM).a $(LIBDIR)/$(LIBPVM).so
++install:	$(LIBDIR) $(LIBDIR)/pvmd3$(EXESFX) $(LIBDIR)/$(LIBPVM).a $(LIBDIR)/$(LIBPVM).so $(LIBDIR)/$(LIBPVM).so.$(SOVERSION)
+ 
+ install-shm:	$(LIBDIR) $(SHMEMTARGETS)
+ 
+@@ -234,8 +238,12 @@
+ $(LIBDIR)/$(LIBPVM).a:	$(LIBPVM).a
+ 	cp $(LIBPVM).a $(LIBDIR)
+ 
+-$(LIBDIR)/$(LIBPVM).so:	$(LIBPVM).so
+-	cp $(LIBPVM).so $(LIBDIR)
++$(LIBDIR)/$(LIBPVM).so.$(SOVERSION):	$(LIBPVM).so.$(SOVERSION)
++	cp $(LIBPVM).so.$(SOVERSION) $(LIBDIR)
++
++$(LIBDIR)/$(LIBPVM).so:	$(LIBDIR)/$(LIBPVM).so.$(SOVERSION)
++	cd $(LIBDIR) && rm -f $(LIBPVM).so
++	cd $(LIBDIR) && ln -s $(LIBPVM).so.$(SOVERSION) $(LIBPVM).so
+ 
+ # libdir shm pvmd3 & libpvm3*.a
+ 
+@@ -292,14 +300,18 @@
+ 	$(AR) cr $(LIBPVM).a $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBPVM).a ;; esac
+ 
+-$(LIBPVM).so: regexconfig
++$(LIBPVM).so: $(LIBPVM).so.$(SOVERSION)
++	rm -f $(LIBPVM).so
++	ln -s $(LIBPVM).so.$(SOVERSION) $(LIBPVM).so
++
++$(LIBPVM).so.$(SOVERSION): regexconfig
+ 	echo -------------------------------
+ 	echo --- Building shared Library ---
+ 	echo -------------------------------
+-	rm -f $(LIBPVM).so $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ) \
++	rm -f $(LIBPVM).so.$(SOVERSION) $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ) \
+ 		$(REGEXDIR)/pvmregex.o $(REGEXDIR)/regex.o
+ 	cd .. && ../lib/aimk CFLOPTS='-fPIC $(CFLOPTS)' $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ)
+-	$(CC) -shared -Wl,-soname,libpvm3.so.3 -o $(LIBPVM).so $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ) -lc
++	$(CC) -shared -Wl,-soname,$(LIBPVM).so.$(SOVERSION) -o $(LIBPVM).so.$(SOVERSION) $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ) -lc
+ 
+ 
+ # shm pvmd3 & libpvm3*.a
+@@ -352,7 +364,7 @@
+ #
+ 
+ clean:	tidy
+-	rm -f pvmd3$(EXESFX) $(LIBPVM).a $(LIBPVM)s.a $(LIBPVM)pe.a $(LIBPVM).so
++	rm -f pvmd3$(EXESFX) $(LIBPVM).a $(LIBPVM)s.a $(LIBPVM)pe.a $(LIBPVM).so $(LIBPVM).so.$(SOVERSION)
+ 	rm -rf $(REGEXDIR)
+ 
+ tidy:
+Index: pvm-3.4.5-31337/pvmgs/Makefile.aimk
+===================================================================
+--- pvm-3.4.5-31337.orig/pvmgs/Makefile.aimk	2008-06-29 14:35:03.000000000 +0000
++++ pvm-3.4.5-31337/pvmgs/Makefile.aimk	2008-06-29 14:37:42.000000000 +0000
+@@ -45,12 +45,14 @@
+ LPROGS		=	$(PVMLDIR)/pvmgs$(EXESFX)
+ 
+ LIBGPVM		=	$(LIBPREFIX)gpvm3
++# The version at the end of the SONAME. Assumed to be the same for pvm and gpvm
++SOVERSION	=	3
+ 
+ install:	all
+ 
+ install-mpp:	all-mpp
+ 
+-all:	$(DIRS) $(PROGS) $(PVMLDIR)/$(LIBGPVM).a $(PVMLDIR)/$(LIBGPVM).so $(LPROGS)
++all:	$(DIRS) $(PROGS) $(PVMLDIR)/$(LIBGPVM).a $(PVMLDIR)/$(LIBGPVM).so $(PVMLDIR)/$(LIBGPVM).so.$(SOVERSION) $(LPROGS)
+ 
+ all-mpp:	$(DIRS) $(PROGS) $(PVMLDIR)/$(LIBGPVM)-mpp $(LPROGS)
+ 
+@@ -79,8 +81,12 @@
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/$(LIBGPVM).a ;; esac
+ 	touch $(PVMLDIR)/$(LIBGPVM)-mpp
+ 
+-$(PVMLDIR)/$(LIBGPVM).so:  $(LIBGPVM).so
+-	cp $(LIBGPVM).so $(PVMLDIR)
++$(PVMLDIR)/$(LIBGPVM).so:  $(PVMLDIR)/$(LIBGPVM).so.$(SOVERSION)
++	rm -f $(PVMLDIR)/$(LIBGPVM).so
++	cd $(PVMLDIR) && ln -s $(LIBGPVM).so.$(SOVERSION) $(LIBGPVM).so
++
++$(PVMLDIR)/$(LIBGPVM).so.$(SOVERSION):  $(LIBGPVM).so.$(SOVERSION)
++	cp $(LIBGPVM).so.$(SOVERSION) $(PVMLDIR)/$(LIBGPVM).so.$(SOVERSION)
+ 
+ $(PVMLDIR)/pvmgs$(EXESFX):  pvmgs$(EXESFX)
+ 	cp pvmgs$(EXESFX) $(PVMLDIR)
+@@ -101,14 +107,18 @@
+ 	$(AR) cr $(LIBGPVM).a $(LOBJ)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBGPVM).a ;; esac
+ 
+-$(LIBGPVM).so:
++$(LIBGPVM).so: $(LIBGPVM).so.$(SOVERSION)
++	rm -f $(LIBGPVM).so
++	ln -s $(LIBGPVM).so.$(SOVERSION) $(LIBGPVM).so
++
++$(LIBGPVM).so.$(SOVERSION):
+ 	echo -------------------------------
+ 	echo --- Building shared Library ---
+ 	echo -------------------------------
+ 	rm -f $(LIBGPVM).a $(LOBJ)
+ 	pwd
+ 	cd .. && ../lib/aimk CFLOPTS='-fPIC $(CFLOPTS)' $(LOBJ)
+-	$(CC) -shared -Wl,-soname,libgpvm3.so.3 -o $(LIBGPVM).so $(LOBJ) -lc
++	$(CC) -shared -Wl,-soname,$(LIBGPVM).so.$(SOVERSION) -o $(LIBGPVM).so.$(SOVERSION) $(LOBJ) -lpvm3 -lc
+ 
+ $(LIBGPVM)-mpp:	$(LOBJ)
+ 	rm -f $(LIBGPVM).a
+@@ -121,7 +131,8 @@
+ 
+ clean:
+ 	rm -f $(DOBJ) $(LOBJ) pvmgs$(EXESFX) $(LIBGPVM).a \
+-		pvm_gstat.o pvmgroups.o pvm_gstat$(EXESFX) pvmgroups$(EXESFX)
++		pvm_gstat.o pvmgroups.o pvm_gstat$(EXESFX) pvmgroups$(EXESFX) \
++		$(LIBGPVM).so.$(SOVERSION) $(LIBGPVM).so
+ 
+ tidy:
+ 	rm -f $(DOBJ) $(LOBJ)
only in patch2:
unchanged:
--- pvm-3.4.5.orig/src/lpvm.c
+++ pvm-3.4.5/src/lpvm.c
@@ -563,6 +563,7 @@
 #endif
 
 #include <stdio.h>
+#include <stdlib.h>
 
 #ifdef IMA_TITN
 #include <bsd/sys/types.h>
only in patch2:
unchanged:
--- pvm-3.4.5.orig/patches/21-soname-related-sanity.patch
+++ pvm-3.4.5/patches/21-soname-related-sanity.patch
@@ -0,0 +1,145 @@
+Index: pvm-3.4.5-31337/pvmgs/Makefile.aimk
+===================================================================
+--- pvm-3.4.5-31337.orig/pvmgs/Makefile.aimk	2008-06-29 14:11:04.000000000 +0000
++++ pvm-3.4.5-31337/pvmgs/Makefile.aimk	2008-06-29 14:13:34.000000000 +0000
+@@ -45,12 +45,14 @@
+ LPROGS		=	$(PVMLDIR)/pvmgs$(EXESFX)
+ 
+ LIBGPVM		=	$(LIBPREFIX)gpvm3
++# The version at the end of the SONAME. Assumed to be the same for pvm and gpvm
++SOVERSION	=	3
+ 
+ install:	all
+ 
+ install-mpp:	all-mpp
+ 
+-all:	$(DIRS) $(PROGS) $(PVMLDIR)/$(LIBGPVM).a $(PVMLDIR)/$(LIBGPVM).so $(LPROGS)
++all:	$(DIRS) $(PROGS) $(PVMLDIR)/$(LIBGPVM).a $(PVMLDIR)/$(LIBGPVM).so $(PVMLDIR)/$(LIBGPVM).so.$(SOVERSION) $(LPROGS)
+ 
+ all-mpp:	$(DIRS) $(PROGS) $(PVMLDIR)/$(LIBGPVM)-mpp $(LPROGS)
+ 
+@@ -79,8 +81,12 @@
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(PVMLDIR)/$(LIBGPVM).a ;; esac
+ 	touch $(PVMLDIR)/$(LIBGPVM)-mpp
+ 
+-$(PVMLDIR)/$(LIBGPVM).so:  $(LIBGPVM).so
+-	cp $(LIBGPVM).so $(PVMLDIR)
++$(PVMLDIR)/$(LIBGPVM).so:  $(PVMLDIR)/$(LIBGPVM).so.$(SOVERSION)
++	rm -f $(PVMLDIR)/$(LIBGPVM).so.$(SOVERSION)
++	cd $(PVMLDIR) && ln -s $(LIBGPVM).so.$(SOVERSION) $(LIBGPVM).so
++
++$(PVMLDIR)/$(LIBGPVM).so.$(SOVERSION):  $(LIBGPVM).so.$(SOVERSION)
++	cp $(LIBGPVM).so.$(SOVERSION) $(PVMLDIR)
+ 
+ $(PVMLDIR)/pvmgs$(EXESFX):  pvmgs$(EXESFX)
+ 	cp pvmgs$(EXESFX) $(PVMLDIR)
+@@ -101,14 +107,18 @@
+ 	$(AR) cr $(LIBGPVM).a $(LOBJ)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBGPVM).a ;; esac
+ 
+-$(LIBGPVM).so:
++$(LIBGPVM).so: $(LIBGPVM).so.$(SOVERSION)
++	rm -f $(LIBGPVM).so
++	ln -s $(LIBGPVM).so.$(SOVERSION) $(LIBGPVM).so
++
++$(LIBGPVM).so.$(SOVERSION):
+ 	echo -------------------------------
+ 	echo --- Building shared Library ---
+ 	echo -------------------------------
+ 	rm -f $(LIBGPVM).a $(LOBJ)
+ 	pwd
+ 	cd .. && ../lib/aimk CFLOPTS='-fPIC $(CFLOPTS)' $(LOBJ)
+-	$(CC) -shared -Wl,-soname,libgpvm3.so.3 -o $(LIBGPVM).so $(LOBJ) -lc
++	$(CC) -shared -Wl,-soname,$(LIBGPVM).so.$(SOVERSION) -o $(LIBGPVM).so.$(SOVERSION) $(LOBJ) -lpvm3 -lc
+ 
+ $(LIBGPVM)-mpp:	$(LOBJ)
+ 	rm -f $(LIBGPVM).a
+@@ -121,7 +131,8 @@
+ 
+ clean:
+ 	rm -f $(DOBJ) $(LOBJ) pvmgs$(EXESFX) $(LIBGPVM).a \
+-		pvm_gstat.o pvmgroups.o pvm_gstat$(EXESFX) pvmgroups$(EXESFX)
++		pvm_gstat.o pvmgroups.o pvm_gstat$(EXESFX) pvmgroups$(EXESFX) \
++		$(LIBGPVM).so.$(SOVERSION) $(LIBGPVM).so
+ 
+ tidy:
+ 	rm -f $(DOBJ) $(LOBJ)
+Index: pvm-3.4.5-31337/src/Makefile.aimk
+===================================================================
+--- pvm-3.4.5-31337.orig/src/Makefile.aimk	2008-06-29 14:11:04.000000000 +0000
++++ pvm-3.4.5-31337/src/Makefile.aimk	2008-06-29 14:11:04.000000000 +0000
+@@ -73,6 +73,10 @@
+ 
+ LIBPREFIX	=	lib
+ LIBPVM		=	$(LIBPREFIX)pvm3
++# Debian-specific: the shared library is $(LIBPVM).so.$(SOVERSION). Change
++# this if there is ABI breakage.
++# (this ought to be set by upstream, but, whatever...)
++SOVERSION	=	3
+ 
+ #
+ # GNU Regular Expression Defines - set if needed
+@@ -203,7 +207,7 @@
+ 
+ OS2TARGETS		=	$(LIBDIR)/pvmd3-os2 $(LIBDIR)/lib-os2
+ 
+-all:	pvmd3$(EXESFX) $(LIBPVM).a $(LIBPVM).so
++all:	pvmd3$(EXESFX) $(LIBPVM).a $(LIBPVM).so $(LIBPVM).so.$(SOVERSION)
+ 
+ all-shm:	pvmd3-shm lib-shm $(LIBPVM)s.a
+ 
+@@ -213,7 +217,7 @@
+ 
+ all-os2:	pvmd3-os2 lib-os2
+ 
+-install:	$(LIBDIR) $(LIBDIR)/pvmd3$(EXESFX) $(LIBDIR)/$(LIBPVM).a $(LIBDIR)/$(LIBPVM).so
++install:	$(LIBDIR) $(LIBDIR)/pvmd3$(EXESFX) $(LIBDIR)/$(LIBPVM).a $(LIBDIR)/$(LIBPVM).so $(LIBDIR)/$(LIBPVM).so.$(SOVERSION)
+ 
+ install-shm:	$(LIBDIR) $(SHMEMTARGETS)
+ 
+@@ -234,8 +238,12 @@
+ $(LIBDIR)/$(LIBPVM).a:	$(LIBPVM).a
+ 	cp $(LIBPVM).a $(LIBDIR)
+ 
+-$(LIBDIR)/$(LIBPVM).so:	$(LIBPVM).so
+-	cp $(LIBPVM).so $(LIBDIR)
++$(LIBDIR)/$(LIBPVM).so.$(SOVERSION):	$(LIBPVM).so.$(SOVERSION)
++	cp $(LIBPVM).so.$(SOVERSION) $(LIBDIR)
++
++$(LIBDIR)/$(LIBPVM).so:	$(LIBDIR)/$(LIBPVM).so.$(SOVERSION)
++	cd $(LIBDIR) && rm -f $(LIBPVM).so
++	cd $(LIBDIR) && ln -s $(LIBPVM).so.$(SOVERSION) $(LIBPVM).so
+ 
+ # libdir shm pvmd3 & libpvm3*.a
+ 
+@@ -292,14 +300,18 @@
+ 	$(AR) cr $(LIBPVM).a $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ)
+ 	case x$(HASRANLIB) in xt ) echo ranlib; ranlib $(LIBPVM).a ;; esac
+ 
+-$(LIBPVM).so: regexconfig
++$(LIBPVM).so: $(LIBPVM).so.$(SOVERSION)
++	rm -f $(LIBPVM).so
++	ln -s $(LIBPVM).so.$(SOVERSION) $(LIBPVM).so
++
++$(LIBPVM).so.$(SOVERSION): regexconfig
+ 	echo -------------------------------
+ 	echo --- Building shared Library ---
+ 	echo -------------------------------
+-	rm -f $(LIBPVM).so $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ) \
++	rm -f $(LIBPVM).so.$(SOVERSION) $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ) \
+ 		$(REGEXDIR)/pvmregex.o $(REGEXDIR)/regex.o
+ 	cd .. && ../lib/aimk CFLOPTS='-fPIC $(CFLOPTS)' $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ)
+-	$(CC) -shared -Wl,-soname,libpvm3.so.3 -o $(LIBPVM).so $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ) -lc
++	$(CC) -shared -Wl,-soname,$(LIBPVM).so.$(SOVERSION) -o $(LIBPVM).so.$(SOVERSION) $(LOBJ) $(LPVMSOCK) $(SOCKLOBJ) -lc
+ 
+ 
+ # shm pvmd3 & libpvm3*.a
+@@ -352,7 +364,7 @@
+ #
+ 
+ clean:	tidy
+-	rm -f pvmd3$(EXESFX) $(LIBPVM).a $(LIBPVM)s.a $(LIBPVM)pe.a $(LIBPVM).so
++	rm -f pvmd3$(EXESFX) $(LIBPVM).a $(LIBPVM)s.a $(LIBPVM)pe.a $(LIBPVM).so $(LIBPVM).so.$(SOVERSION)
+ 	rm -rf $(REGEXDIR)
+ 
+ tidy:

Attachment: signature.asc
Description: Digital signature

Reply via email to