source: trunk/LATMOS-Accounts/Makefile.PL @ 991

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