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

Last change on this file since 989 was 989, checked in by nanardon, 12 years ago
  • LATMOS::Accounts version set into pm file instead Makefile.PL
File size: 5.1 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        ) ],
62        macro => {
63            INSTALLMAN5DIR      => '$(PERLPREFIX)/share/man/man5',
64            DESTINSTALLMAN5DIR  => '$(DESTDIR)$(INSTALLMAN5DIR)',
65            INST_MAN5DIR        => 'blib/man5',
66            DESTRPMDIR          => '$(shell pwd)',
67            DATADIR             => '/usr/share/latmos-accounts',
68            DESTDATADIR         => '$(DESTDIR)$(DATADIR)',
69        },
70        MAN1PODS        => {
71            map {
72                my $targ = $_;
73                $targ =~ s{^man/}{};
74                $targ =~ s{^bin/}{};
75                $targ =~ s/\.(\d)\.pod$//;
76                my $section = $1 || 1;
77                ( $_ =>
78                    "\$(INST_MAN${section}DIR)/$targ.$section" );
79            } <man/*.pod>, (grep { ! /~$/ } <bin/*>)
80        },
81
82);
83
84package MY;
85
86sub postamble {
87    <<EOF;
88#.PHONY .= svnmanifest
89
90bin/la-sql-upgrade: bin/la-sql-upgrade.in
91\tcat \$< \| sed 's:\@DATADIR\@:\$(DATADIR):' > \$@
92\tchmod +x \$@
93
94svnmanifest:
95\tsvn ls -R| grep -v "/\$\$"  > MANIFEST
96
97ChangeLog:
98\tsvn log > ChangeLog
99
100latmos-accounts.spec: latmos-accounts.spec.in Makefile
101\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@
102
103rpm: \$(DISTVNAME).tar.gz latmos-accounts.spec
104\tmkdir ./noarch || :
105\trpmbuild -ba --clean\\
106\t --define "_sourcedir `pwd`" \\
107\t --define "_specdir `pwd`" \\
108\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
109\t --define "_rpmdir \$(DESTRPMDIR)" \\
110\t latmos-accounts.spec
111
112svnrpm: \$(DISTVNAME).tar.gz latmos-accounts.spec
113\tmkdir \$(DESTRPMDIR)/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 --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\
120\t latmos-accounts.spec
121
122EOF
123}
124
125sub installbin {
126    my $self = shift;
127    my $inherited = $self->SUPER::installbin(@_);
128    my $s = join '|', map quotemeta, @sbin_scripts;
129    # how to create needed directories under blib
130    $inherited .= $self->dir_target("\$(INST_$_)") for qw(MAN5DIR);
131    $inherited;
132}
133
134sub top_targets {
135    my $inherited = shift->SUPER::top_targets(@_);
136    $inherited =~ s/^config ::/$& \$(INST_MAN5DIR)\$(DIRFILESEP).exists/m;
137    $inherited;
138}
139
140sub install {
141    my ($self) = @_;
142    my $section = $self->SUPER::install();
143
144    $section =~ s/(^install ::.*)/$1 install_config install_templates install_data/m;
145    $section =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR)/g;
146
147    $section .= q[
148install_config ::
149        install -d $(DESTDIR)/etc
150        install -d $(DESTDIR)/etc/latmos-accounts
151        install sample/latmos-accounts.ini $(DESTDIR)/etc/latmos-accounts/latmos-accounts.ini
152        install sample/la-sync-list.ini $(DESTDIR)/etc/latmos-accounts/la-sync-list.ini
153        install sample/la-allowed-values.ini $(DESTDIR)/etc/latmos-accounts/la-allowed-values.ini
154        install sample/la-sync-manager.ini $(DESTDIR)/etc/latmos-accounts/la-sync-manager.ini
155
156install_templates ::
157        install -d $(DESTDIR)$(DATADIR)/templates
158        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ templates => @ARGV })' \\
159                $(DESTDIR)$(DATADIR)/templates
160
161install_data ::
162        install -d $(DESTDIR)$(DATADIR)
163        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ sqldata => @ARGV })' \\
164            $(DESTDIR)$(DATADIR)
165];
166 
167    return $section;
168}
Note: See TracBrowser for help on using the repository browser.