File: grid-packaging-tools-perlpath.patch

package info (click to toggle)
grid-packaging-tools 3.2globus2-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,816 kB
  • ctags: 1,621
  • sloc: perl: 19,536; sh: 3,047; makefile: 320; exp: 89
file content (388 lines) | stat: -rw-r--r-- 12,306 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
diff -ur gpt.orig/packaging_tools/configure gpt/packaging_tools/configure
--- gpt.orig/packaging_tools/configure	2006-01-11 17:10:11.000000000 +0100
+++ gpt/packaging_tools/configure	2008-10-04 10:57:47.000000000 +0200
@@ -273,7 +273,7 @@
 PACKAGE_BUGREPORT=''
 
 ac_unique_file="Makefile.am"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot PERL POD2MAN TAR GUNZIP GZIP LN_S GPT_LOCATION LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot PERL POD2MAN perlmoduledir TAR GUNZIP GZIP LN_S GPT_LOCATION LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -796,7 +796,10 @@
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
- --with-perl=<path>     specify path to perl binary
+  --with-perl=PATH        path to perl binary
+  --with-perlmoduledir=DIR
+                          perl module installation directory
+                          [PREFIX/lib/perl]
 
 _ACEOF
 fi
@@ -1842,7 +1845,34 @@
 
 
 
-#echo "POD2MAN=$POD2MAN"
+
+# Check whether --with-perlmoduledir was given.
+if test "${with_perlmoduledir+set}" = set; then
+  withval=$with_perlmoduledir;
+    case $withval in
+    no)
+        echo "--with-perlmoduledir requires an argument" >&2
+        exit 1
+        ;;
+    yes)
+        echo "--with-perlmoduledir requires an argument" >&2
+        exit 1
+        ;;
+    *)
+        perlmoduledir=$withval
+        ;;
+    esac
+
+else
+
+    perlmoduledir='${prefix}/lib/perl'
+
+
+fi
+
+
+
+
 
 # checking for the GPT_LOCATION
 
@@ -2675,6 +2705,7 @@
 s,@am__leading_dot@,$am__leading_dot,;t t
 s,@PERL@,$PERL,;t t
 s,@POD2MAN@,$POD2MAN,;t t
+s,@perlmoduledir@,$perlmoduledir,;t t
 s,@TAR@,$TAR,;t t
 s,@GUNZIP@,$GUNZIP,;t t
 s,@GZIP@,$GZIP,;t t
diff -ur gpt.orig/packaging_tools/configure.ac gpt/packaging_tools/configure.ac
--- gpt.orig/packaging_tools/configure.ac	2006-01-11 17:10:11.000000000 +0100
+++ gpt/packaging_tools/configure.ac	2008-10-04 10:57:47.000000000 +0200
@@ -8,7 +8,7 @@
 
 AC_ARG_WITH([perl],
 	
-[ --with-perl=<path>     specify path to perl binary ],
+AC_HELP_STRING([--with-perl=PATH], [path to perl binary]),
 [
 	case $withval in
 	no)
@@ -21,7 +21,6 @@
 		;;
 	*)
                 PERL=$withval
-                AC_SUBST(PERL) 
                 POD2MAN=`echo $PERL | sed 's!bin/perl!bin/pod2man!'`
                 if ! test -f $POD2MAN; then
                  POD2MAN=
@@ -35,11 +34,36 @@
 ]
 )
 
+AC_SUBST(PERL)
+AC_SUBST(POD2MAN)
 
 
-AC_SUBST(POD2MAN)
+AC_ARG_WITH([perlmoduledir],
+
+AC_HELP_STRING([--with-perlmoduledir=DIR],
+[perl module installation directory [[PREFIX/lib/perl]]]),
+[
+    case $withval in
+    no)
+        echo "--with-perlmoduledir requires an argument" >&2
+        exit 1
+        ;;
+    yes)
+        echo "--with-perlmoduledir requires an argument" >&2
+        exit 1
+        ;;
+    *)
+        perlmoduledir=$withval
+        ;;
+    esac
+],
+[
+    perlmoduledir='${prefix}/lib/perl'
+]
+)
+
+AC_SUBST(perlmoduledir)
 
-#echo "POD2MAN=$POD2MAN"
 
 # checking for the GPT_LOCATION
 
diff -ur gpt.orig/packaging_tools/Makefile.am gpt/packaging_tools/Makefile.am
--- gpt.orig/packaging_tools/Makefile.am	2006-01-11 17:10:11.000000000 +0100
+++ gpt/packaging_tools/Makefile.am	2008-10-04 10:57:47.000000000 +0200
@@ -39,7 +39,7 @@
 
 gptexecshare_SCRIPTS = config.guess
 
-gptmodulesdir = ${prefix}/lib/perl/Grid/GPT
+gptmodulesdir = $(perlmoduledir)/Grid/GPT
 
 gptmodules_DATA = \
 	perl/GPT/Algorithms.pm \
@@ -175,7 +175,9 @@
 
 install-localize:
 	@echo "Localizing scripts to $(PERL)"
+	PERLLIB=$(DESTDIR)$(perlmoduledir) \
 	$(PERL) $(DESTDIR)$(sbindir)/gpt-config -perl=$(PERL) \
+	-location=$(DESTDIR)$(prefix) \
 	-probe \
 	-ignore-errors
 
diff -ur gpt.orig/packaging_tools/Makefile.in gpt/packaging_tools/Makefile.in
--- gpt.orig/packaging_tools/Makefile.in	2006-01-11 17:10:11.000000000 +0100
+++ gpt/packaging_tools/Makefile.in	2008-10-04 10:57:47.000000000 +0200
@@ -98,6 +98,7 @@
 localstatedir = @localstatedir@
 mandir = @mandir@
 oldincludedir = @oldincludedir@
+perlmoduledir = @perlmoduledir@
 prefix = $(GPT_LOCATION)
 program_transform_name = @program_transform_name@
 sbindir = @sbindir@
@@ -148,7 +149,7 @@
 
 gptexecshare_SCRIPTS = config.guess
 
-gptmodulesdir = ${prefix}/lib/perl/Grid/GPT
+gptmodulesdir = $(perlmoduledir)/Grid/GPT
 
 gptmodules_DATA = \
 	perl/GPT/Algorithms.pm \
@@ -840,7 +841,9 @@
 
 install-localize:
 	@echo "Localizing scripts to $(PERL)"
+	PERLLIB=$(DESTDIR)$(perlmoduledir) \
 	$(PERL) $(DESTDIR)$(sbindir)/gpt-config -perl=$(PERL) \
+	-location=$(DESTDIR)$(prefix) \
 	-probe \
 	-ignore-errors
 
diff -ur gpt.orig/packaging_tools/perl/GPT/Localize.pm gpt/packaging_tools/perl/GPT/Localize.pm
--- gpt.orig/packaging_tools/perl/GPT/Localize.pm	2007-06-24 22:26:36.000000000 +0200
+++ gpt/packaging_tools/perl/GPT/Localize.pm	2008-10-04 10:57:47.000000000 +0200
@@ -49,7 +49,6 @@
 sub new {
   my ($that, %args)  = @_;
 
-  push @INC, 
   my $class = ref($that) || $that;
   my $me  = {
              ignore_errors => $args{'ignore_errors'},
@@ -328,14 +327,16 @@
 sub localize {
   my($me) = @_;
 
-  my $gpath = $me->{'gpath'};
+  my $pmpath;
 
-  require Grid::GPT::FilelistFunctions;
-  Grid::GPT::FilelistFunctions::mkinstalldir("$gpath/var/lib/perl/Grid/GPT/");
+  foreach my $dir (@INC) {
+    next unless ( -e "$dir/Grid/GPT/LocalEnv.pm.in" );
+    $pmpath = $dir;
+    last;
+  }
 
-  open INFILE, "$gpath/lib/perl/Grid/GPT/LocalEnv.pm.in";
-  open OUTFILE, ">$gpath/var/lib/perl/Grid/GPT/LocalEnv.pm";
-  my $link = ">$gpath/var/lib/perl/Grid/GPT/LocalEnv.pm";
+  open INFILE, "$pmpath/Grid/GPT/LocalEnv.pm.in";
+  open OUTFILE, ">$pmpath/Grid/GPT/LocalEnv.pm";
 
   for my $l (<INFILE>) {
     while (my ($n,$v) = each(%{$me->{'substitutions'}})) {
diff -ur gpt.orig/packaging_tools/perl/GPT/PkgMngmt/Archive.pm gpt/packaging_tools/perl/GPT/PkgMngmt/Archive.pm
--- gpt.orig/packaging_tools/perl/GPT/PkgMngmt/Archive.pm	2006-01-11 17:10:11.000000000 +0100
+++ gpt/packaging_tools/perl/GPT/PkgMngmt/Archive.pm	2008-10-04 10:57:47.000000000 +0200
@@ -75,21 +75,6 @@
     
     return if defined $gtar;
 
-    my $gpath = $ENV{GPT_LOCATION};
-
-    if (!defined($gpath))
-      {
-        $gpath = $ENV{GLOBUS_LOCATION};
-      }
-
-    if (!defined($gpath))
-      {
-        die "GPT_LOCATION or needs to be set before running this script";
-      }
-
-    # Add path to LocalEnv module to @INC
-    push @INC,"$gpath/var/lib/perl";
-
     die "ERROR: GPT is not configured. Use gpt-config\n" 
       if ! defined eval ("require Grid::GPT::LocalEnv;");
 
@@ -110,24 +95,6 @@
 sub new {
   my ($class, %arg) = @_;
 
-
-
-
-  my $gpath = $ENV{GPT_LOCATION};
-
-  if (!defined($gpath))
-    {
-      $gpath = $ENV{GLOBUS_LOCATION};
-    }
-
-  if (!defined($gpath))
-    {
-      die "GPT_LOCATION or needs to be set before running this script";
-    }
-
-  # Add path to LocalEnv module to @INC
-  push @INC,"$gpath/var/lib/perl";
-
   die "ERROR: GPT is not configured. Use gpt-config\n" 
     if ! defined eval ("require Grid::GPT::LocalEnv;");
 
diff -ur gpt.orig/packaging_tools/perl/GPT/PkgMngmt/BuildMacros.pm gpt/packaging_tools/perl/GPT/PkgMngmt/BuildMacros.pm
--- gpt.orig/packaging_tools/perl/GPT/PkgMngmt/BuildMacros.pm	2006-03-16 19:27:23.000000000 +0100
+++ gpt/packaging_tools/perl/GPT/PkgMngmt/BuildMacros.pm	2008-10-04 10:57:47.000000000 +0200
@@ -21,21 +21,6 @@
 
 # Preloaded methods go here.
 sub find_make {
-  my $gpath = $ENV{GPT_LOCATION};
-
-  if (!defined($gpath))
-    {
-      $gpath = $ENV{GLOBUS_LOCATION};
-    }
-
-  if (!defined($gpath))
-    {
-      die "GPT_LOCATION or needs to be set before running this script";
-    }
-
-  # Add path to LocalEnv module to @INC
-  push @INC,"$gpath/var/lib/perl";
-
   die "ERROR: GPT is not configured. Use gpt-config\n" 
     if ! defined eval ("require Grid::GPT::LocalEnv;");
 
diff -ur gpt.orig/packaging_tools/perl/GPT/PkgMngmt/ExpandSource.pm gpt/packaging_tools/perl/GPT/PkgMngmt/ExpandSource.pm
--- gpt.orig/packaging_tools/perl/GPT/PkgMngmt/ExpandSource.pm	2006-01-11 17:10:12.000000000 +0100
+++ gpt/packaging_tools/perl/GPT/PkgMngmt/ExpandSource.pm	2008-10-04 10:57:47.000000000 +0200
@@ -61,21 +61,6 @@
 
     return if defined $gtar;
 
-    my $gpath = $ENV{GPT_LOCATION};
-
-    if (!defined($gpath))
-      {
-        $gpath = $ENV{GLOBUS_LOCATION};
-      }
-
-    if (!defined($gpath))
-      {
-        die "GPT_LOCATION or needs to be set before running this script";
-      }
-
-    # Add path to LocalEnv module to @INC
-    push @INC,"$gpath/var/lib/perl";
-
     die "ERROR: GPT is not configured. Use gpt-config\n" 
       if ! defined eval ("require Grid::GPT::LocalEnv;");
 
diff -ur gpt.orig/packaging_tools/perl/GPT/PkgMngmt.pm gpt/packaging_tools/perl/GPT/PkgMngmt.pm
--- gpt.orig/packaging_tools/perl/GPT/PkgMngmt.pm	2006-01-11 17:10:11.000000000 +0100
+++ gpt/packaging_tools/perl/GPT/PkgMngmt.pm	2008-10-04 10:57:47.000000000 +0200
@@ -23,21 +23,6 @@
 
     return $rpm if defined $rpm;
 
-    my $gpath = $ENV{GPT_LOCATION};
-    
-    if (!defined($gpath))
-      {
-        $gpath = $ENV{GLOBUS_LOCATION};
-      }
-
-    if (!defined($gpath))
-      {
-        die "GPT_LOCATION or needs to be set before running this script";
-      }
-
-    # Add path to LocalEnv module to @INC
-    push @INC,"$gpath/var/lib/perl";
-
     die "ERROR: GPT is not configured. Use gpt-config\n" 
       if ! defined eval ("require Grid::GPT::LocalEnv;");
 
@@ -86,21 +71,6 @@
     
     return if defined $gtar;
 
-    my $gpath = $ENV{GPT_LOCATION};
-
-    if (!defined($gpath))
-      {
-        $gpath = $ENV{GLOBUS_LOCATION};
-      }
-
-    if (!defined($gpath))
-      {
-        die "GPT_LOCATION or needs to be set before running this script";
-      }
-
-    # Add path to LocalEnv module to @INC
-    push @INC,"$gpath/var/lib/perl";
-
     die "ERROR: GPT is not configured. Use gpt-config\n" 
       if ! defined eval ("require Grid::GPT::LocalEnv;");
 
diff -ur gpt.orig/packaging_tools/perl/scripts/gpt-bundle gpt/packaging_tools/perl/scripts/gpt-bundle
--- gpt.orig/packaging_tools/perl/scripts/gpt-bundle	2006-01-11 17:10:12.000000000 +0100
+++ gpt/packaging_tools/perl/scripts/gpt-bundle	2008-10-04 10:57:47.000000000 +0200
@@ -811,9 +811,6 @@
 
   if (! defined $arch) 
   {
-  # Add path to LocalEnv module to @INC
-  push @INC,"$gpath/var/lib/perl";
-
   die "ERROR: GPT is not configured. Use gpt-config\n" 
     if ! defined eval ("require Grid::GPT::LocalEnv;");
 
diff -ur gpt.orig/packaging_tools/perl/scripts/gpt-config gpt/packaging_tools/perl/scripts/gpt-config
--- gpt.orig/packaging_tools/perl/scripts/gpt-config	2006-01-11 17:10:12.000000000 +0100
+++ gpt/packaging_tools/perl/scripts/gpt-config	2008-10-04 10:57:47.000000000 +0200
@@ -82,11 +82,6 @@
   exit 0;
 }
 
-# Add path to LocalEnv module to @INC
-
-push @INC,"$gpath/var/lib/perl";
-
-
 if (defined $list) {
   die "ERROR: GPT has not been configured\n" 
     if ! defined eval "require Grid::GPT::LocalEnv;";