~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/trilinoscouplings/config/replace-install-prefix.pl

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
2
 
use strict;
3
 
use Getopt::Long;
4
 
#
5
 
# This script is called to do a set of text replacements for installing
6
 
# a Mafile.export.package file so that external clients can use it.
7
 
#
8
 
# Read in commandline arguments
9
 
#
10
 
my $exec_prefix = "";           # [required] Abs path to base installation directory (i.e. --prefix=??? option passed to configure)
11
 
my $my_export_makefile = "";    # [required] Name only of installed Makefile.export.package file
12
 
my $my_top_srcdir = "";         # [required] Abs path to this package's top source directory
13
 
my $my_incl_dirs = "";          # [required] Abs path to this package's include directories
14
 
my $my_lib_dirs = "";           # [optional] Abs path to this package's library directories (if any exist)
15
 
my $dep_package_builddirs = ""; # [optional] Abs paths to other directly dependent framework package build directories (if any exist)
16
 
GetOptions(
17
 
  "exec-prefix=s"                   => \$exec_prefix,
18
 
  "my-export-makefile=s"            => \$my_export_makefile,
19
 
  "my-abs-top-srcdir=s"             => \$my_top_srcdir,
20
 
  "my-abs-incl-dirs=s"              => \$my_incl_dirs,
21
 
  "my-abs-lib-dirs=s"               => \$my_lib_dirs,
22
 
  "dep-package-abs-builddirs=s"     => \$dep_package_builddirs
23
 
  );
24
 
#
25
 
# Validate commandline arguments
26
 
#
27
 
scalar(@ARGV) == 0 || die;
28
 
$exec_prefix ne "" || die;
29
 
$my_export_makefile ne "" || die;
30
 
$my_top_srcdir ne "" || die;
31
 
$my_incl_dirs ne "" || die;
32
 
#
33
 
# Interpret commandline arguments
34
 
#
35
 
$exec_prefix = remove_rel_paths($exec_prefix);
36
 
my @my_incl_dirs = split(":",$my_incl_dirs);
37
 
my @my_lib_dirs = split(":",$my_lib_dirs);
38
 
my @dep_export_package_builddirs = split(":",$dep_package_builddirs);
39
 
#
40
 
# Do the replacements
41
 
#
42
 
my $my_abs_export_makefile = "${exec_prefix}/include/${my_export_makefile}";
43
 
 
44
 
my $cmnd_base = "${my_top_srcdir}/config/token-replace.pl ";
45
 
#
46
 
foreach(@dep_export_package_builddirs) {
47
 
  if($_ ne "") {
48
 
    run_cmnd($cmnd_base . "${_} ${exec_prefix}/include ${my_abs_export_makefile} ${my_abs_export_makefile}");
49
 
  }
50
 
}
51
 
#
52
 
foreach(@my_incl_dirs) {
53
 
  if($_ ne "") {
54
 
    run_cmnd($cmnd_base . "-I${_} -I${exec_prefix}/include ${my_abs_export_makefile} ${my_abs_export_makefile}");
55
 
  }
56
 
}
57
 
#
58
 
foreach(@my_lib_dirs) {
59
 
  if($_ ne "") {
60
 
    run_cmnd($cmnd_base . "-L${_} -L${exec_prefix}/lib ${my_abs_export_makefile} ${my_abs_export_makefile}");
61
 
  }
62
 
}
63
 
#
64
 
run_cmnd($cmnd_base . "${my_top_srcdir}/config ${exec_prefix}/include ${my_abs_export_makefile} ${my_abs_export_makefile}");
65
 
#
66
 
# Subroutines
67
 
#
68
 
sub remove_rel_paths {
69
 
        my $entry_in = shift;
70
 
        if ($entry_in=~/-L\.\./) {
71
 
                return $entry_in;
72
 
        }
73
 
        my @paths = split("/",$entry_in);
74
 
        my @new_paths;
75
 
        foreach( @paths ) {
76
 
                if( !($_=~/\.\./) ) {
77
 
                        push @new_paths, $_;
78
 
                }
79
 
                else {
80
 
                        pop @new_paths
81
 
                }
82
 
        }
83
 
        return join("/",@new_paths);
84
 
}
85
 
sub run_cmnd {
86
 
  my $cmnd = shift;
87
 
  #print "\n", $cmnd, "\n";
88
 
  system($cmnd)==0 || die;
89
 
}