[1] | 1 | use 5.010000; |
---|
| 2 | use 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 | |
---|
| 6 | my @po; |
---|
| 7 | foreach (glob('po/*.po')) { |
---|
| 8 | my ($po) = $_ =~ m:([^/\.]+)\.po$:; |
---|
| 9 | push (@po, $po); |
---|
| 10 | } |
---|
| 11 | |
---|
[1] | 12 | WriteMakefile( |
---|
| 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, |
---|
[861] | 30 | 'Net::IP' => undef, |
---|
[867] | 31 | 'Net::IPv4Addr' => undef, |
---|
| 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, |
---|
[258] | 38 | }, # e.g., Module::Name => 1.1 |
---|
[1] | 39 | ($] >= 5.005 ? ## Add these new keywords supported since 5.005 |
---|
| 40 | (ABSTRACT_FROM => 'lib/LATMOS/Accounts.pm', # retrieve abstract from module |
---|
[254] | 41 | AUTHOR => 'Thauvin Olivier <olivier.thauvin@latmos.ipsl.fr>') : ()), |
---|
[416] | 42 | EXE_FILES => [ qw( |
---|
| 43 | bin/la-acls |
---|
[640] | 44 | bin/la-qacls |
---|
[617] | 45 | bin/la-attributes |
---|
[845] | 46 | bin/la-cli |
---|
[416] | 47 | bin/la-config |
---|
| 48 | bin/la-create |
---|
[1005] | 49 | bin/la-sql-crypt-passwd |
---|
[531] | 50 | bin/la-delete |
---|
[416] | 51 | bin/la-edit |
---|
[1323] | 52 | bin/la-sql-find-expired |
---|
[416] | 53 | bin/la-group |
---|
| 54 | bin/la-guser |
---|
| 55 | bin/la-passwd |
---|
| 56 | bin/la-query |
---|
[715] | 57 | bin/la-rename |
---|
[1322] | 58 | bin/la-sql-rename-host |
---|
[1006] | 59 | bin/la-sql-exchange-ip |
---|
[1322] | 60 | bin/la-sql-exchange-hostname |
---|
[1277] | 61 | bin/la-sql-switch-cname |
---|
[1007] | 62 | bin/la-sql-rev |
---|
[613] | 63 | bin/la-search |
---|
[416] | 64 | bin/la-sync |
---|
[578] | 65 | bin/la-sync-manager |
---|
[1201] | 66 | bin/la-sync-ctl |
---|
[416] | 67 | bin/la-warn-expire |
---|
[1197] | 68 | bin/la-sql-freeip |
---|
[861] | 69 | bin/la-expired-reminder |
---|
[881] | 70 | bin/la-sql-upgrade |
---|
[959] | 71 | bin/la-sql-edit-form |
---|
[1225] | 72 | bin/la-sql-updsshfp |
---|
[990] | 73 | bin/la-test-mail |
---|
[1280] | 74 | bin/la-sql-log |
---|
[1445] | 75 | bin/la-sql-runstat |
---|
[1429] | 76 | bin/la-sql-stat2csv |
---|
[416] | 77 | ) ], |
---|
[861] | 78 | macro => { |
---|
| 79 | INSTALLMAN5DIR => '$(PERLPREFIX)/share/man/man5', |
---|
[991] | 80 | INSTALLMAN8DIR => '$(PERLPREFIX)/share/man/man8', |
---|
[861] | 81 | DESTINSTALLMAN5DIR => '$(DESTDIR)$(INSTALLMAN5DIR)', |
---|
[991] | 82 | DESTINSTALLMAN8DIR => '$(DESTDIR)$(INSTALLMAN8DIR)', |
---|
[1546] | 83 | LOCALEDIR => '/usr/share/locale', |
---|
[861] | 84 | INST_MAN5DIR => 'blib/man5', |
---|
[991] | 85 | INST_MAN8DIR => 'blib/man8', |
---|
[881] | 86 | DESTRPMDIR => '$(shell pwd)', |
---|
| 87 | DATADIR => '/usr/share/latmos-accounts', |
---|
| 88 | DESTDATADIR => '$(DESTDIR)$(DATADIR)', |
---|
[861] | 89 | }, |
---|
| 90 | MAN1PODS => { |
---|
| 91 | map { |
---|
| 92 | my $targ = $_; |
---|
[1013] | 93 | $targ =~ s{^man/man(\d)}{}; |
---|
| 94 | my $section = $1 || 1; |
---|
[861] | 95 | $targ =~ s{^bin/}{}; |
---|
[1013] | 96 | $targ =~ s/.pod$//; |
---|
[861] | 97 | ( $_ => |
---|
| 98 | "\$(INST_MAN${section}DIR)/$targ.$section" ); |
---|
[1013] | 99 | } <man/man?/*.pod>, (grep { ! /~$/ } <bin/*>) |
---|
[861] | 100 | }, |
---|
| 101 | |
---|
[1] | 102 | ); |
---|
[416] | 103 | |
---|
| 104 | package MY; |
---|
| 105 | |
---|
| 106 | sub postamble { |
---|
[1546] | 107 | |
---|
[1549] | 108 | my $makepo = ''; |
---|
[1546] | 109 | |
---|
[1553] | 110 | foreach my $po (@po) { |
---|
[1549] | 111 | $makepo .= |
---|
| 112 | " |
---|
| 113 | po/$po.po: po/messages.pot |
---|
| 114 | \t[ -f po/$po.po ] || msginit --no-translator --input=po/messages.pot --output= --locale=$_ |
---|
| 115 | \tmsgmerge -U po/$po.po po/messages.pot |
---|
[1546] | 116 | |
---|
[1549] | 117 | po/$po/LC_MESSAGES/linkaccounts.mo: po/$po.po |
---|
| 118 | \tinstall -d po/$po/LC_MESSAGES |
---|
| 119 | \tmsgfmt -o \$@ \$< |
---|
| 120 | \n" |
---|
| 121 | } |
---|
| 122 | |
---|
| 123 | $makepo .= "\n\npo: " . join(' ', map { "po/$_.po" } @po) . "\n"; |
---|
| 124 | $makepo .= "\n\nmo: " . join(' ', map { "po/$_/LC_MESSAGES/linkaccounts.mo" } @po) . "\n"; |
---|
| 125 | |
---|
[416] | 126 | <<EOF; |
---|
[1549] | 127 | .PHONY: po/messages.pot |
---|
[416] | 128 | |
---|
[1549] | 129 | pot: po/messages.pot |
---|
[1546] | 130 | |
---|
[1549] | 131 | po/messages.pot: |
---|
| 132 | \tcat MANIFEST | egrep '^(lib|bin)' | xargs xgettext.pl -o po/messages.pot |
---|
[1546] | 133 | |
---|
| 134 | $makepo |
---|
| 135 | |
---|
[881] | 136 | bin/la-sql-upgrade: bin/la-sql-upgrade.in |
---|
| 137 | \tcat \$< \| sed 's:\@DATADIR\@:\$(DATADIR):' > \$@ |
---|
| 138 | \tchmod +x \$@ |
---|
| 139 | |
---|
[416] | 140 | svnmanifest: |
---|
| 141 | \tsvn ls -R| grep -v "/\$\$" > MANIFEST |
---|
| 142 | |
---|
[432] | 143 | ChangeLog: |
---|
| 144 | \tsvn log > ChangeLog |
---|
| 145 | |
---|
| 146 | latmos-accounts.spec: latmos-accounts.spec.in Makefile |
---|
| 147 | \tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@ |
---|
| 148 | |
---|
| 149 | rpm: \$(DISTVNAME).tar.gz latmos-accounts.spec |
---|
| 150 | \tmkdir ./noarch || : |
---|
| 151 | \trpmbuild -ba --clean\\ |
---|
| 152 | \t --define "_sourcedir `pwd`" \\ |
---|
| 153 | \t --define "_specdir `pwd`" \\ |
---|
[861] | 154 | \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ |
---|
| 155 | \t --define "_rpmdir \$(DESTRPMDIR)" \\ |
---|
[432] | 156 | \t latmos-accounts.spec |
---|
| 157 | |
---|
[861] | 158 | svnrpm: \$(DISTVNAME).tar.gz latmos-accounts.spec |
---|
| 159 | \tmkdir \$(DESTRPMDIR)/noarch || : |
---|
| 160 | \trpmbuild -ba --clean\\ |
---|
| 161 | \t --define "_sourcedir `pwd`" \\ |
---|
| 162 | \t --define "_specdir `pwd`" \\ |
---|
| 163 | \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ |
---|
| 164 | \t --define "_rpmdir \$(DESTRPMDIR)" \\ |
---|
| 165 | \t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\ |
---|
| 166 | \t latmos-accounts.spec |
---|
| 167 | |
---|
[1009] | 168 | podhtml: \$(MAN1PODS) \$(MAN3PODS) |
---|
| 169 | \tmkdir html || : |
---|
| 170 | \trm -f html/* |
---|
| 171 | \tperl scripts/pod2xhtml.pl \$(MAN1PODS) \$(MAN3PODS) |
---|
| 172 | |
---|
[416] | 173 | EOF |
---|
| 174 | } |
---|
[548] | 175 | |
---|
[861] | 176 | sub installbin { |
---|
| 177 | my $self = shift; |
---|
| 178 | my $inherited = $self->SUPER::installbin(@_); |
---|
| 179 | my $s = join '|', map quotemeta, @sbin_scripts; |
---|
| 180 | # how to create needed directories under blib |
---|
[991] | 181 | $inherited .= $self->dir_target("\$(INST_$_)") for qw(MAN5DIR MAN8DIR); |
---|
[861] | 182 | $inherited; |
---|
| 183 | } |
---|
| 184 | |
---|
| 185 | sub top_targets { |
---|
| 186 | my $inherited = shift->SUPER::top_targets(@_); |
---|
[991] | 187 | $inherited =~ s/^config ::/$& \$(INST_MAN5DIR)\$(DIRFILESEP).exists \$(INST_MAN8DIR)\$(DIRFILESEP).exists/m; |
---|
[861] | 188 | $inherited; |
---|
| 189 | } |
---|
| 190 | |
---|
[548] | 191 | sub install { |
---|
| 192 | my ($self) = @_; |
---|
| 193 | my $section = $self->SUPER::install(); |
---|
| 194 | |
---|
[1549] | 195 | $section =~ s/(^install ::.*)/$1 install_config install_templates install_data install_mo/m; |
---|
[991] | 196 | $section =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR) \$(INST_MAN8DIR) \$(DESTINSTALLMAN8DIR)/g; |
---|
[548] | 197 | |
---|
[705] | 198 | $section .= q[ |
---|
[548] | 199 | install_config :: |
---|
| 200 | install -d $(DESTDIR)/etc |
---|
[861] | 201 | install -d $(DESTDIR)/etc/latmos-accounts |
---|
| 202 | install sample/latmos-accounts.ini $(DESTDIR)/etc/latmos-accounts/latmos-accounts.ini |
---|
| 203 | install sample/la-sync-list.ini $(DESTDIR)/etc/latmos-accounts/la-sync-list.ini |
---|
| 204 | install sample/la-allowed-values.ini $(DESTDIR)/etc/latmos-accounts/la-allowed-values.ini |
---|
| 205 | install sample/la-sync-manager.ini $(DESTDIR)/etc/latmos-accounts/la-sync-manager.ini |
---|
[705] | 206 | |
---|
| 207 | install_templates :: |
---|
[881] | 208 | install -d $(DESTDIR)$(DATADIR)/templates |
---|
[705] | 209 | $(ABSPERLRUN) -MExtUtils::Install -e 'install({ templates => @ARGV })' \\ |
---|
[881] | 210 | $(DESTDIR)$(DATADIR)/templates |
---|
| 211 | |
---|
| 212 | install_data :: |
---|
| 213 | install -d $(DESTDIR)$(DATADIR) |
---|
| 214 | $(ABSPERLRUN) -MExtUtils::Install -e 'install({ sqldata => @ARGV })' \\ |
---|
| 215 | $(DESTDIR)$(DATADIR) |
---|
[1546] | 216 | |
---|
[1549] | 217 | install_mo: mo |
---|
| 218 | install -d $(DESTDIR)$(LOCALEDIR) |
---|
[705] | 219 | ]; |
---|
[1553] | 220 | |
---|
| 221 | foreach (@po) { |
---|
[1554] | 222 | $section .= "\tinstall -d \$(DESTDIR)\$(LOCALEDIR)/$_/LC_MESSAGES\n"; |
---|
| 223 | $section .= "\tinstall po/$_/LC_MESSAGES/linkaccounts.mo \$(DESTDIR)\$(LOCALEDIR)/$_/LC_MESSAGES/linkaccounts.mo\n"; |
---|
[1553] | 224 | } |
---|
| 225 | $section .= "\n"; |
---|
[548] | 226 | |
---|
| 227 | return $section; |
---|
| 228 | } |
---|
[1027] | 229 | |
---|
| 230 | sub test { |
---|
| 231 | my $inherited = shift->SUPER::test(@_); |
---|
| 232 | |
---|
[1030] | 233 | $inherited =~ s:^(test_dynamic .*):$1 test_scripts:m; |
---|
| 234 | |
---|
[1027] | 235 | $inherited .= <<EOF; |
---|
| 236 | |
---|
| 237 | TESTLIVE_FILES = live-test/*.t |
---|
[1030] | 238 | TESTSCRIPTS_FILE = t/scripts.pl |
---|
[1027] | 239 | |
---|
| 240 | test_live :: pure_all |
---|
| 241 | \tPERL_DL_NONLAZY=1 \$(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness(\$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" \$(TESTLIVE_FILES) |
---|
| 242 | |
---|
[1030] | 243 | test_scripts :: pure_all |
---|
| 244 | \tPERL_DL_NONLAZY=1 \$(FULLPERLRUN) "-I\$(INST_LIB)" "-I\$(INST_ARCHLIB)" \$(TESTSCRIPTS_FILE) \$(EXE_FILES) |
---|
[1027] | 245 | EOF |
---|
| 246 | return $inherited; |
---|
| 247 | } |
---|