File: Makefile.PL.in

package info (click to toggle)
libprelude 1.0.0-11.9
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 24,456 kB
  • ctags: 17,851
  • sloc: ansic: 190,841; cpp: 38,769; xml: 30,141; sh: 11,668; makefile: 692; python: 481; awk: 341; yacc: 238; lex: 186; perl: 5
file content (45 lines) | stat: -rw-r--r-- 1,709 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
use Config;
use ExtUtils::MakeMaker;
use ExtUtils::MM_Unix;
use File::Copy;
use Cwd "abs_path";

my %attributs = (NAME => 'PreludeEasy',
		 INC => '-I@top_srcdir@ -I@top_builddir@/src/include -I@top_srcdir@/src/include -I@top_builddir@/src/libprelude-error -I@top_srcdir@/bindings/c++/include -I@top_srcdir@/libmissing -I@top_builddir@/libmissing',
		 LIBS => ["-L@top_builddir@/src/.libs -lprelude -L@top_builddir@/bindings/c++/.libs -lpreludecpp", "-L$ENV{LIBDIR} -lprelude @LIBPRELUDE_LIBS@ @LIBADD_DL@ @LTLIBTHREAD@" ],
		 LDDLFLAGS => "-L@top_builddir@/src/.libs $Config{lddlflags}");

if ( abs_path("@top_srcdir@") ne abs_path("@top_builddir@") ) {
    foreach my $filename ( qw/easy-idmef_wrap_perl.cxx PreludeEasy.pm/ ) {
	my $src = "@top_srcdir@/bindings/perl/$filename";
	my $dst = "@top_builddir@/bindings/perl/$filename";
	copy($src, $dst) if ( ! -e $dst );
    }
    $attributs{"clean"} = {FILES => join(" ", map { "@top_builddir@/bindings/perl/$_" } qw/easy-idmef_wrap_perl.cxx PreludeEasy.pm Makefile/)};
}

if ( -w $Config{"sitelib"} ) {
    $attributs{"INSTALLDIRS"} = "site";
} else {
    $attributs{"PREFIX"} = "@prefix@";
}

WriteMakefile(%attributs);

my($atime, $mtime) = (stat "Makefile.PL")[8,9];
utime($atime + 1, $mtime + 1, "Makefile");


package MY;

sub install
{
    my $str = shift->SUPER::install(@_);
    my @files = ((map { "\$(INSTALLSITEARCH)/$_" } qw/perllocal.pod PreludeEasy.pm/),
                 (map { "\$(INSTALLSITEARCH)/auto/PreludeEasy/$_" } qw/PreludeEasy.bs PreludeEasy.so .packlist/),
                 '$(INSTALLMAN3DIR)/Prelude.$(MAN3EXT)');

    $str =~ s/(uninstall_from_sitedirs.+)\n.+\n/"$1\n\t\$(RM_F) " . join(" ", @files) . "\n"/e;

    return $str;
}