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