source: branches/2.0/LATMOS-Accounts/Makefile.PL @ 1295

Last change on this file since 1295 was 861, checked in by nanardon, 13 years ago
  • reimport missing files from previous svn
File size: 4.6 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.5', # 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    }, # e.g., Module::Name => 1.1
25    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
26      (ABSTRACT_FROM  => 'lib/LATMOS/Accounts.pm', # retrieve abstract from module
27       AUTHOR         => 'Thauvin Olivier <olivier.thauvin@latmos.ipsl.fr>') : ()),
28    EXE_FILES => [ qw(
29        bin/la-acls
30        bin/la-qacls
31        bin/la-attributes
32        bin/la-cli
33        bin/la-config
34        bin/la-create
35        bin/la-crypt-passwd
36        bin/la-delete
37        bin/la-edit
38        bin/la-find-expired
39        bin/la-group
40        bin/la-guser
41        bin/la-passwd
42        bin/la-query
43        bin/la-rename
44        bin/la-rename-host
45        bin/la-exchange-ip
46        bin/la-rev
47        bin/la-search
48        bin/la-sync
49        bin/la-sync-list
50        bin/la-sync-manager
51        bin/la-warn-expire
52        bin/la-web-directory
53        bin/la-freeip
54        bin/la-buildnet
55        bin/la-expired-reminder
56        bin/la-sql-regatt
57        bin/la-sql-loadatt
58        ) ],
59        macro => {
60            INSTALLMAN5DIR      => '$(PERLPREFIX)/share/man/man5',
61            DESTINSTALLMAN5DIR  => '$(DESTDIR)$(INSTALLMAN5DIR)',
62            INST_MAN5DIR        => 'blib/man5',
63            DESTRPMDIR          => '$(shell pwd)'
64        },
65        MAN1PODS        => {
66            map {
67                my $targ = $_;
68                $targ =~ s{^man/}{};
69                $targ =~ s{^bin/}{};
70                $targ =~ s/\.(\d)\.pod$//;
71                my $section = $1 || 1;
72                ( $_ =>
73                    "\$(INST_MAN${section}DIR)/$targ.$section" );
74            } <man/*.pod>, (grep { ! /~$/ } <bin/*>)
75        },
76
77);
78
79package MY;
80
81sub postamble {
82    <<EOF;
83#.PHONY .= svnmanifest
84
85svnmanifest:
86\tsvn ls -R| grep -v "/\$\$"  > MANIFEST
87
88ChangeLog:
89\tsvn log > ChangeLog
90
91latmos-accounts.spec: latmos-accounts.spec.in Makefile
92\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@
93
94rpm: \$(DISTVNAME).tar.gz latmos-accounts.spec
95\tmkdir ./noarch || :
96\trpmbuild -ba --clean\\
97\t --define "_sourcedir `pwd`" \\
98\t --define "_specdir `pwd`" \\
99\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
100\t --define "_rpmdir \$(DESTRPMDIR)" \\
101\t latmos-accounts.spec
102
103svnrpm: \$(DISTVNAME).tar.gz latmos-accounts.spec
104\tmkdir \$(DESTRPMDIR)/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 --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\
111\t latmos-accounts.spec
112
113EOF
114}
115
116sub installbin {
117    my $self = shift;
118    my $inherited = $self->SUPER::installbin(@_);
119    my $s = join '|', map quotemeta, @sbin_scripts;
120    # how to create needed directories under blib
121    $inherited .= $self->dir_target("\$(INST_$_)") for qw(MAN5DIR);
122    $inherited;
123}
124
125sub top_targets {
126    my $inherited = shift->SUPER::top_targets(@_);
127    $inherited =~ s/^config ::/$& \$(INST_MAN5DIR)\$(DIRFILESEP).exists/m;
128    $inherited;
129}
130
131sub install {
132    my ($self) = @_;
133    my $section = $self->SUPER::install();
134
135    $section =~ s/(^install ::.*)/$1 install_config install_templates/m;
136    $section =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR)/g;
137
138    $section .= q[
139install_config ::
140        install -d $(DESTDIR)/etc
141        install -d $(DESTDIR)/etc/latmos-accounts
142        install sample/latmos-accounts.ini $(DESTDIR)/etc/latmos-accounts/latmos-accounts.ini
143        install sample/la-sync-list.ini $(DESTDIR)/etc/latmos-accounts/la-sync-list.ini
144        install sample/la-allowed-values.ini $(DESTDIR)/etc/latmos-accounts/la-allowed-values.ini
145        install sample/la-sync-manager.ini $(DESTDIR)/etc/latmos-accounts/la-sync-manager.ini
146
147install_templates ::
148        install -d $(DESTDIR)/usr/share/latmos-accounts/templates
149        $(ABSPERLRUN) -MExtUtils::Install -e 'install({ templates => @ARGV })' \\
150                $(DESTDIR)/usr/share/latmos-accounts/templates
151];
152 
153    return $section;
154}
Note: See TracBrowser for help on using the repository browser.