From eb8f6e900feccc2b7667289135f821438717ec8c Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 12 Oct 2013 16:47:43 +0100 Subject: Use polkit for authorisation (mga#11125) --- Makefile.PL | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'Makefile.PL') diff --git a/Makefile.PL b/Makefile.PL index 44fba5d3..ed39b155 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,14 +13,16 @@ use ExtUtils::MakeMaker; # --install-gui : install gurpmi 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; +my $with_polkit = 0; $with_polkit = 1 if grep $_ eq '--install-polkit', @ARGV; my $with_gui = 0; $with_gui = 1 if grep $_ eq '--install-gui', @ARGV; # 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 rurpme); +our @sbin_scripts = qw(urpmi urpme urpmi.addmedia urpmi.removemedia rurpmi rurpme); +our @libexec_scripts = qw(urpmi.update); if ($with_gui) { push @bin_scripts, qw(gurpmi); - push @sbin_scripts, qw(gurpmi2); + push @libexec_scripts, qw(gurpmi2); } # And now, add some functionality to MakeMaker. @@ -32,10 +34,10 @@ sub libscan { return !$with_gui && $path =~ /gurpmi/ ? '' : $path; } -# Make proper sbin/man5/man8 dirs in blib +# Make proper sbin/libexec/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 =~ s/^config ::/$& \$(INST_MAN5DIR)\$(DIRFILESEP).exists \$(INST_MAN8DIR)\$(DIRFILESEP).exists \$(INST_SBIN)\$(DIRFILESEP).exists \$(INST_LIBEXEC)\$(DIRFILESEP).exists/m; $inherited; } @@ -45,8 +47,10 @@ sub installbin { my $inherited = $self->SUPER::installbin(@_); my $s = join '|', map quotemeta, @sbin_scripts; $inherited =~ s{\$\(INST_SCRIPT\)/($s)}{\$(INST_SBIN)/$1}g; + $s = join '|', map quotemeta, @libexec_scripts; + $inherited =~ s{\$\(INST_SCRIPT\)/($s)}{\$(INST_LIBEXEC)/$1}g; # how to create needed directories under blib - $inherited .= $self->dir_target("\$(INST_$_)") for qw(SBIN MAN5DIR MAN8DIR); + $inherited .= $self->dir_target("\$(INST_$_)") for qw(SBIN LIBEXEC MAN5DIR MAN8DIR); $inherited; } @@ -54,11 +58,12 @@ 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; + $inherited =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_SBIN) \$(DESTINSTALL$1SBIN) \$(INST_LIBEXEC) \$(DESTINSTALLLIBEXECDIR) \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR) \$(INST_MAN8DIR) \$(DESTINSTALLMAN8DIR)/g; # install files under /etc and /var my $po = $with_po ? ' installpo' : ''; + my $polkit = $with_polkit ? ' installpolkit' : ''; my $gui = $with_gui ? ' installgurpmi2' : ''; - $inherited =~ s/^install ::/$& installconfigfiles installstatedir$po$gui/gm; + $inherited =~ s/^install ::/$& installconfigfiles installstatedir$po$polkit$gui/gm; $inherited; } @@ -97,6 +102,9 @@ sub postamble { installpo: \$(MAKE) -C po install +installpolkit: + \$(MAKE) -C polkit install + installconfigfiles: install -d \$(SYSCONFDIR)/urpmi install -m 644 inst.list skip.list \$(SYSCONFDIR)/urpmi @@ -108,11 +116,6 @@ installstatedir: install -d \$(DESTDIR)/var/cache/urpmi/rpms installgurpmi2: pure_install gurpmi.desktop - ln -s -f consolehelper \$(DESTINSTALLSCRIPT)/gurpmi2 - -ChangeLog: - svn2cl --accum --authors ${commonusername}username.xml - rm -f *.bak TAGS: etags *.pm */*.pm @@ -143,18 +146,21 @@ WriteMakefile( DESTINSTALLSBIN => '$(DESTINSTALLBIN)/../sbin', DESTINSTALLSITESBIN => '$(DESTINSTALLSITEBIN)/../sbin', DESTINSTALLVENDORSBIN => '$(DESTINSTALLVENDORBIN)/../sbin', + INSTALLLIBEXECDIR => '$(PERLPREFIX)/libexec', + DESTINSTALLLIBEXECDIR => '$(DESTDIR)$(INSTALLLIBEXECDIR)', INSTALLMAN5DIR => '$(PERLPREFIX)/share/man/man5', DESTINSTALLMAN5DIR => '$(DESTDIR)$(INSTALLMAN5DIR)', INSTALLMAN8DIR => '$(PERLPREFIX)/share/man/man8', DESTINSTALLMAN8DIR => '$(DESTDIR)$(INSTALLMAN8DIR)', INST_SBIN => 'blib/sbin', + INST_LIBEXEC => 'blib/libexec', 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 ], + EXE_FILES => [ @bin_scripts, @sbin_scripts, @libexec_scripts ], PMLIBDIRS => [ qw(gurpm urpm) ], $with_po ? (DIR => [ 'po' ]) : (), MAN1PODS => { -- cgit v1.2.1