From fbda80f5b359aa00790c17c3c671b807ee78aa79 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 25 Nov 2005 09:36:43 +0000 Subject: Add a functional Makefile.PL aimed at replacing the current Makefile --- MANIFEST | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile.PL | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 248 insertions(+) create mode 100644 MANIFEST create mode 100644 Makefile.PL diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 00000000..cf28dcdf --- /dev/null +++ b/MANIFEST @@ -0,0 +1,118 @@ +ChangeLog +gurpmi +gurpmi2 +gurpmi.pm +inst.list +MANIFEST +Makefile.PL +po/af.po +po/ar.po +po/az.po +po/bg.po +po/bn.po +po/br.po +po/bs.po +po/ca.po +po/create_placeholder +po/cs.po +po/cy.po +po/da.po +po/de.po +pod/proxy.cfg.5.pod +pod/rurpmi.8.pod +pod/urpme.8.pod +pod/urpmf.8.pod +pod/urpmi.8.pod +pod/urpmi.addmedia.8.pod +pod/urpmi.cfg.5.pod +pod/urpmi.files.5.pod +pod/urpmi.removemedia.8.pod +pod/urpmi.update.8.pod +pod/urpmq.8.pod +po/el.po +po/eo.po +po/es.po +po/et.po +po/eu.po +po/fa.po +po/fi.po +po/fr.po +po/fur.po +po/ga.po +po/gl.po +po/he.po +po/hi.po +po/hr.po +po/hu.po +po/id.po +po/is.po +po/it.po +po/ja.po +po/ka.po +po/ko.po +po/ky.po +po/lt.po +po/lv.po +po/Makefile +po/mk.po +po/mn.po +po/ms.po +po/mt.po +po/nb.po +po/nl.po +po/nn.po +po/pa_IN.po +po/placeholder.h +po/pl.po +po/pt_BR.po +po/pt.po +po/ro.po +po/ru.po +po/sc.po +po/sk.po +po/sl.po +po/sq.po +po/sr@Latn.po +po/sr.po +po/sv.po +po/tg.po +po/th.po +po/tl.po +po/tr.po +po/uk.po +po/urpmi.pot +po/uz@Latn.po +po/uz.po +po/vi.po +po/wa.po +po/zh_CN.po +po/zh_TW.po +rpm-find-leaves +rurpmi +skip.list +t/01compile.t +t/cfg.t +urpm/args.pm +urpm/cfg.pm +urpm/download.pm +urpme +urpmf +urpmi +urpmi.addmedia +urpmi.bash-completion +urpmi.logrotate +urpmi.removemedia +urpmi.schema +urpmi.spec +urpmi.update +urpm/ldap.pm +urpm/msg.pm +urpm/parallel_ka_run.pm +urpm/parallel_ssh.pm +urpm.pm +urpm/prompt.pm +urpmq +urpm/README.ka-run +urpm/README.ssh +urpm/sys.pm +urpm/util.pm diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 00000000..00c652f7 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,130 @@ +#!perl +# Makefile.PL for urpmi +# $Id$ + +use strict; +use ExtUtils::MakeMaker; + +# Command-line parsing. +my $with_rpm = 1; +$with_rpm = 0 if grep $_ eq '--without-rpm', @ARGV; + +# Directory where to build an rpm of this +my $rpmtopdir = $with_rpm ? qx(rpm --eval %_topdir) : ''; +chomp $rpmtopdir; + +# All scripts, some of them go in /usr/sbin (see DESTINSTALLSBIN below) +our @bin_scripts = qw(urpmq urpmf rpm-find-leaves); +our @sbin_scripts = qw(urpmi urpme urpmi.addmedia urpmi.update urpmi.removemedia rurpmi); + +# And now, add some functionality to MakeMaker. +package MY; + +# Make proper sbin/man5/man8 dirs in blib +sub top_targets { + my $inherited = shift->SUPER::top_targets(@_); + $inherited =~ s/^config ::/$& \$(INST_MAN5DIR)\$(DIRFILESEP).exists \$(INST_MAN8DIR)\$(DIRFILESEP).exists \$(INST_SBIN)\$(DIRFILESEP).exists/m; + $inherited; +} + +# Install sbin_scripts in sbin under blib +sub installbin { + my $self = shift; + my $inherited = $self->SUPER::installbin(@_); + my $s = join '|', map quotemeta, @sbin_scripts; + $inherited =~ s{\$\(INST_SCRIPT\)/($s)}{\$(INST_SBIN)/$1}g; + # how to create needed directories under blib + $inherited .= $self->dir_target("\$(INST_$_)") for qw(SBIN MAN5DIR MAN8DIR); + $inherited; +} + +sub install { + my $inherited = shift->SUPER::install(@_); + # Take into account scripts in sbin under blib + # 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; + $inherited; +} + +# Due to some hateful layout (that I can't change because the whole stuff is +# hosted in CVS (double hate)) I need to add pm_to_blib in the phonic targets. +sub special_targets { + my $inherited = shift->SUPER::special_targets(@_); + $inherited =~ s/PHONY:/$& pm_to_blib/; + $inherited; +} + +# Additional targets +sub postamble { + <<"**MM**"; +.PHONY: installconfigfiles installstatedir ChangeLog rpmdist srpm rpm + +po: + \$(MAKE) -C \$\@ + +installconfigfiles: + install -d \$(SYSCONFDIR)/urpmi + install -m 644 inst.list skip.list \$(SYSCONFDIR)/urpmi + +installstatedir: + install -d \$(LOCALSTATEDIR)/urpmi + +ChangeLog: + cvs2cl -W 400 -I ChangeLog --accum -U ../../soft/common/username + rm -f *.bak + +rpmdist: dist + cp -f urpmi.spec $rpmtopdir/SPECS + mv -f urpmi-*.tar.bz2 $rpmtopdir/SOURCES + +srpm: rpmdist + rpmbuild -bs --clean --rmsource $rpmtopdir/SPECS/urpmi.spec + +rpm: rpmdist + rpmbuild -ba --clean --rmsource $rpmtopdir/SPECS/urpmi.spec +**MM** +} + +# TODO gurpmi, gurpmi2 (need console-helper) + +# Back to our schedule +package main; + +WriteMakefile( + NAME => 'urpmi', + PREREQ_PM => { + 'Locale::gettext' => '1.01', + 'MDV::Packdrakeng' => '1.00', + 'URPM' => '1.29', + }, + VERSION_FROM => 'urpm.pm', + macro => { + DESTINSTALLSBIN => '$(DESTINSTALLBIN)/../sbin', + DESTINSTALLSITESBIN => '$(DESTINSTALLSITEBIN)/../sbin', + DESTINSTALLVENDORSBIN => '$(DESTINSTALLVENDORBIN)/../sbin', + INSTALLMAN5DIR => '$(PERLPREFIX)/share/man/man5', + DESTINSTALLMAN5DIR => '$(DESTDIR)$(INSTALLMAN5DIR)', + INSTALLMAN8DIR => '$(PERLPREFIX)/share/man/man8', + DESTINSTALLMAN8DIR => '$(DESTDIR)$(INSTALLMAN8DIR)', + INST_SBIN => 'blib/sbin', + INST_MAN5DIR => 'blib/man5', + INST_MAN8DIR => 'blib/man8', + # We could read those values from rpm macros. + SYSCONFDIR => '$(DESTDIR)/etc', + LOCALSTATEDIR => '$(DESTDIR)/var/lib', + }, + EXE_FILES => [ @bin_scripts, @sbin_scripts ], + PMLIBDIRS => [ qw(urpm) ], + MAN1PODS => { + map { + my $targ = $_; + $targ =~ s{^pod/}{}; + $targ =~ s/\.(\d)\.pod$//; + my $section = $1 || 1; + ( $_ => "\$(INST_MAN${section}DIR)/$targ.$section" ); + } + }, + dist => { COMPRESS => "bzip2", SUFFIX => ".bz2" }, +); -- cgit v1.2.1