source: LATMOS-Accounts/Makefile.PL @ 876

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