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
RevLine 
[1]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',
[989]7    VERSION_FROM      => 'lib/LATMOS/Accounts.pm',
[258]8    PREREQ_PM         => {
9        'Net::LDAP' => undef,
10        'Unicode::Map8' => undef,
11        'DBD::Pg' => undef,
[413]12        'Crypt::RSA' => undef,
13        'MIME::Base64' => undef,
14        'Term::ReadKey' => undef,
[432]15        'Config::IniFiles' => undef,
16        'Mail::Sendmail' => undef,
17        'Net::DNS' => undef,
18        'Template' => undef,
19        'Sys::Syslog' => undef,
[627]20        'Pod::Usage' => undef,
[432]21        'Unicode::String' => undef,
[584]22        'Crypt::Cracklib' => undef,
[861]23        'Net::IP' => undef,
[867]24        'Net::IPv4Addr' => undef,
25        'Net::IPv6Addr' => undef,
[1368]26        'DateTime' => undef,
[1376]27        'SOAP::Lite' => undef,
28        'HTTP::Cookies' => undef,
29        'XML::XPath' => undef,
[258]30    }, # e.g., Module::Name => 1.1
[1]31    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
32      (ABSTRACT_FROM  => 'lib/LATMOS/Accounts.pm', # retrieve abstract from module
[254]33       AUTHOR         => 'Thauvin Olivier <olivier.thauvin@latmos.ipsl.fr>') : ()),
[416]34    EXE_FILES => [ qw(
35        bin/la-acls
[640]36        bin/la-qacls
[617]37        bin/la-attributes
[845]38        bin/la-cli
[416]39        bin/la-config
40        bin/la-create
[1005]41        bin/la-sql-crypt-passwd
[531]42        bin/la-delete
[416]43        bin/la-edit
[1323]44        bin/la-sql-find-expired
[416]45        bin/la-group
46        bin/la-guser
47        bin/la-passwd
48        bin/la-query
[715]49        bin/la-rename
[1322]50        bin/la-sql-rename-host
[1006]51        bin/la-sql-exchange-ip
[1322]52        bin/la-sql-exchange-hostname
[1277]53        bin/la-sql-switch-cname
[1007]54        bin/la-sql-rev
[613]55        bin/la-search
[416]56        bin/la-sync
[578]57        bin/la-sync-manager
[1201]58        bin/la-sync-ctl
[416]59        bin/la-warn-expire
[1197]60        bin/la-sql-freeip
[861]61        bin/la-expired-reminder
[881]62        bin/la-sql-upgrade
[959]63        bin/la-sql-edit-form
[1225]64        bin/la-sql-updsshfp
[990]65        bin/la-test-mail
[1280]66        bin/la-sql-log
[1445]67        bin/la-sql-runstat
[1429]68        bin/la-sql-stat2csv
[416]69        ) ],
[861]70        macro => {
71            INSTALLMAN5DIR      => '$(PERLPREFIX)/share/man/man5',
[991]72            INSTALLMAN8DIR      => '$(PERLPREFIX)/share/man/man8',
[861]73            DESTINSTALLMAN5DIR  => '$(DESTDIR)$(INSTALLMAN5DIR)',
[991]74            DESTINSTALLMAN8DIR  => '$(DESTDIR)$(INSTALLMAN8DIR)',
[861]75            INST_MAN5DIR        => 'blib/man5',
[991]76            INST_MAN8DIR        => 'blib/man8',
[881]77            DESTRPMDIR          => '$(shell pwd)',
78            DATADIR             => '/usr/share/latmos-accounts',
79            DESTDATADIR         => '$(DESTDIR)$(DATADIR)',
[861]80        },
81        MAN1PODS        => {
82            map {
83                my $targ = $_;
[1013]84                $targ =~ s{^man/man(\d)}{};
85                my $section = $1 || 1;
[861]86                $targ =~ s{^bin/}{};
[1013]87                $targ =~ s/.pod$//;
[861]88                ( $_ =>
89                    "\$(INST_MAN${section}DIR)/$targ.$section" );
[1013]90            } <man/man?/*.pod>, (grep { ! /~$/ } <bin/*>)
[861]91        },
92
[1]93);
[416]94
95package MY;
96
97sub postamble {
98    <<EOF;
[861]99#.PHONY .= svnmanifest
[416]100
[881]101bin/la-sql-upgrade: bin/la-sql-upgrade.in
102\tcat \$< \| sed 's:\@DATADIR\@:\$(DATADIR):' > \$@
103\tchmod +x \$@
104
[416]105svnmanifest:
106\tsvn ls -R| grep -v "/\$\$"  > MANIFEST
107
[432]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`" \\
[861]119\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
120\t --define "_rpmdir \$(DESTRPMDIR)" \\
[432]121\t latmos-accounts.spec
122
[861]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
[1009]133podhtml: \$(MAN1PODS) \$(MAN3PODS)
134\tmkdir html || :
135\trm -f html/*
136\tperl scripts/pod2xhtml.pl \$(MAN1PODS) \$(MAN3PODS)
137
[416]138EOF
139}
[548]140
[861]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
[991]146    $inherited .= $self->dir_target("\$(INST_$_)") for qw(MAN5DIR MAN8DIR);
[861]147    $inherited;
148}
149
150sub top_targets {
151    my $inherited = shift->SUPER::top_targets(@_);
[991]152    $inherited =~ s/^config ::/$& \$(INST_MAN5DIR)\$(DIRFILESEP).exists \$(INST_MAN8DIR)\$(DIRFILESEP).exists/m;
[861]153    $inherited;
154}
155
[548]156sub install {
157    my ($self) = @_;
158    my $section = $self->SUPER::install();
159
[881]160    $section =~ s/(^install ::.*)/$1 install_config install_templates install_data/m;
[991]161    $section =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR) \$(INST_MAN8DIR) \$(DESTINSTALLMAN8DIR)/g;
[548]162
[705]163    $section .= q[
[548]164install_config ::
165        install -d $(DESTDIR)/etc
[861]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
[705]171
172install_templates ::
[881]173        install -d $(DESTDIR)$(DATADIR)/templates
[705]174        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ templates => @ARGV })' \\
[881]175                $(DESTDIR)$(DATADIR)/templates
176
177install_data ::
178        install -d $(DESTDIR)$(DATADIR)
179        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ sqldata => @ARGV })' \\
180            $(DESTDIR)$(DATADIR)
[705]181];
[548]182 
183    return $section;
184}
[1027]185
186sub test {
187    my $inherited = shift->SUPER::test(@_);
188
[1030]189    $inherited =~ s:^(test_dynamic .*):$1 test_scripts:m;
190
[1027]191    $inherited .= <<EOF;
192
193TESTLIVE_FILES = live-test/*.t
[1030]194TESTSCRIPTS_FILE = t/scripts.pl
[1027]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
[1030]199test_scripts :: pure_all
200\tPERL_DL_NONLAZY=1 \$(FULLPERLRUN) "-I\$(INST_LIB)" "-I\$(INST_ARCHLIB)" \$(TESTSCRIPTS_FILE) \$(EXE_FILES)
[1027]201EOF
202    return $inherited;
203}
Note: See TracBrowser for help on using the repository browser.