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

Last change on this file since 1376 was 1376, checked in by nanardon, 9 years ago

Add Zimbra support

File size: 6.2 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        'DateTime' => undef,
27        'SOAP::Lite' => undef,
28        'HTTP::Cookies' => undef,
29        'XML::XPath' => undef,
30    }, # e.g., Module::Name => 1.1
31    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
32      (ABSTRACT_FROM  => 'lib/LATMOS/Accounts.pm', # retrieve abstract from module
33       AUTHOR         => 'Thauvin Olivier <olivier.thauvin@latmos.ipsl.fr>') : ()),
34    EXE_FILES => [ qw(
35        bin/la-acls
36        bin/la-qacls
37        bin/la-attributes
38        bin/la-cli
39        bin/la-config
40        bin/la-create
41        bin/la-sql-crypt-passwd
42        bin/la-delete
43        bin/la-edit
44        bin/la-sql-find-expired
45        bin/la-group
46        bin/la-guser
47        bin/la-passwd
48        bin/la-query
49        bin/la-rename
50        bin/la-sql-rename-host
51        bin/la-sql-exchange-ip
52        bin/la-sql-exchange-hostname
53        bin/la-sql-switch-cname
54        bin/la-sql-rev
55        bin/la-search
56        bin/la-sync
57        bin/la-sync-manager
58        bin/la-sync-ctl
59        bin/la-warn-expire
60        bin/la-sql-freeip
61        bin/la-expired-reminder
62        bin/la-sql-upgrade
63        bin/la-sql-edit-form
64        bin/la-sql-updsshfp
65        bin/la-test-mail
66        bin/la-sql-log
67        ) ],
68        macro => {
69            INSTALLMAN5DIR      => '$(PERLPREFIX)/share/man/man5',
70            INSTALLMAN8DIR      => '$(PERLPREFIX)/share/man/man8',
71            DESTINSTALLMAN5DIR  => '$(DESTDIR)$(INSTALLMAN5DIR)',
72            DESTINSTALLMAN8DIR  => '$(DESTDIR)$(INSTALLMAN8DIR)',
73            INST_MAN5DIR        => 'blib/man5',
74            INST_MAN8DIR        => 'blib/man8',
75            DESTRPMDIR          => '$(shell pwd)',
76            DATADIR             => '/usr/share/latmos-accounts',
77            DESTDATADIR         => '$(DESTDIR)$(DATADIR)',
78        },
79        MAN1PODS        => {
80            map {
81                my $targ = $_;
82                $targ =~ s{^man/man(\d)}{};
83                my $section = $1 || 1;
84                $targ =~ s{^bin/}{};
85                $targ =~ s/.pod$//;
86                ( $_ =>
87                    "\$(INST_MAN${section}DIR)/$targ.$section" );
88            } <man/man?/*.pod>, (grep { ! /~$/ } <bin/*>)
89        },
90
91);
92
93package MY;
94
95sub postamble {
96    <<EOF;
97#.PHONY .= svnmanifest
98
99bin/la-sql-upgrade: bin/la-sql-upgrade.in
100\tcat \$< \| sed 's:\@DATADIR\@:\$(DATADIR):' > \$@
101\tchmod +x \$@
102
103svnmanifest:
104\tsvn ls -R| grep -v "/\$\$"  > MANIFEST
105
106ChangeLog:
107\tsvn log > ChangeLog
108
109latmos-accounts.spec: latmos-accounts.spec.in Makefile
110\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@
111
112rpm: \$(DISTVNAME).tar.gz latmos-accounts.spec
113\tmkdir ./noarch || :
114\trpmbuild -ba --clean\\
115\t --define "_sourcedir `pwd`" \\
116\t --define "_specdir `pwd`" \\
117\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
118\t --define "_rpmdir \$(DESTRPMDIR)" \\
119\t latmos-accounts.spec
120
121svnrpm: \$(DISTVNAME).tar.gz latmos-accounts.spec
122\tmkdir \$(DESTRPMDIR)/noarch || :
123\trpmbuild -ba --clean\\
124\t --define "_sourcedir `pwd`" \\
125\t --define "_specdir `pwd`" \\
126\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
127\t --define "_rpmdir \$(DESTRPMDIR)" \\
128\t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\
129\t latmos-accounts.spec
130
131podhtml: \$(MAN1PODS) \$(MAN3PODS)
132\tmkdir html || :
133\trm -f html/*
134\tperl scripts/pod2xhtml.pl \$(MAN1PODS) \$(MAN3PODS)
135
136EOF
137}
138
139sub installbin {
140    my $self = shift;
141    my $inherited = $self->SUPER::installbin(@_);
142    my $s = join '|', map quotemeta, @sbin_scripts;
143    # how to create needed directories under blib
144    $inherited .= $self->dir_target("\$(INST_$_)") for qw(MAN5DIR MAN8DIR);
145    $inherited;
146}
147
148sub top_targets {
149    my $inherited = shift->SUPER::top_targets(@_);
150    $inherited =~ s/^config ::/$& \$(INST_MAN5DIR)\$(DIRFILESEP).exists \$(INST_MAN8DIR)\$(DIRFILESEP).exists/m;
151    $inherited;
152}
153
154sub install {
155    my ($self) = @_;
156    my $section = $self->SUPER::install();
157
158    $section =~ s/(^install ::.*)/$1 install_config install_templates install_data/m;
159    $section =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR) \$(INST_MAN8DIR) \$(DESTINSTALLMAN8DIR)/g;
160
161    $section .= q[
162install_config ::
163        install -d $(DESTDIR)/etc
164        install -d $(DESTDIR)/etc/latmos-accounts
165        install sample/latmos-accounts.ini $(DESTDIR)/etc/latmos-accounts/latmos-accounts.ini
166        install sample/la-sync-list.ini $(DESTDIR)/etc/latmos-accounts/la-sync-list.ini
167        install sample/la-allowed-values.ini $(DESTDIR)/etc/latmos-accounts/la-allowed-values.ini
168        install sample/la-sync-manager.ini $(DESTDIR)/etc/latmos-accounts/la-sync-manager.ini
169
170install_templates ::
171        install -d $(DESTDIR)$(DATADIR)/templates
172        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ templates => @ARGV })' \\
173                $(DESTDIR)$(DATADIR)/templates
174
175install_data ::
176        install -d $(DESTDIR)$(DATADIR)
177        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ sqldata => @ARGV })' \\
178            $(DESTDIR)$(DATADIR)
179];
180 
181    return $section;
182}
183
184sub test {
185    my $inherited = shift->SUPER::test(@_);
186
187    $inherited =~ s:^(test_dynamic .*):$1 test_scripts:m;
188
189    $inherited .= <<EOF;
190
191TESTLIVE_FILES = live-test/*.t
192TESTSCRIPTS_FILE = t/scripts.pl
193
194test_live :: pure_all
195\tPERL_DL_NONLAZY=1 \$(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness(\$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" \$(TESTLIVE_FILES)
196
197test_scripts :: pure_all
198\tPERL_DL_NONLAZY=1 \$(FULLPERLRUN) "-I\$(INST_LIB)" "-I\$(INST_ARCHLIB)" \$(TESTSCRIPTS_FILE) \$(EXE_FILES)
199EOF
200    return $inherited;
201}
Note: See TracBrowser for help on using the repository browser.