lcgdm (1.8.2-1) lcgdm-paths.patch

Summary

 config/site.def  |    2 +-
 dpm/Imakefile    |   35 +++++++++++++++++------------------
 ns/Imakefile.lfc |   55 +++++++++++++++++++++++++++----------------------------
 3 files changed, 45 insertions(+), 47 deletions(-)

    
download this patch

Patch contents

diff -ur lcgdm-1.8.2.orig/config/site.def lcgdm-1.8.2/config/site.def
--- lcgdm-1.8.2.orig/config/site.def	2011-12-06 14:35:18.000000000 +0100
+++ lcgdm-1.8.2/config/site.def	2011-12-06 15:25:44.791777417 +0100
@@ -82,7 +82,7 @@
 #if defined(_WIN32)
 #define InstallPythonDir   \\cern.ch\dfs\Applications\CERN\LFC\lib\python
 #else
-#define InstallPythonDir   $(prefix)/$(_lib)/python
+#define InstallPythonDir   $(shell python -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,'$(prefix)'))")
 #endif
 #define LibManDir       $(prefix)/share/man/man3
 #define LibManSuffix    3
diff -ur lcgdm-1.8.2.orig/dpm/Imakefile lcgdm-1.8.2/dpm/Imakefile
--- lcgdm-1.8.2.orig/dpm/Imakefile	2011-12-06 15:23:16.705773287 +0100
+++ lcgdm-1.8.2/dpm/Imakefile	2011-12-06 15:25:44.792777417 +0100
@@ -8,11 +8,10 @@
 
 #if BuildInterfaces
 PYTHON=PythonProgram
-PYTHON_VERSION=$(shell $(PYTHON) -c "import sys; print sys.version[:3]")
-PYTHON_PREFIX=$(shell $(PYTHON) -c "import os; import sys; print os.path.normpath(sys.prefix)")
-INCLUDE_PYTHON=-I$(shell $(PYTHON) -c "from distutils import sysconfig; print sysconfig.get_python_inc(0,prefix='${PYTHON_PREFIX}')")
-PYTHON_LIB=$(shell $(PYTHON) -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,1,prefix='${PYTHON_PREFIX}')")
-INCLUDE_PERL=-I$(shell perl -MConfig -e 'print $$Config{archlibexp}, "/CORE";')
+INCLUDE_PYTHON=$(shell $(PYTHON) -c "from distutils import sysconfig; print('-I' + sysconfig.get_python_inc(0))")
+PYTHON_LIB=$(shell $(PYTHON) -c "from distutils import sysconfig; import sys; print('-L' + sysconfig.get_config_var('LIBDEST') + '/config -lpython' + sys.version[:3] + ' ' + sysconfig.get_config_var('LIBS') + ' ' + sysconfig.get_config_var('SYSLIBS'))")
+INCLUDE_PERL=$(shell perl -MConfig -e 'print "-I", $$Config{archlibexp}, "/CORE";')
+PERL_LIB=$(shell perl -MConfig -e 'print "-L", $$Config{archlibexp}, "/CORE -lperl ", $$Config{perllibs};')
 SWIG_LOCATION = SwigLocation
 SWIG = SWIG_LIB=SwigLib $(SWIG_LOCATION)/bin/swig
 #endif
@@ -249,14 +248,14 @@
            _dpm2.so \
            dpm2.py
 IDPM_IFCE = $(PERLDIR) \
-            $(PYTHONDIR)$(PYTHON_VERSION)/site-packages \
+            $(PYTHONDIR) \
             FileName($(BIN),ProgramTargetName(dpm-listspaces)) \
             FileName($(PERLDIR),dpm.so) \
             FileName($(PERLDIR),dpm.pm) \
-            FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,_dpm.so) \
-            FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,dpm.py) \
-            FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,_dpm2.so) \
-            FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,dpm2.py)
+            FileName($(PYTHONDIR),_dpm.so) \
+            FileName($(PYTHONDIR),dpm.py) \
+            FileName($(PYTHONDIR),_dpm2.so) \
+            FileName($(PYTHONDIR),dpm2.py)
 #endif
 
 DPMLIB_OBJS =	dpm_abortfiles.Osuf \
@@ -430,28 +429,28 @@
 	RemoveFiles(dpm_perlwrap.o dpm_perlwrap.c)
 	$(SWIG) -perl -I$(INCLUDES) -DNSTYPE_DPNS -o dpm_perlwrap.c dpm.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) $(INCLUDE_PERL) -Dbool=char -D_GNU_SOURCE -DNSTYPE_DPNS dpm_perlwrap.c
-	$(LD) $(SHLIBLDFLAGS) -o dpm.so dpm_perlwrap.o $(LIBS) -ldpm
+	$(LD) $(SHLIBLDFLAGS) -o dpm.so dpm_perlwrap.o $(PERL_LIB) $(LIBS)
 
 dpm.py : _dpm.so
 _dpm.so : dpm.i ../h/dpm_api.h ../h/dpns_api.h ../h/Cns_api.h
 	RemoveFiles(dpm_wrap.o dpm_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -DNSTYPE_DPNS dpm.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) $(INCLUDE_PYTHON) -DNSTYPE_DPNS dpm_wrap.c
-	$(LD) $(SHLIBLDFLAGS) -o _dpm.so dpm_wrap.o $(LIBS) -ldpm
+	$(LD) $(SHLIBLDFLAGS) -o _dpm.so dpm_wrap.o $(PYTHON_LIB) $(LIBS)
 
 dpm2.py : _dpm2.so
 _dpm2.so : dpm2.i ../h/dpm_api.h ../h/dpns_api.h ../h/Cns_api.h
 	RemoveFiles(dpm2_wrap.o dpm2_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -I../ns -DNSTYPE_DPNS dpm2.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) $(INCLUDE_PYTHON) -DNSTYPE_DPNS dpm2_wrap.c
-	$(LD) $(SHLIBLDFLAGS) -o _dpm2.so dpm2_wrap.o $(LIBS) -ldpm
+	$(LD) $(SHLIBLDFLAGS) -o _dpm2.so dpm2_wrap.o $(PYTHON_LIB) $(LIBS)
 
 InstallTarget(dpm.so,root,root,0755,$(PERLDIR))
 InstallTarget(dpm.pm,root,root,0644,$(PERLDIR))
-InstallTarget(_dpm.so,root,root,0755,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
-InstallTarget(dpm.py,root,root,0644,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
-InstallTarget(_dpm2.so,root,root,0755,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
-InstallTarget(dpm2.py,root,root,0644,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
+InstallTarget(_dpm.so,root,root,0755,$(PYTHONDIR))
+InstallTarget(dpm.py,root,root,0644,$(PYTHONDIR))
+InstallTarget(_dpm2.so,root,root,0755,$(PYTHONDIR))
+InstallTarget(dpm2.py,root,root,0644,$(PYTHONDIR))
 InstallProgram(dpm-listspaces,$(BIN),root,bin,755)
 
 MakeDir($(BIN),root,bin,0755)
@@ -464,7 +463,7 @@
 
 #if BuildInterfaces
 MakeDir($(PERLDIR),root,root,0755)
-MakeDir($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,root,root,0755)
+MakeDir($(PYTHONDIR),root,root,0755)
 #endif
 
 install.man: $(MANDIRS) $(MANPAGESCLIENT) $(MANPAGESSERVER) $(MANPAGESIFCE)
diff -ur lcgdm-1.8.2.orig/ns/Imakefile.lfc lcgdm-1.8.2/ns/Imakefile.lfc
--- lcgdm-1.8.2.orig/ns/Imakefile.lfc	2011-12-06 15:23:16.644773285 +0100
+++ lcgdm-1.8.2/ns/Imakefile.lfc	2011-12-06 15:25:44.845777421 +0100
@@ -22,11 +22,10 @@
 
 #if BuildInterfaces
 PYTHON=PythonProgram
-PYTHON_VERSION=$(shell $(PYTHON) -c "import sys; print sys.version[:3]")
-PYTHON_PREFIX=$(shell $(PYTHON) -c "import os; import sys; print os.path.normpath(sys.prefix)")
-INCLUDE_PYTHON=-I$(shell $(PYTHON) -c "from distutils import sysconfig; print sysconfig.get_python_inc(0,prefix='${PYTHON_PREFIX}')")
-PYTHON_LIB=$(shell $(PYTHON) -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,1,prefix='${PYTHON_PREFIX}')")
-INCLUDE_PERL=-I$(shell perl -MConfig -e 'print $$Config{archlibexp}, "/CORE";')
+INCLUDE_PYTHON=$(shell $(PYTHON) -c "from distutils import sysconfig; print('-I' + sysconfig.get_python_inc(0))")
+PYTHON_LIB=$(shell $(PYTHON) -c "from distutils import sysconfig; import sys; print('-L' + sysconfig.get_config_var('LIBDEST') + '/config -lpython' + sys.version[:3] + ' ' + sysconfig.get_config_var('LIBS') + ' ' + sysconfig.get_config_var('SYSLIBS'))")
+INCLUDE_PERL=$(shell perl -MConfig -e 'print "-I", $$Config{archlibexp}, "/CORE";')
+PERL_LIB=$(shell perl -MConfig -e 'print "-L", $$Config{archlibexp}, "/CORE -lperl ", $$Config{perllibs};')
 SWIG_LOCATION = SwigLocation
 SWIG = SWIG_LIB=SwigLib $(SWIG_LOCATION)/bin/swig
 #endif
@@ -248,17 +247,17 @@
 	   _lfc2thr.so\
 	   lfc2thr.py
 ILFC_IFCE = $(PERLDIR) \
-	    $(PYTHONDIR)$(PYTHON_VERSION)/site-packages \
+	    $(PYTHONDIR) \
 	    FileName($(PERLDIR),lfc.so) \
 	    FileName($(PERLDIR),lfc.pm) \
-	    FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,_lfc.so) \
-	    FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,lfc.py) \
-	    FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,_lfcthr.so) \
-	    FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,lfcthr.py) \
-	    FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,_lfc2.so) \
-	    FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,lfc2.py) \
-	    FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,_lfc2thr.so) \
-	    FileName($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,lfc2thr.py)
+	    FileName($(PYTHONDIR),_lfc.so) \
+	    FileName($(PYTHONDIR),lfc.py) \
+	    FileName($(PYTHONDIR),_lfcthr.so) \
+	    FileName($(PYTHONDIR),lfcthr.py) \
+	    FileName($(PYTHONDIR),_lfc2.so) \
+	    FileName($(PYTHONDIR),lfc2.py) \
+	    FileName($(PYTHONDIR),_lfc2thr.so) \
+	    FileName($(PYTHONDIR),lfc2thr.py)
 #endif
 
 NSDAEMON_OBJS	=	Cns_main.Osuf \
@@ -485,53 +484,53 @@
 	RemoveFiles(lfc_perlwrap.o lfc_perlwrap.c)
 	$(SWIG) -perl -I$(INCLUDES) -DNSTYPE_LFC -o lfc_perlwrap.c lfc.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) -DNSTYPE_LFC $(INCLUDE_PERL) -Dbool=char -D_GNU_SOURCE lfc_perlwrap.c
-	$(LD) $(SHLIBLDFLAGS) -o lfc.so lfc_perlwrap.o $(LIBS) -llfc
+	$(LD) $(SHLIBLDFLAGS) -o lfc.so lfc_perlwrap.o $(PERL_LIB) $(LIBS)
 
 lfc.py : _lfc.so
 _lfc.so : lfc.i ../h/lfc_api.h ../h/Cns_api.h
 	RemoveFiles(lfc_wrap.o lfc_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -DNSTYPE_LFC lfc.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) -DNSTYPE_LFC $(INCLUDE_PYTHON) lfc_wrap.c
-	$(LD) $(SHLIBLDFLAGS) -o _lfc.so lfc_wrap.o $(LIBS) -llfc
+	$(LD) $(SHLIBLDFLAGS) -o _lfc.so lfc_wrap.o $(PYTHON_LIB) $(LIBS)
 
 InstallTarget(lfc.so,root,root,0755,$(PERLDIR))
 InstallTarget(lfc.pm,root,root,0644,$(PERLDIR))
-InstallTarget(_lfc.so,root,root,0755,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
-InstallTarget(lfc.py,root,root,0644,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
+InstallTarget(_lfc.so,root,root,0755,$(PYTHONDIR))
+InstallTarget(lfc.py,root,root,0644,$(PYTHONDIR))
 
 lfc2.py : _lfc2.so
 _lfc2.so : lfc2.i ../h/lfc_api.h ../h/Cns_api.h
 	RemoveFiles(lfc2_wrap.o lfc2_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -DNSTYPE_LFC lfc2.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) -DNSTYPE_LFC $(INCLUDE_PYTHON) lfc2_wrap.c
-	$(LD) $(SHLIBLDFLAGS) -o _lfc2.so lfc2_wrap.o $(LIBS) -llfc
+	$(LD) $(SHLIBLDFLAGS) -o _lfc2.so lfc2_wrap.o $(PYTHON_LIB) $(LIBS)
 
-InstallTarget(_lfc2.so,root,root,0755,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
-InstallTarget(lfc2.py,root,root,0644,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
+InstallTarget(_lfc2.so,root,root,0755,$(PYTHONDIR))
+InstallTarget(lfc2.py,root,root,0644,$(PYTHONDIR))
 
 lfcthr.py : _lfcthr.so
 _lfcthr.so : lfcthr.i ../h/lfc_api.h ../h/Cns_api.h
 	RemoveFiles(lfcthr_wrap.o lfcthr_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -DNSTYPE_LFC lfcthr.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) -DNSTYPE_LFC $(INCLUDE_PYTHON) lfcthr_wrap.c
-	$(LD) $(SHLIBLDFLAGS) -o _lfcthr.so lfcthr_wrap.o $(LIBS) -llfc
+	$(LD) $(SHLIBLDFLAGS) -o _lfcthr.so lfcthr_wrap.o $(PYTHON_LIB) $(LIBS)
 
-InstallTarget(_lfcthr.so,root,root,0755,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
-InstallTarget(lfcthr.py,root,root,0644,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
+InstallTarget(_lfcthr.so,root,root,0755,$(PYTHONDIR))
+InstallTarget(lfcthr.py,root,root,0644,$(PYTHONDIR))
 
 lfc2thr.py : _lfc2thr.so
 _lfc2thr.so : lfc2thr.i ../h/lfc_api.h ../h/Cns_api.h
 	RemoveFiles(lfc2thr_wrap.o lfc2thr_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -DNSTYPE_LFC lfc2thr.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) -DNSTYPE_LFC $(INCLUDE_PYTHON) lfc2thr_wrap.c
-	$(LD) $(SHLIBLDFLAGS) -o _lfc2thr.so lfc2thr_wrap.o $(LIBS) -llfc
+	$(LD) $(SHLIBLDFLAGS) -o _lfc2thr.so lfc2thr_wrap.o $(PYTHON_LIB) $(LIBS)
 
-InstallTarget(_lfc2thr.so,root,root,0755,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
-InstallTarget(lfc2thr.py,root,root,0644,$(PYTHONDIR)$(PYTHON_VERSION)/site-packages)
+InstallTarget(_lfc2thr.so,root,root,0755,$(PYTHONDIR))
+InstallTarget(lfc2thr.py,root,root,0644,$(PYTHONDIR))
 
 #if BuildInterfaces
 MakeDir($(PERLDIR),root,root,0755)
-MakeDir($(PYTHONDIR)$(PYTHON_VERSION)/site-packages,root,root,0755)
+MakeDir($(PYTHONDIR),root,root,0755)
 #endif
 
 install.man: $(MANDIRS) $(MANPAGESCLIENT) $(MANPAGESLIBRARY) $(MANPAGESSERVER) $(MANPAGESIFCE) $(MANPAGESARGUS)