From 5883745ca5dca8f4e79b4359b0651e1a693a6fcd Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 25 Nov 2005 11:16:59 +0000 Subject: Add the ability to install locale files --- Makefile.PL | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Makefile.PL') diff --git a/Makefile.PL b/Makefile.PL index 00c652f7..7c54880e 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -6,8 +6,11 @@ use strict; use ExtUtils::MakeMaker; # Command-line parsing. -my $with_rpm = 1; -$with_rpm = 0 if grep $_ eq '--without-rpm', @ARGV; +# --without-rpm : use rpm to find some paths, and generate make targets to +# produce an rpm of this +# --install-po : compile .po files and install locale files +my $with_rpm = 1; $with_rpm = 0 if grep $_ eq '--without-rpm', @ARGV; +my $with_po = 0; $with_po = 1 if grep $_ eq '--install-po', @ARGV; # Directory where to build an rpm of this my $rpmtopdir = $with_rpm ? qx(rpm --eval %_topdir) : ''; @@ -44,7 +47,8 @@ sub install { # and new manpage sections $inherited =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_SBIN) \$(DESTINSTALL$1SBIN) \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR) \$(INST_MAN8DIR) \$(DESTINSTALLMAN8DIR)/g; # install files under /etc and /var - $inherited =~ s/^install ::/$& installconfigfiles installstatedir/gm; + my $po = $with_po ? ' installpo' : ''; + $inherited =~ s/^install ::/$& installconfigfiles installstatedir$po/gm; $inherited; } @@ -61,8 +65,8 @@ sub postamble { <<"**MM**"; .PHONY: installconfigfiles installstatedir ChangeLog rpmdist srpm rpm -po: - \$(MAKE) -C \$\@ +installpo: + \$(MAKE) -C po install installconfigfiles: install -d \$(SYSCONFDIR)/urpmi @@ -117,6 +121,7 @@ WriteMakefile( }, EXE_FILES => [ @bin_scripts, @sbin_scripts ], PMLIBDIRS => [ qw(urpm) ], + DIR => $with_po ? [ 'po' ] : undef, MAN1PODS => { map { my $targ = $_; -- cgit v1.2.1