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

Last change on this file since 1303 was 1280, checked in by nanardon, 9 years ago

add log inside database tracking big objects event and some attributes

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