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

Last change on this file since 2626 was 2602, checked in by nanardon, 3 months ago

Return something when object got deleted

File size: 8.3 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.
[1553]5
6my @po;
[2240]7foreach (glob('po/*.po')) {
[1553]8    my ($po) = $_ =~  m:([^/\.]+)\.po$:;
9    push (@po, $po);
10}
11
[1]12WriteMakefile(
13    NAME              => 'LATMOS::Accounts',
[989]14    VERSION_FROM      => 'lib/LATMOS/Accounts.pm',
[258]15    PREREQ_PM         => {
16        'Net::LDAP' => undef,
17        'Unicode::Map8' => undef,
18        'DBD::Pg' => undef,
[413]19        'Crypt::RSA' => undef,
20        'MIME::Base64' => undef,
21        'Term::ReadKey' => undef,
[432]22        'Config::IniFiles' => undef,
23        'Mail::Sendmail' => undef,
24        'Net::DNS' => undef,
25        'Template' => undef,
26        'Sys::Syslog' => undef,
[627]27        'Pod::Usage' => undef,
[432]28        'Unicode::String' => undef,
[584]29        'Crypt::Cracklib' => undef,
[2035]30        'Crypt::Blowfish' => undef,
[861]31        'Net::IP' => undef,
[867]32        'Net::IPv6Addr' => undef,
[1368]33        'DateTime' => undef,
[1376]34        'SOAP::Lite' => undef,
35        'HTTP::Cookies' => undef,
36        'XML::XPath' => undef,
[1604]37        'Crypt::SmbHash' => undef,
[1623]38        'Date::Calc' => undef,
[1653]39        'Spreadsheet::WriteExcel' => undef,
[1989]40        'Text::CSV' => undef,
[2289]41        'DateTime::Format::Pg' => undef,
[2388]42        'Net::IDN::Encode' => undef,
[2506]43        'Digest::HMAC_SHA1' => undef,
[2602]44        'List::AllUtils' => undef,
[258]45    }, # e.g., Module::Name => 1.1
[1]46    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
47      (ABSTRACT_FROM  => 'lib/LATMOS/Accounts.pm', # retrieve abstract from module
[254]48       AUTHOR         => 'Thauvin Olivier <olivier.thauvin@latmos.ipsl.fr>') : ()),
[416]49    EXE_FILES => [ qw(
50        bin/la-acls
[640]51        bin/la-qacls
[617]52        bin/la-attributes
[845]53        bin/la-cli
[416]54        bin/la-config
55        bin/la-create
[1005]56        bin/la-sql-crypt-passwd
[531]57        bin/la-delete
[416]58        bin/la-edit
[1323]59        bin/la-sql-find-expired
[416]60        bin/la-group
61        bin/la-guser
62        bin/la-passwd
[1999]63        bin/la-gen-passwd
[416]64        bin/la-query
[715]65        bin/la-rename
[1322]66        bin/la-sql-rename-host
[1006]67        bin/la-sql-exchange-ip
[1322]68        bin/la-sql-exchange-hostname
[1277]69        bin/la-sql-switch-cname
[1007]70        bin/la-sql-rev
[613]71        bin/la-search
[416]72        bin/la-sync
[578]73        bin/la-sync-manager
[1201]74        bin/la-sync-ctl
[416]75        bin/la-warn-expire
[1197]76        bin/la-sql-freeip
[861]77        bin/la-expired-reminder
[881]78        bin/la-sql-upgrade
[1855]79        bin/la-sql-recompute
[959]80        bin/la-sql-edit-form
[1225]81        bin/la-sql-updsshfp
[990]82        bin/la-test-mail
[1280]83        bin/la-sql-log
[1445]84        bin/la-sql-runstat
[1865]85        bin/la-sql-properties
86        bin/la-sql-alias
[1429]87        bin/la-sql-stat2csv
[1653]88        bin/la2xls
[1753]89        bin/la-ban-passwd
[1773]90        bin/la-renewEmp
[1985]91        bin/la-load-csv
[2278]92        bin/la-dump
[2094]93        bin/la-sql-attrvalues
[416]94        ) ],
[861]95        macro => {
96            INSTALLMAN5DIR      => '$(PERLPREFIX)/share/man/man5',
[991]97            INSTALLMAN8DIR      => '$(PERLPREFIX)/share/man/man8',
[861]98            DESTINSTALLMAN5DIR  => '$(DESTDIR)$(INSTALLMAN5DIR)',
[991]99            DESTINSTALLMAN8DIR  => '$(DESTDIR)$(INSTALLMAN8DIR)',
[1546]100            LOCALEDIR           => '/usr/share/locale',
[861]101            INST_MAN5DIR        => 'blib/man5',
[991]102            INST_MAN8DIR        => 'blib/man8',
[881]103            DESTRPMDIR          => '$(shell pwd)',
104            DATADIR             => '/usr/share/latmos-accounts',
105            DESTDATADIR         => '$(DESTDIR)$(DATADIR)',
[1963]106            MAN1PODSBIN         => join(' ', <bin/*>),
[1961]107            MAN5PODS            => join(' ', <man/man5/*.pod>),
108            MAN8PODS            => join(' ', <man/man8/*.pod>),
[861]109        },
110        MAN1PODS        => {
111            map {
112                my $targ = $_;
[1013]113                $targ =~ s{^man/man(\d)}{};
114                my $section = $1 || 1;
[861]115                $targ =~ s{^bin/}{};
[1013]116                $targ =~ s/.pod$//;
[861]117                ( $_ =>
118                    "\$(INST_MAN${section}DIR)/$targ.$section" );
[1013]119            } <man/man?/*.pod>, (grep { ! /~$/ } <bin/*>)
[861]120        },
[1]121);
[416]122
123package MY;
124
125sub postamble {
[1546]126
[1549]127    my $makepo = '';
[1546]128
[1553]129    foreach my $po (@po) {
[1549]130        $makepo .=
131"
[2240]132po/$po.po: po/messages.pot
133\t[ -f po/$po.po ] || msginit --no-translator --input=po/messages.pot --output= --locale=$_
134\tmsgmerge -U po/$po.po po/messages.pot
[1546]135
[2240]136po/$po/LC_MESSAGES/linkaccounts.mo: po/$po.po
137\tinstall -d po/$po/LC_MESSAGES
[1549]138\tmsgfmt -o \$@ \$<
139\n"
140    }
141
[2240]142    $makepo .= "\n\npo: " . join(' ', map { "po/$_.po" } @po) . "\n";
143    $makepo .= "\n\nmo: " . join(' ', map { "po/$_/LC_MESSAGES/linkaccounts.mo" } @po) . "\n";
[1549]144
[416]145    <<EOF;
[2240]146.PHONY: po/messages.pot
[416]147
[2240]148pot: po/messages.pot
[1546]149
[2240]150po/messages.pot:
151\tcat MANIFEST | egrep '^(lib|bin)' | xargs xgettext.pl -o po/messages.pot
[1546]152
153$makepo
154
[416]155svnmanifest:
156\tsvn ls -R| grep -v "/\$\$"  > MANIFEST
157
[432]158ChangeLog:
159\tsvn log > ChangeLog
160
161latmos-accounts.spec: latmos-accounts.spec.in Makefile
162\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@
163
164rpm: \$(DISTVNAME).tar.gz latmos-accounts.spec
165\tmkdir ./noarch || :
166\trpmbuild -ba --clean\\
167\t --define "_sourcedir `pwd`" \\
168\t --define "_specdir `pwd`" \\
[861]169\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
170\t --define "_rpmdir \$(DESTRPMDIR)" \\
[432]171\t latmos-accounts.spec
172
[861]173svnrpm: \$(DISTVNAME).tar.gz latmos-accounts.spec
174\tmkdir \$(DESTRPMDIR)/noarch || :
175\trpmbuild -ba --clean\\
176\t --define "_sourcedir `pwd`" \\
177\t --define "_specdir `pwd`" \\
178\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
179\t --define "_rpmdir \$(DESTRPMDIR)" \\
180\t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\
181\t latmos-accounts.spec
182
[1963]183podhtml: \$(MAN5PODS) \$(MAN8PODS) \$(MAN3PODS) \$(MAN1PODSBIN)
[1009]184\tmkdir html || :
[1961]185\trm -fr html/*
[1963]186\tperl scripts/pod2xhtml.pl man1 \$(MAN1PODSBIN)
[1961]187\tperl scripts/pod2xhtml.pl man3 \$(MAN3PODS)
188\tperl scripts/pod2xhtml.pl man5 \$(MAN5PODS)
189\tperl scripts/pod2xhtml.pl man8 \$(MAN8PODS)
[1009]190
[416]191EOF
192}
[548]193
[861]194sub installbin {
195    my $self = shift;
196    my $inherited = $self->SUPER::installbin(@_);
197    my $s = join '|', map quotemeta, @sbin_scripts;
198    # how to create needed directories under blib
[991]199    $inherited .= $self->dir_target("\$(INST_$_)") for qw(MAN5DIR MAN8DIR);
[861]200    $inherited;
201}
202
203sub top_targets {
204    my $inherited = shift->SUPER::top_targets(@_);
[991]205    $inherited =~ s/^config ::/$& \$(INST_MAN5DIR)\$(DIRFILESEP).exists \$(INST_MAN8DIR)\$(DIRFILESEP).exists/m;
[861]206    $inherited;
207}
208
[548]209sub install {
210    my ($self) = @_;
211    my $section = $self->SUPER::install();
212
[2472]213    $section =~ s/(^install ::.*)/$1 install_config install_templates install_data install_mo pure_man_install/m;
[991]214    $section =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR) \$(INST_MAN8DIR) \$(DESTINSTALLMAN8DIR)/g;
[548]215
[705]216    $section .= q[
[2472]217pure_man_install :: all
218        $(NOECHO) $(MOD_INSTALL) \
219                "$(INST_MAN5DIR)" "$(DESTINSTALLMAN5DIR)" \
220                "$(INST_MAN8DIR)" "$(DESTINSTALLMAN8DIR)" \
221
[548]222install_config ::
223        install -d $(DESTDIR)/etc
[861]224        install -d $(DESTDIR)/etc/latmos-accounts
225        install sample/latmos-accounts.ini $(DESTDIR)/etc/latmos-accounts/latmos-accounts.ini
226        install sample/la-sync-list.ini $(DESTDIR)/etc/latmos-accounts/la-sync-list.ini
227        install sample/la-allowed-values.ini $(DESTDIR)/etc/latmos-accounts/la-allowed-values.ini
228        install sample/la-sync-manager.ini $(DESTDIR)/etc/latmos-accounts/la-sync-manager.ini
[2437]229        install sample/la-acls.ini $(DESTDIR)/etc/latmos-accounts/la-acls.ini
[705]230
231install_templates ::
[881]232        install -d $(DESTDIR)$(DATADIR)/templates
[705]233        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ templates => @ARGV })' \\
[881]234                $(DESTDIR)$(DATADIR)/templates
235
236install_data ::
237        install -d $(DESTDIR)$(DATADIR)
238        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ sqldata => @ARGV })' \\
239            $(DESTDIR)$(DATADIR)
[1546]240
[1549]241install_mo: mo
242        install -d $(DESTDIR)$(LOCALEDIR)
[705]243];
[1553]244
245    foreach (@po) {
[1554]246        $section .= "\tinstall -d \$(DESTDIR)\$(LOCALEDIR)/$_/LC_MESSAGES\n";
[2240]247        $section .= "\tinstall po/$_/LC_MESSAGES/linkaccounts.mo \$(DESTDIR)\$(LOCALEDIR)/$_/LC_MESSAGES/linkaccounts.mo\n";
[1553]248    }
249    $section .= "\n";
[548]250 
251    return $section;
252}
[1027]253
254sub test {
255    my $inherited = shift->SUPER::test(@_);
256
[1030]257    $inherited =~ s:^(test_dynamic .*):$1 test_scripts:m;
258
[1027]259    $inherited .= <<EOF;
260
261TESTLIVE_FILES = live-test/*.t
[1030]262TESTSCRIPTS_FILE = t/scripts.pl
[1027]263
264test_live :: pure_all
265\tPERL_DL_NONLAZY=1 \$(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness(\$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" \$(TESTLIVE_FILES)
266
[1030]267test_scripts :: pure_all
268\tPERL_DL_NONLAZY=1 \$(FULLPERLRUN) "-I\$(INST_LIB)" "-I\$(INST_ARCHLIB)" \$(TESTSCRIPTS_FILE) \$(EXE_FILES)
[1027]269EOF
270    return $inherited;
271}
Note: See TracBrowser for help on using the repository browser.