aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.PL
blob: 905741118fac350ba26dbc0a2bcde225fa9e8d8a (plain)
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
#!/usr/bin/env perl
# IMPORTANT: if you delete this file your app will not work as
# expected.  You have been warned.
use inc::Module::Install;
use Module::Install::Catalyst; # Complain loudly if you don't have
                               # Catalyst::Devel installed or haven't said
                               # 'make dist' to create a standalone tarball.

name 'MGA-Mirrors';
all_from 'lib/MGA/Mirrors.pm';

requires 'Catalyst::Runtime' => '5.80000';
requires 'Catalyst::Plugin::ConfigLoader';
requires 'Catalyst::Plugin::Static::Simple';
requires 'Catalyst::Action::RenderView';
requires 'Catalyst::Plugin::Prototype';
requires 'Catalyst::Plugin::Session::State::Cookie';
requires 'Catalyst::Plugin::Session::Store::FastMmap';
requires 'Net::DNS';
requires 'Catalyst::View::GraphViz';
requires 'Moose';
requires 'namespace::autoclean';
requires 'Config::General'; # This should reflect the config file format you've chosen
                 # See Catalyst::Plugin::ConfigLoader for supported formats
test_requires 'Test::More' => '0.88';
catalyst;

install_script glob('script/*.pl');
install_script qw(bin/check_mirror);
auto_install;
WriteAll;

package MY;

sub install {
    my ($self) = @_;

    my $install = $self->SUPER::install;

    $install =~ s/^(install ::.*)/$1 cron_install/m;

    $install .= <<EOF;

cron_install ::
\t[ -d \$(DESTDIR)/etc/cron.d ] || mkdir -p \$(DESTDIR)/etc/cron.d
\tinstall -m644 etc/crontab \$(DESTDIR)/etc/cron.d/mga_mirrors
EOF

    $install
}

sub postamble {

"    
ChangeLog:
\tsvn log > ChangeLog

\$(DISTNAME).spec: \$(DISTNAME).spec.in Makefile
\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@

srpm: \$(DISTVNAME).tar.gz \$(DISTNAME).spec
\trpmbuild -bs --clean\\
\t --define \"_sourcedir `pwd`\" \\
\t --define \"_specdir `pwd`\" \\
\t --define \"_srcrpmdir `pwd`\" \\
\t --define \"_rpmdir `pwd`\" \\
\t \$(DISTNAME).spec

rpm: \$(DISTVNAME).tar.gz \$(DISTNAME).spec
\tmkdir ./noarch || :
\trpmbuild -ba --clean\\
\t --define \"_sourcedir `pwd`\" \\
\t --define \"_specdir `pwd`\" \\
\t --define \"_srcrpmdir `pwd`\" \\
\t --define \"_rpmdir `pwd`\" \\
\t \$(DISTNAME).spec
"
}