diff options
-rw-r--r-- | urpm.pm | 22 | ||||
-rw-r--r-- | urpmi.spec | 105 |
2 files changed, 64 insertions, 63 deletions
@@ -165,7 +165,7 @@ sub sync_file { foreach (@_) { my ($in) = /^(?:removable[^:]*|file):\/(.*)/; propagate_sync_callback($options, 'start', $_); - system("cp", "--preserve=mode", "--preserve=timestamps", "-R", $in || $_, ref($options) ? $options->{dir} : $options) and + system("cp", "-p", "-R", $in || $_, ref($options) ? $options->{dir} : $options) and die N("copy failed: %s", $@); propagate_sync_callback($options, 'end', $_); } @@ -989,7 +989,7 @@ sub add_distrib_media { if (-e $hdlists_file) { unlink "$urpm->{cachedir}/partial/hdlists"; $urpm->{log}(N("copying hdlists file...")); - system("cp", "--preserve=mode", "--preserve=timestamps", "-R", $hdlists_file, "$urpm->{cachedir}/partial/hdlists") ? + system("cp", "-p", "-R", $hdlists_file, "$urpm->{cachedir}/partial/hdlists") ? $urpm->{log}(N("...copying failed")) : $urpm->{log}(N("...copying done")); } else { $urpm->{error}(N("unable to access first installation medium (no Mandrake/base/hdlists file found)")), return; @@ -1295,7 +1295,7 @@ this could happen if you mounted manually the directory when creating the medium unlink "$urpm->{statedir}/descriptions.$medium->{name}"; if (-e "$dir/../descriptions") { $urpm->{log}(N("copying description file of \"%s\"...", $medium->{name})); - system("cp", "--preserve=mode", "--preserve=timestamps", "-R", "$dir/../descriptions", + system("cp", "-p", "-R", "$dir/../descriptions", "$urpm->{statedir}/descriptions.$medium->{name}") ? $urpm->{log}(N("...copying failed")) : $urpm->{log}(N("...copying done")); } @@ -1384,8 +1384,7 @@ this could happen if you mounted manually the directory when creating the medium unlink "$urpm->{cachedir}/partial/$medium->{hdlist}"; $urpm->{log}(N("copying source hdlist (or synthesis) of \"%s\"...", $medium->{name})); $options{callback} && $options{callback}('copy', $medium->{name}); - if (system("cp", "--preserve=mode", "--preserve=timestamps", "-R", $with_hdlist_dir, - "$urpm->{cachedir}/partial/$medium->{hdlist}")) { + if (system("cp", "-p", "-R", $with_hdlist_dir, "$urpm->{cachedir}/partial/$medium->{hdlist}")) { $options{callback} && $options{callback}('failed', $medium->{name}); $urpm->{log}(N("...copying failed")); unlink "$urpm->{cachedir}/partial/$medium->{hdlist}"; #- force error... @@ -1448,8 +1447,7 @@ this could happen if you mounted manually the directory when creating the medium my $local_list = $medium->{with_hdlist} =~ /hd(list.*)\.cz2?$/ ? $1 : 'list'; my $path_list = reduce_pathname("$with_hdlist_dir/../$local_list"); -s $path_list or $path_list = "$dir/list"; - -s $path_list and system("cp", "--preserve=mode", "--preserve=timestamps", "-R", - $path_list, "$urpm->{cachedir}/partial/list"); + -s $path_list and system("cp", "-p", "-R", $path_list, "$urpm->{cachedir}/partial/list"); } } else { #- try to find rpm files, use recursive method, added additional @@ -1497,8 +1495,7 @@ this could happen if you mounted manually the directory when creating the medium my $local_pubkey = $medium->{with_hdlist} =~ /hdlist(.*)\.cz2?$/ ? "pubkey$1" : 'pubkey'; my $path_pubkey = reduce_pathname("$with_hdlist_dir/../$local_pubkey"); -s $path_pubkey or $path_pubkey = "$dir/pubkey"; - -s $path_pubkey and system("cp", "--preserve=mode", "--preserve=timestamps", "-R", - $path_pubkey, "$urpm->{cachedir}/partial/pubkey"); + -s $path_pubkey and system("cp", "-p", "-R", $path_pubkey, "$urpm->{cachedir}/partial/pubkey"); } } else { my $basename; @@ -1646,11 +1643,11 @@ this could happen if you mounted manually the directory when creating the medium unless ($options{force}) { if ($medium->{synthesis}) { -e "$urpm->{statedir}/synthesis.$medium->{hdlist}" and - system("cp", "--preserve=mode", "--preserve=timestamps", "-R", + system("cp", "-p", "-R", "$urpm->{statedir}/synthesis.$medium->{hdlist}", "$urpm->{cachedir}/partial/$basename"); } else { -e "$urpm->{statedir}/$medium->{hdlist}" and - system("cp", "--preserve=mode", "--preserve=timestamps", "-R", + system("cp", "-p", "-R", "$urpm->{statedir}/$medium->{hdlist}", "$urpm->{cachedir}/partial/$basename"); } } @@ -2790,8 +2787,7 @@ sub copy_packages_of_removable_media { #- first copy in cache, and if the package is still good, transfert it #- to the great rpms cache. unlink "$urpm->{cachedir}/partial/$filename"; - if (!system("cp", "--preserve=mode", "--preserve=timestamps", "-R", - $filepath, "$urpm->{cachedir}/partial") && + if (!system("cp", "-p", "-R", $filepath, "$urpm->{cachedir}/partial") && URPM::verify_rpm("$urpm->{cachedir}/partial/$filename", nosignatures => 1) !~ /NOT OK/) { #- now we can consider the file to be fine. unlink "$urpm->{cachedir}/rpms/$filename"; @@ -1,26 +1,29 @@ %define name urpmi %define version 4.4 -%define release 44mdk -%define group System/Configuration/Packaging +%define release 45mdk + +%define group %(perl -e 'printf "%%s\\n", "%_vendor" =~ /mandrake/i ? "System/Configuration/Packaging" : "System Environment/Base"') + +%{expand:%%define compat_perl_vendorlib %(perl -MConfig -e 'printf "%%s\n", "%{?perl_vendorlib:1}" ? "%%{perl_vendorlib}" : "$Config{installvendorlib}"')} +%{expand:%%define use_locale %%(perl -e 'printf "%%s\\n", "%_vendor" =~ /mandrake/i ? 1 : 0')} +%{expand:%%define allow_gurpmi %%(perl -e 'printf "%%s\\n", "%_vendor" =~ /mandrake/i ? 1 : 0')} +%{expand:%%define req_webfetch %%(perl -e 'printf "%%s\\n", "%_vendor" =~ /mandrake/i ? "webfetch" : "curl wget"')} +%{expand:%%define buildreq_locale %%(perl -e 'printf "%%s\\n", "%_vendor" =~ /mandrake/i ? "perl-MDK-Common-devel" : ""')} +%{expand:%%define distribution %%(perl -e 'printf "%%s\\n", ("%_vendor" =~ /mandrake/i ? "Mandrake Linux" : "Red Hat Linux")')} +%{expand:%%define real_release %%(perl -e 'printf "%%s\\n", ("%_vendor" !~ /mandrake/i && ("%release" =~ /(.*?)mdk/)[0] || "%release")')} Name: %{name} Version: %{version} -Release: %{release} +Release: %{real_release} Group: %{group} +Distribution: %{distribution} License: GPL Source0: %{name}.tar.bz2 Summary: User mode rpm install URL: http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/urpmi -Requires: eject -Requires: webfetch -Requires: gnupg -PreReq: perl-Locale-gettext >= 1.01-7mdk -PreReq: rpmtools >= 4.3-6mdk -PreReq: perl-URPM >= 0.94 -BuildRequires: bzip2-devel -BuildRequires: gettext -BuildRequires: rpm-devel >= 4.0.3 -BuildRequires: perl-MDK-Common-devel +Requires: %{req_webfetch} eject gnupg +PreReq: perl-Locale-gettext >= 1.01-7 gettext rpmtools >= 4.5 perl-URPM >= 0.94 +BuildRequires: %{buildreq_locale} bzip2-devel rpm-devel >= 4.0.3 BuildRoot: %{_tmppath}/%{name}-buildroot BuildArch: noarch @@ -29,19 +32,16 @@ urpmi takes care of dependencies between rpms, using a pool (or pools) of rpms. You can compare rpm vs. urpmi with insmod vs. modprobe +%if %{allow_gurpmi} %package -n gurpmi Summary: User mode rpm GUI install -Requires: urpmi >= %{version}-%{release} -Requires: drakxtools -Requires: gchooser -Requires: gmessage -Requires: usermode -Requires: menu Group: %{group} +Requires: urpmi >= %{version}-%{release} drakxtools gchooser gmessage usermode menu Obsoletes: grpmi %description -n gurpmi gurpmi is a graphical front-end to urpmi +%endif #%package -n autoirpm #Summary: Auto install of rpm on demand @@ -53,8 +53,7 @@ gurpmi is a graphical front-end to urpmi %package -n urpmi-parallel-ka-run Summary: Parallel extensions to urpmi using ka-run -Requires: urpmi >= %{version}-%{release} -Requires: ka-run >= 2.0-15mdk +Requires: urpmi >= %{version}-%{release} ka-run >= 2.0-15mdk Group: %{group} %description -n urpmi-parallel-ka-run @@ -63,8 +62,7 @@ distributed installation using ka-run tools. %package -n urpmi-parallel-ssh Summary: Parallel extensions to urpmi using ssh and scp -Requires: urpmi >= %{version}-%{release} -Requires: openssh-clients +Requires: urpmi >= %{version}-%{release} openssh-clients Group: %{group} %description -n urpmi-parallel-ssh @@ -75,15 +73,15 @@ distributed installation using ssh and scp tools. %setup -q -n %{name} %install -rm -rf $RPM_BUILD_ROOT -make PREFIX=$RPM_BUILD_ROOT MANDIR=$RPM_BUILD_ROOT%{_mandir} install +%{__rm} -rf %{buildroot} +%{__make} PREFIX=%{buildroot} MANDIR=%{buildroot}%{_mandir} install #install -d $RPM_BUILD_ROOT/var/lib/urpmi/autoirpm.scripts for dir in partial headers rpms do - install -d $RPM_BUILD_ROOT/var/cache/urpmi/$dir + install -d %{buildroot}/var/cache/urpmi/$dir done #install -m 644 autoirpm.deny $RPM_BUILD_ROOT/etc/urpmi -cat <<EOF >$RPM_BUILD_ROOT/etc/urpmi/inst.list +cat <<EOF >%{buildroot}/etc/urpmi/inst.list # Here you can specify packages that need to be installed instead # of being upgraded (typically kernel packages). kernel @@ -98,30 +96,31 @@ kernel22-smp hackkernel EOF -mkdir -p $RPM_BUILD_ROOT%{perl_vendorlib} -install -m 644 urpm.pm $RPM_BUILD_ROOT%{perl_vendorlib}/urpm.pm -install -m 644 gurpm.pm $RPM_BUILD_ROOT%{perl_vendorlib}/gurpm.pm -mkdir -p $RPM_BUILD_ROOT%{perl_vendorlib}/urpm -install -m 644 urpm/parallel_ka_run.pm $RPM_BUILD_ROOT%{perl_vendorlib}/urpm/parallel_ka_run.pm -install -m 644 urpm/parallel_ssh.pm $RPM_BUILD_ROOT%{perl_vendorlib}/urpm/parallel_ssh.pm -mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3 -pod2man urpm.pm >$RPM_BUILD_ROOT%{_mandir}/man3/urpm.3 +mkdir -p %{buildroot}%{compat_perl_vendorlib} +install -m 644 urpm.pm %{buildroot}%{compat_perl_vendorlib}/urpm.pm +install -m 644 gurpm.pm %{buildroot}%{compat_perl_vendorlib}/gurpm.pm +mkdir -p %{buildroot}%{compat_perl_vendorlib}/urpm +install -m 644 urpm/parallel_ka_run.pm %{buildroot}%{compat_perl_vendorlib}/urpm/parallel_ka_run.pm +install -m 644 urpm/parallel_ssh.pm %{buildroot}%{compat_perl_vendorlib}/urpm/parallel_ssh.pm +mkdir -p %{buildroot}%{_mandir}/man3 +pod2man urpm.pm >%{buildroot}%{_mandir}/man3/urpm.3 -#find $RPM_BUILD_ROOT%{_datadir}/locale -name %{name}.mo | \ +#find %{buildroot}%{_datadir}/locale -name %{name}.mo | \ # perl -pe 'm|locale/([^/_]*)(.*)|; $_ = "%%lang($1) %{_datadir}/locale/$1$2\n"' > %{name}.lang -mv -f $RPM_BUILD_ROOT%{_bindir}/rpm-find-leaves $RPM_BUILD_ROOT%{_bindir}/urpmi_rpm-find-leaves +mv -f %{buildroot}%{_bindir}/rpm-find-leaves %{buildroot}%{_bindir}/urpmi_rpm-find-leaves # logrotate -install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d -install -m 644 %{name}.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} +install -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d +install -m 644 %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} # bash completion -install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d -install -m 644 %{name}.bash-completion $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/%{name} +install -d -m 755 %{buildroot}%{_sysconfdir}/bash_completion.d +install -m 644 %{name}.bash-completion %{buildroot}%{_sysconfdir}/bash_completion.d/%{name} -mkdir -p $RPM_BUILD_ROOT%{_menudir} -cat << EOF > $RPM_BUILD_ROOT%{_menudir}/gurpmi +%if %{allow_gurpmi} +mkdir -p %{buildroot}%{_menudir} +cat << EOF > %{buildroot}%{_menudir}/gurpmi ?package(gurpmi): command="%{_bindir}/gurpmi" needs="gnome" section=".hidden" \ section=".hidden" \ title="Software installer" longtitle="Graphical front end to install RPM files" \ @@ -133,13 +132,12 @@ title="Software installer" longtitle="Graphical front end to install RPM files" mimetypes="application/x-rpm" \ multiple_files="true" EOF - +%endif %find_lang %{name} %clean -rm -rf $RPM_BUILD_ROOT -rm -rf $RPM_BUILD_DIR/$RPM_PACKAGE_NAME +rm -rf %{buildroot} %preun if [ "$1" = "0" ]; then @@ -159,11 +157,13 @@ $urpm->update_media(nolock => 1, nopubkey => 1); #%preun -n autoirpm #[ -x %{_sbindir}/autoirpm.uninstall ] && %{_sbindir}/autoirpm.uninstall +%if %{allow_gurpmi} %post -n gurpmi %{update_menus} %postun -n gurpmi %{clean_menus} +%endif %files -f %{name}.lang %defattr(-,root,root) @@ -192,14 +192,16 @@ $urpm->update_media(nolock => 1, nopubkey => 1); %lang(fr) %{_mandir}/fr/man?/urpm* %lang(ru) %{_mandir}/ru/man?/urpm* %lang(uk) %{_mandir}/uk/man?/urpm* -%{perl_vendorlib}/urpm.pm +%{compat_perl_vendorlib}/urpm.pm +%if %{allow_gurpmi} %files -n gurpmi %defattr(-,root,root) %{_sbindir}/gurpmi %{_bindir}/gurpmi %{_menudir}/gurpmi -%{perl_vendorlib}/gurpm.pm +%{compat_perl_vendorlib}/gurpm.pm +%endif #%files -n autoirpm #%defattr(-,root,root) @@ -218,14 +220,17 @@ $urpm->update_media(nolock => 1, nopubkey => 1); %files -n urpmi-parallel-ka-run %defattr(-,root,root) %doc urpm/README.ka-run -%{perl_vendorlib}/urpm/parallel_ka_run.pm +%{compat_perl_vendorlib}/urpm/parallel_ka_run.pm %files -n urpmi-parallel-ssh %defattr(-,root,root) %doc urpm/README.ssh -%{perl_vendorlib}/urpm/parallel_ssh.pm +%{compat_perl_vendorlib}/urpm/parallel_ssh.pm %changelog +* Tue Dec 9 2003 François Pons <fpons@mandrakesoft.com> 4.4-45mdk +- added compability with RH 7.3. + * Fri Dec 5 2003 François Pons <fpons@mandrakesoft.com> 4.4-44mdk - fixed bug 6013, 6386, 6459. - fixed restart of urpmi in test mode which should be avoided. |