[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. |
---|
| 5 | WriteMakefile( |
---|
| 6 | NAME => 'LATMOS::Accounts', |
---|
[989] | 7 | VERSION_FROM => 'lib/LATMOS/Accounts.pm', |
---|
[258] | 8 | PREREQ_PM => { |
---|
| 9 | 'Net::LDAP' => undef, |
---|
| 10 | 'Unicode::Map8' => undef, |
---|
| 11 | 'DBD::Pg' => undef, |
---|
[413] | 12 | 'Crypt::RSA' => undef, |
---|
| 13 | 'MIME::Base64' => undef, |
---|
| 14 | 'Term::ReadKey' => undef, |
---|
[432] | 15 | 'Config::IniFiles' => undef, |
---|
| 16 | 'Mail::Sendmail' => undef, |
---|
| 17 | 'Net::DNS' => undef, |
---|
| 18 | 'Template' => undef, |
---|
| 19 | 'Sys::Syslog' => undef, |
---|
[627] | 20 | 'Pod::Usage' => undef, |
---|
[432] | 21 | 'Unicode::String' => undef, |
---|
[584] | 22 | 'Crypt::Cracklib' => undef, |
---|
[861] | 23 | 'Net::IP' => undef, |
---|
[867] | 24 | 'Net::IPv4Addr' => undef, |
---|
| 25 | 'Net::IPv6Addr' => undef, |
---|
[258] | 26 | }, # e.g., Module::Name => 1.1 |
---|
[1] | 27 | ($] >= 5.005 ? ## Add these new keywords supported since 5.005 |
---|
| 28 | (ABSTRACT_FROM => 'lib/LATMOS/Accounts.pm', # retrieve abstract from module |
---|
[254] | 29 | AUTHOR => 'Thauvin Olivier <olivier.thauvin@latmos.ipsl.fr>') : ()), |
---|
[416] | 30 | EXE_FILES => [ qw( |
---|
| 31 | bin/la-acls |
---|
[640] | 32 | bin/la-qacls |
---|
[617] | 33 | bin/la-attributes |
---|
[845] | 34 | bin/la-cli |
---|
[416] | 35 | bin/la-config |
---|
| 36 | bin/la-create |
---|
| 37 | bin/la-crypt-passwd |
---|
[531] | 38 | bin/la-delete |
---|
[416] | 39 | bin/la-edit |
---|
[861] | 40 | bin/la-find-expired |
---|
[416] | 41 | bin/la-group |
---|
| 42 | bin/la-guser |
---|
| 43 | bin/la-passwd |
---|
| 44 | bin/la-query |
---|
[715] | 45 | bin/la-rename |
---|
[861] | 46 | bin/la-rename-host |
---|
| 47 | bin/la-exchange-ip |
---|
[838] | 48 | bin/la-rev |
---|
[613] | 49 | bin/la-search |
---|
[416] | 50 | bin/la-sync |
---|
[728] | 51 | bin/la-sync-list |
---|
[578] | 52 | bin/la-sync-manager |
---|
[416] | 53 | bin/la-warn-expire |
---|
[861] | 54 | bin/la-freeip |
---|
| 55 | bin/la-buildnet |
---|
| 56 | bin/la-expired-reminder |
---|
| 57 | bin/la-sql-regatt |
---|
| 58 | bin/la-sql-loadatt |
---|
[881] | 59 | bin/la-sql-upgrade |
---|
[959] | 60 | bin/la-sql-edit-form |
---|
[990] | 61 | bin/la-test-mail |
---|
[416] | 62 | ) ], |
---|
[861] | 63 | macro => { |
---|
| 64 | INSTALLMAN5DIR => '$(PERLPREFIX)/share/man/man5', |
---|
| 65 | DESTINSTALLMAN5DIR => '$(DESTDIR)$(INSTALLMAN5DIR)', |
---|
| 66 | INST_MAN5DIR => 'blib/man5', |
---|
[881] | 67 | DESTRPMDIR => '$(shell pwd)', |
---|
| 68 | DATADIR => '/usr/share/latmos-accounts', |
---|
| 69 | DESTDATADIR => '$(DESTDIR)$(DATADIR)', |
---|
[861] | 70 | }, |
---|
| 71 | MAN1PODS => { |
---|
| 72 | map { |
---|
| 73 | my $targ = $_; |
---|
| 74 | $targ =~ s{^man/}{}; |
---|
| 75 | $targ =~ s{^bin/}{}; |
---|
| 76 | $targ =~ s/\.(\d)\.pod$//; |
---|
| 77 | my $section = $1 || 1; |
---|
| 78 | ( $_ => |
---|
| 79 | "\$(INST_MAN${section}DIR)/$targ.$section" ); |
---|
| 80 | } <man/*.pod>, (grep { ! /~$/ } <bin/*>) |
---|
| 81 | }, |
---|
| 82 | |
---|
[1] | 83 | ); |
---|
[416] | 84 | |
---|
| 85 | package MY; |
---|
| 86 | |
---|
| 87 | sub postamble { |
---|
| 88 | <<EOF; |
---|
[861] | 89 | #.PHONY .= svnmanifest |
---|
[416] | 90 | |
---|
[881] | 91 | bin/la-sql-upgrade: bin/la-sql-upgrade.in |
---|
| 92 | \tcat \$< \| sed 's:\@DATADIR\@:\$(DATADIR):' > \$@ |
---|
| 93 | \tchmod +x \$@ |
---|
| 94 | |
---|
[416] | 95 | svnmanifest: |
---|
| 96 | \tsvn ls -R| grep -v "/\$\$" > MANIFEST |
---|
| 97 | |
---|
[432] | 98 | ChangeLog: |
---|
| 99 | \tsvn log > ChangeLog |
---|
| 100 | |
---|
| 101 | latmos-accounts.spec: latmos-accounts.spec.in Makefile |
---|
| 102 | \tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@ |
---|
| 103 | |
---|
| 104 | rpm: \$(DISTVNAME).tar.gz latmos-accounts.spec |
---|
| 105 | \tmkdir ./noarch || : |
---|
| 106 | \trpmbuild -ba --clean\\ |
---|
| 107 | \t --define "_sourcedir `pwd`" \\ |
---|
| 108 | \t --define "_specdir `pwd`" \\ |
---|
[861] | 109 | \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ |
---|
| 110 | \t --define "_rpmdir \$(DESTRPMDIR)" \\ |
---|
[432] | 111 | \t latmos-accounts.spec |
---|
| 112 | |
---|
[861] | 113 | svnrpm: \$(DISTVNAME).tar.gz latmos-accounts.spec |
---|
| 114 | \tmkdir \$(DESTRPMDIR)/noarch || : |
---|
| 115 | \trpmbuild -ba --clean\\ |
---|
| 116 | \t --define "_sourcedir `pwd`" \\ |
---|
| 117 | \t --define "_specdir `pwd`" \\ |
---|
| 118 | \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ |
---|
| 119 | \t --define "_rpmdir \$(DESTRPMDIR)" \\ |
---|
| 120 | \t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\ |
---|
| 121 | \t latmos-accounts.spec |
---|
| 122 | |
---|
[416] | 123 | EOF |
---|
| 124 | } |
---|
[548] | 125 | |
---|
[861] | 126 | sub installbin { |
---|
| 127 | my $self = shift; |
---|
| 128 | my $inherited = $self->SUPER::installbin(@_); |
---|
| 129 | my $s = join '|', map quotemeta, @sbin_scripts; |
---|
| 130 | # how to create needed directories under blib |
---|
| 131 | $inherited .= $self->dir_target("\$(INST_$_)") for qw(MAN5DIR); |
---|
| 132 | $inherited; |
---|
| 133 | } |
---|
| 134 | |
---|
| 135 | sub top_targets { |
---|
| 136 | my $inherited = shift->SUPER::top_targets(@_); |
---|
| 137 | $inherited =~ s/^config ::/$& \$(INST_MAN5DIR)\$(DIRFILESEP).exists/m; |
---|
| 138 | $inherited; |
---|
| 139 | } |
---|
| 140 | |
---|
[548] | 141 | sub install { |
---|
| 142 | my ($self) = @_; |
---|
| 143 | my $section = $self->SUPER::install(); |
---|
| 144 | |
---|
[881] | 145 | $section =~ s/(^install ::.*)/$1 install_config install_templates install_data/m; |
---|
[861] | 146 | $section =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR)/g; |
---|
[548] | 147 | |
---|
[705] | 148 | $section .= q[ |
---|
[548] | 149 | install_config :: |
---|
| 150 | install -d $(DESTDIR)/etc |
---|
[861] | 151 | install -d $(DESTDIR)/etc/latmos-accounts |
---|
| 152 | install sample/latmos-accounts.ini $(DESTDIR)/etc/latmos-accounts/latmos-accounts.ini |
---|
| 153 | install sample/la-sync-list.ini $(DESTDIR)/etc/latmos-accounts/la-sync-list.ini |
---|
| 154 | install sample/la-allowed-values.ini $(DESTDIR)/etc/latmos-accounts/la-allowed-values.ini |
---|
| 155 | install sample/la-sync-manager.ini $(DESTDIR)/etc/latmos-accounts/la-sync-manager.ini |
---|
[705] | 156 | |
---|
| 157 | install_templates :: |
---|
[881] | 158 | install -d $(DESTDIR)$(DATADIR)/templates |
---|
[705] | 159 | $(ABSPERLRUN) -MExtUtils::Install -e 'install({ templates => @ARGV })' \\ |
---|
[881] | 160 | $(DESTDIR)$(DATADIR)/templates |
---|
| 161 | |
---|
| 162 | install_data :: |
---|
| 163 | install -d $(DESTDIR)$(DATADIR) |
---|
| 164 | $(ABSPERLRUN) -MExtUtils::Install -e 'install({ sqldata => @ARGV })' \\ |
---|
| 165 | $(DESTDIR)$(DATADIR) |
---|
[705] | 166 | ]; |
---|
[548] | 167 | |
---|
| 168 | return $section; |
---|
| 169 | } |
---|