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