source: trunk/LATMOS-Accounts/Makefile.PL @ 1514

Last change on this file since 1514 was 1445, checked in by nanardon, 9 years ago

Don't show unexported stat

File size: 6.2 KB
Line 
1use 5.010000;
2use ExtUtils::MakeMaker;
3# See lib/ExtUtils/MakeMaker.pm for details of how to influence
4# the contents of the Makefile that is written.
5WriteMakefile(
6    NAME              => 'LATMOS::Accounts',
7    VERSION_FROM      => 'lib/LATMOS/Accounts.pm',
8    PREREQ_PM         => {
9        'Net::LDAP' => undef,
10        'Unicode::Map8' => undef,
11        'DBD::Pg' => undef,
12        'Crypt::RSA' => undef,
13        'MIME::Base64' => undef,
14        'Term::ReadKey' => undef,
15        'Config::IniFiles' => undef,
16        'Mail::Sendmail' => undef,
17        'Net::DNS' => undef,
18        'Template' => undef,
19        'Sys::Syslog' => undef,
20        'Pod::Usage' => undef,
21        'Unicode::String' => undef,
22        'Crypt::Cracklib' => undef,
23        'Net::IP' => undef,
24        'Net::IPv4Addr' => undef,
25        'Net::IPv6Addr' => undef,
26        'DateTime' => undef,
27        'SOAP::Lite' => undef,
28        'HTTP::Cookies' => undef,
29        'XML::XPath' => undef,
30    }, # e.g., Module::Name => 1.1
31    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
32      (ABSTRACT_FROM  => 'lib/LATMOS/Accounts.pm', # retrieve abstract from module
33       AUTHOR         => 'Thauvin Olivier <olivier.thauvin@latmos.ipsl.fr>') : ()),
34    EXE_FILES => [ qw(
35        bin/la-acls
36        bin/la-qacls
37        bin/la-attributes
38        bin/la-cli
39        bin/la-config
40        bin/la-create
41        bin/la-sql-crypt-passwd
42        bin/la-delete
43        bin/la-edit
44        bin/la-sql-find-expired
45        bin/la-group
46        bin/la-guser
47        bin/la-passwd
48        bin/la-query
49        bin/la-rename
50        bin/la-sql-rename-host
51        bin/la-sql-exchange-ip
52        bin/la-sql-exchange-hostname
53        bin/la-sql-switch-cname
54        bin/la-sql-rev
55        bin/la-search
56        bin/la-sync
57        bin/la-sync-manager
58        bin/la-sync-ctl
59        bin/la-warn-expire
60        bin/la-sql-freeip
61        bin/la-expired-reminder
62        bin/la-sql-upgrade
63        bin/la-sql-edit-form
64        bin/la-sql-updsshfp
65        bin/la-test-mail
66        bin/la-sql-log
67        bin/la-sql-runstat
68        bin/la-sql-stat2csv
69        ) ],
70        macro => {
71            INSTALLMAN5DIR      => '$(PERLPREFIX)/share/man/man5',
72            INSTALLMAN8DIR      => '$(PERLPREFIX)/share/man/man8',
73            DESTINSTALLMAN5DIR  => '$(DESTDIR)$(INSTALLMAN5DIR)',
74            DESTINSTALLMAN8DIR  => '$(DESTDIR)$(INSTALLMAN8DIR)',
75            INST_MAN5DIR        => 'blib/man5',
76            INST_MAN8DIR        => 'blib/man8',
77            DESTRPMDIR          => '$(shell pwd)',
78            DATADIR             => '/usr/share/latmos-accounts',
79            DESTDATADIR         => '$(DESTDIR)$(DATADIR)',
80        },
81        MAN1PODS        => {
82            map {
83                my $targ = $_;
84                $targ =~ s{^man/man(\d)}{};
85                my $section = $1 || 1;
86                $targ =~ s{^bin/}{};
87                $targ =~ s/.pod$//;
88                ( $_ =>
89                    "\$(INST_MAN${section}DIR)/$targ.$section" );
90            } <man/man?/*.pod>, (grep { ! /~$/ } <bin/*>)
91        },
92
93);
94
95package MY;
96
97sub postamble {
98    <<EOF;
99#.PHONY .= svnmanifest
100
101bin/la-sql-upgrade: bin/la-sql-upgrade.in
102\tcat \$< \| sed 's:\@DATADIR\@:\$(DATADIR):' > \$@
103\tchmod +x \$@
104
105svnmanifest:
106\tsvn ls -R| grep -v "/\$\$"  > MANIFEST
107
108ChangeLog:
109\tsvn log > ChangeLog
110
111latmos-accounts.spec: latmos-accounts.spec.in Makefile
112\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@
113
114rpm: \$(DISTVNAME).tar.gz latmos-accounts.spec
115\tmkdir ./noarch || :
116\trpmbuild -ba --clean\\
117\t --define "_sourcedir `pwd`" \\
118\t --define "_specdir `pwd`" \\
119\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
120\t --define "_rpmdir \$(DESTRPMDIR)" \\
121\t latmos-accounts.spec
122
123svnrpm: \$(DISTVNAME).tar.gz latmos-accounts.spec
124\tmkdir \$(DESTRPMDIR)/noarch || :
125\trpmbuild -ba --clean\\
126\t --define "_sourcedir `pwd`" \\
127\t --define "_specdir `pwd`" \\
128\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
129\t --define "_rpmdir \$(DESTRPMDIR)" \\
130\t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\
131\t latmos-accounts.spec
132
133podhtml: \$(MAN1PODS) \$(MAN3PODS)
134\tmkdir html || :
135\trm -f html/*
136\tperl scripts/pod2xhtml.pl \$(MAN1PODS) \$(MAN3PODS)
137
138EOF
139}
140
141sub installbin {
142    my $self = shift;
143    my $inherited = $self->SUPER::installbin(@_);
144    my $s = join '|', map quotemeta, @sbin_scripts;
145    # how to create needed directories under blib
146    $inherited .= $self->dir_target("\$(INST_$_)") for qw(MAN5DIR MAN8DIR);
147    $inherited;
148}
149
150sub top_targets {
151    my $inherited = shift->SUPER::top_targets(@_);
152    $inherited =~ s/^config ::/$& \$(INST_MAN5DIR)\$(DIRFILESEP).exists \$(INST_MAN8DIR)\$(DIRFILESEP).exists/m;
153    $inherited;
154}
155
156sub install {
157    my ($self) = @_;
158    my $section = $self->SUPER::install();
159
160    $section =~ s/(^install ::.*)/$1 install_config install_templates install_data/m;
161    $section =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR) \$(INST_MAN8DIR) \$(DESTINSTALLMAN8DIR)/g;
162
163    $section .= q[
164install_config ::
165        install -d $(DESTDIR)/etc
166        install -d $(DESTDIR)/etc/latmos-accounts
167        install sample/latmos-accounts.ini $(DESTDIR)/etc/latmos-accounts/latmos-accounts.ini
168        install sample/la-sync-list.ini $(DESTDIR)/etc/latmos-accounts/la-sync-list.ini
169        install sample/la-allowed-values.ini $(DESTDIR)/etc/latmos-accounts/la-allowed-values.ini
170        install sample/la-sync-manager.ini $(DESTDIR)/etc/latmos-accounts/la-sync-manager.ini
171
172install_templates ::
173        install -d $(DESTDIR)$(DATADIR)/templates
174        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ templates => @ARGV })' \\
175                $(DESTDIR)$(DATADIR)/templates
176
177install_data ::
178        install -d $(DESTDIR)$(DATADIR)
179        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ sqldata => @ARGV })' \\
180            $(DESTDIR)$(DATADIR)
181];
182 
183    return $section;
184}
185
186sub test {
187    my $inherited = shift->SUPER::test(@_);
188
189    $inherited =~ s:^(test_dynamic .*):$1 test_scripts:m;
190
191    $inherited .= <<EOF;
192
193TESTLIVE_FILES = live-test/*.t
194TESTSCRIPTS_FILE = t/scripts.pl
195
196test_live :: pure_all
197\tPERL_DL_NONLAZY=1 \$(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness(\$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" \$(TESTLIVE_FILES)
198
199test_scripts :: pure_all
200\tPERL_DL_NONLAZY=1 \$(FULLPERLRUN) "-I\$(INST_LIB)" "-I\$(INST_ARCHLIB)" \$(TESTSCRIPTS_FILE) \$(EXE_FILES)
201EOF
202    return $inherited;
203}
Note: See TracBrowser for help on using the repository browser.