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

Last change on this file since 1197 was 1197, checked in by nanardon, 12 years ago

rename la-free-ip to la-sql-freeip since it's a pure sql base command

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