-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.PL
80 lines (61 loc) · 1.77 KB
/
Makefile.PL
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
use 5.010;
use strict;
use warnings;
use ExtUtils::MakeMaker;
use lib qw(/usr/share/slackman/lib/perl5);
WriteMakefile(
NAME => 'Slackware::SlackMan',
AUTHOR => q{Giuseppe Di Terlizzi <[email protected]>},
VERSION_FROM => 'lib/Slackware/SlackMan.pm',
ABSTRACT_FROM => 'lib/Slackware/SlackMan.pm',
LICENSE => 'artistic_2',
EXE_FILES => [ 'bin/slackman' ],
PL_FILES => {},
MIN_PERL_VERSION => '5.010',
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => '0',
},
BUILD_REQUIRES => {
'Test::More' => '0',
},
PREREQ_PM => {
'DBD::SQLite' => '0',
'Net::DBus' => '0',
'HTTP::Tiny' => '0',
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Slackware-Slackman-*' },
);
sub add_dep {
my ($string, $targ, $add) = @_;
$$string =~ s/($targ\s+::)/$1 $add/;
}
sub MY::top_targets {
my $self = shift;
my $string = $self->MM::top_targets;
$string .= <<"EOF";
dbus_install:
cd dbus && \$(MAKE) DESTDIR=\$(DESTDIR) install
man_install:
cd pod && \$(MAKE) DESTDIR=\$(DESTDIR) install
etc_install:
cd etc && \$(MAKE) DESTDIR=\$(DESTDIR) install
EOF
$string;
}
sub MY::install {
my $self = shift;
my $string = $self->MM::install(@_);
add_dep(\$string, pure_install => 'dbus_install');
add_dep(\$string, pure_install => 'man_install');
add_dep(\$string, pure_install => 'etc_install');
$string;
}
sub MY::postamble {
return <<'MAKE_FRAG';
SLACKBUILD_VERSION = $(shell echo $(VERSION) | tr -d "v" )
slackbuild: dist
$(CP) $(DISTVNAME).tar.gz slackbuilds/slackman
( cd slackbuilds/slackman && VERSION=$(SLACKBUILD_VERSION) $(SHELL) -x slackman.SlackBuild )
MAKE_FRAG
}