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