OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 14-Nov-2006 08:43:54
Branch: HEAD Handle: 2006111407435301
Modified files:
openpkg-src/urpmi urpmi.patch urpmi.spec
Log:
completely work-off the URPMI packaging based on hints from
contribution
Summary:
Revision Changes Path
1.12 +37 -0 openpkg-src/urpmi/urpmi.patch
1.19 +114 -26 openpkg-src/urpmi/urpmi.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/urpmi/urpmi.patch
============================================================================
$ cvs diff -u -r1.11 -r1.12 urpmi.patch
--- openpkg-src/urpmi/urpmi.patch 17 Oct 2006 08:36:57 -0000 1.11
+++ openpkg-src/urpmi/urpmi.patch 14 Nov 2006 07:43:53 -0000 1.12
@@ -88,3 +88,40 @@
#undef Fflush
#undef Mkdir
+
+--- urpmi-4.8.29/Makefile.PL.bla 2006-03-21 18:28:24.000000000 +0100
++++ urpmi-4.8.29/Makefile.PL 2006-11-12 00:39:36.000000000 +0100
+@@ -64,6 +64,7 @@
+ my $po = $with_po ? ' installpo' : '';
+ my $gui = $with_gui ? ' installgurpmi2' : '';
+ $inherited =~ s/^install ::/$& installconfigfiles
installstatedir$po$gui/gm;
++ $inherited =~ s/^pure_install ::/$& installconfigfiles
installstatedir$po$gui/gm;
+ $inherited;
+ }
+
+@@ -104,10 +105,10 @@
+ install -m 644 inst.list skip.list \$(SYSCONFDIR)/urpmi
+
+ installstatedir:
+- install -d \$(LOCALSTATEDIR)/urpmi
+- install -d \$(DESTDIR)/var/cache/urpmi/partial
+- install -d \$(DESTDIR)/var/cache/urpmi/headers
+- install -d \$(DESTDIR)/var/cache/urpmi/rpms
++ install -d \$(LOCALSTATEDIR)/urpmi/lib
++ install -d \$(DESTDIR)/\$(PREFIX)/var/urpmi/cache/partial
++ install -d \$(DESTDIR)/\$(PREFIX)/var/urpmi/cache/headers
++ install -d \$(DESTDIR)/\$(PREFIX)/var/urpmi/cache/rpms
+
+ installgurpmi2: pure_install
+ ln -s -f consolehelper \$(DESTINSTALLSCRIPT)/gurpmi2
+@@ -151,8 +152,8 @@
+ INST_MAN5DIR => 'blib/man5',
+ INST_MAN8DIR => 'blib/man8',
+ # We could read those values from rpm macros.
+- SYSCONFDIR => '$(DESTDIR)/etc',
+- LOCALSTATEDIR => '$(DESTDIR)/var/lib',
++ SYSCONFDIR => '$(DESTDIR)$(PREFIX)/etc',
++ LOCALSTATEDIR => '$(DESTDIR)$(PREFIX)/var',
+ },
+ EXE_FILES => [ @bin_scripts, @sbin_scripts ],
+ PMLIBDIRS => [ qw(urpm) ],
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/urpmi/urpmi.spec
============================================================================
$ cvs diff -u -r1.18 -r1.19 urpmi.spec
--- openpkg-src/urpmi/urpmi.spec 17 Oct 2006 08:36:57 -0000 1.18
+++ openpkg-src/urpmi/urpmi.spec 14 Nov 2006 07:43:54 -0000 1.19
@@ -22,13 +22,15 @@
## SUCH DAMAGE.
##
-# FIXME: rse: blindly packaged, still not tested at all under run-time
-
# package version
-%define V_urpmi 4.8.18
-%define V_urpm 1.47
-%define V_mdv_packdrakeng 1.01
-%define V_mdv_distribconf 1.01
+%define V_urpmi 4.8.29
+%define V_urpmi_rpm 4.8.29-1mdv2007.1
+%define V_urpm 1.47
+%define V_urpm_rpm 1.47-1mdv2007.1
+%define V_mdv_distribconf 3.06
+%define V_mdv_distribconf_rpm 3.06-1mdv2007.0
+%define V_mdv_packdrakeng 1.01
+%define V_mdv_packdrakeng_rpm 1.01-2mdk
# package information
Name: urpmi
@@ -41,53 +43,74 @@
Group: Bootstrapping
License: GPL
Version: %{V_urpmi}
-Release: 20061017
+Release: 20061114
+
+# package options
+%option with_wget no
+%option with_ssh no
+%option with_rsync no
# list of sources
-Source0:
http://www.cpan.org/authors/id/R/RG/RGARCIA/urpmi-%{V_urpmi}.tar.gz
-Source1:
http://www.cpan.org/authors/id/R/RG/RGARCIA/URPM-%{V_urpm}.tar.gz
-Source2:
http://www.cpan.org/authors/id/R/RG/RGARCIA/MDV-Packdrakeng-%{V_mdv_packdrakeng}.tar.gz
-Source3:
http://www.cpan.org/authors/id/R/RG/RGARCIA/MDV-Distribconf-%{V_mdv_distribconf}.tar.gz
+Source0:
ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/SRPMS/main/release/urpmi-%{V_urpmi_rpm}.src.rpm
+Source1:
ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/SRPMS/main/release/perl-URPM-%{V_urpm_rpm}.src.rpm
+Source2:
ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/SRPMS/main/release/perl-MDV-Distribconf-%{V_mdv_distribconf_rpm}.src.rpm
+Source3:
ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/SRPMS/main/release/perl-MDV-Packdrakeng-%{V_mdv_packdrakeng_rpm}.src.rpm
Patch0: urpmi.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
-BuildPreReq: OpenPKG, openpkg >= 20040130, perl, perl-openpkg
-PreReq: OpenPKG, openpkg >= 20040130, perl, perl-locale
+BuildPreReq: OpenPKG, openpkg >= 20040130, perl, perl-openpkg, cpio
+PreReq: OpenPKG, openpkg >= 20040130, perl, coreutils
+PreReq: perl-parse, perl-crypto, perl-locale
+%if "%{with_wget}" == "yes"
+PreReq: wget
+%endif
+%if "%{with_ssh}" == "yes"
+PreReq: openssh
+%endif
+%if "%{with_rsync}" == "yes"
+PreReq: rsync
+%endif
AutoReq: no
AutoReqProv: no
%description
URPMI is a frontend for the RedHat Package Manager (RPM).
+ It was originally developed for Mandriva Linux.
%track
prog urpmi:urpmi = {
version = %{V_urpmi}
- url = http://www.cpan.org/authors/id/R/RG/RGARCIA/
- regex = urpmi-(__VER__)\.tar\.gz
+ url =
ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/SRPMS/main/release/
+ regex = urpmi-(__VER__)\.src\.gmz
}
prog urpmi:URPM = {
version = %{V_urpm}
- url = http://www.cpan.org/authors/id/R/RG/RGARCIA/
- regex = URPM-(__VER__)\.tar\.gz
+ url =
ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/SRPMS/main/release/
+ regex = perl-URPM-(__VER__)\.src\.rpm
}
prog urpmi:MDV-Packdrakeng = {
version = %{V_mdv_packdrakeng}
- url = http://www.cpan.org/authors/id/R/RG/RGARCIA/
- regex = MDV-Packdrakeng-(__VER__)\.tar\.gz
+ url =
ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/SRPMS/main/release/
+ regex = perl-MDV-Packdrakeng-(__VER__)\.src\.rpm
}
prog urpmi:MDV-Distribconf = {
version = %{V_mdv_distribconf}
- url = http://www.cpan.org/authors/id/R/RG/RGARCIA/
- regex = MDV-Distribconf-(__VER__)\.tar\.gz
+ url =
ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/SRPMS/main/release/
+ regex = perl-MDV-Distribconf-(__VER__)\.src\.rpm
}
%prep
- %setup -q -c
- %setup -q -D -T -a 1
- %setup -q -D -T -a 2
- %setup -q -D -T -a 3
+ %setup -q -T -c
+ %{l_rpm2cpio} %{SOURCE urpmi-%{V_urpmi_rpm}.src.rpm}
| cpio -idvmu
+ %{l_rpm2cpio} %{SOURCE perl-URPM-%{V_urpm_rpm}.src.rpm}
| cpio -idvmu
+ %{l_rpm2cpio} %{SOURCE
perl-MDV-Distribconf-%{V_mdv_distribconf_rpm}.src.rpm} | cpio -idvmu
+ %{l_rpm2cpio} %{SOURCE
perl-MDV-Packdrakeng-%{V_mdv_packdrakeng_rpm}.src.rpm} | cpio -idvmu
+ %{l_bzip2} -d -c urpmi-%{V_urpmi}.tar.bz2
| %{l_tar} xf -
+ %{l_bzip2} -d -c URPM-%{V_urpm}.tar.bz2
| %{l_tar} xf -
+ %{l_bzip2} -d -c MDV-Packdrakeng-%{V_mdv_packdrakeng}.tar.bz2
| %{l_tar} xf -
+ %{l_gzip} -d -c MDV-Distribconf-%{V_mdv_distribconf}.tar.gz
| %{l_tar} xf -
%patch -p0
%build
@@ -95,21 +118,86 @@
%install
rm -rf $RPM_BUILD_ROOT
( cd urpmi-%{V_urpmi}
+ # adjust path to configuration files
%{l_shtool} subst \
-e "s;/etc/urpmi;%{l_prefix}/etc/urpmi;" \
urpmq urpm/cfg.pm urpm.pm
+
+ # adjust cache and hdlist paths
+ %{l_shtool} subst \
+ -e "s;/var/lib/urpmi;%{l_prefix}/var/urpmi/lib;" \
+ -e "s;/var/cache/urpmi;%{l_prefix}/var/urpmi/cache;" \
+ urpm.pm
+
+ # fix superuser message (l_muid)
+ %{l_shtool} subst \
+ -e "s;$< != 0;$< != %{l_muid};" \
+ urpmi.addmedia urpmi.update urpmi.removemedia rurpmi urpmi urpmq
+ %{l_shtool} subst \
+ -e "s;$<;($< != %{l_muid});" \
+ urpme urpmi.recover urpm.pm
+
+ # fix common tool paths (coreutils)
+ %{l_shtool} subst \
+ -e "s;/bin/cp;%{l_prefix}/bin/cp;" \
+ -e "s;/bin/mv;%{l_prefix}/bin/mv;" \
+ -e "s;/usr/bin/md5sum;%{l_prefix}/bin/md5sum;" \
+ urpm/util.pm
+ %{l_shtool} subst \
+ -e "s;/usr/bin/curl;%{l_prefix}/lib/openpkg/curl;" \
+%if "%{with_wget}" == "yes"
+ -e "s;/usr/bin/wget;%{l_prefix}/bin/wget;" \
+%endif
+%if "%{with_rsync}" == "yes"
+ -e "s;/usr/bin/rsync;%{l_prefix}/bin/rsync;" \
+%endif
+%if "%{with_ssh}" == "yes"
+ -e "s;/usr/bin/ssh;%{l_prefix}/bin/ssh;" \
+%endif
+ urpm/download.pm
) || exit $?
+
+ # install addon Perl modules
%{l_prefix}/bin/perl-openpkg prepare
%{l_prefix}/bin/perl-openpkg -d MDV-Distribconf-%{V_mdv_distribconf}
configure build install
%{l_prefix}/bin/perl-openpkg -d MDV-Packdrakeng-%{V_mdv_packdrakeng}
configure build install
%{l_prefix}/bin/perl-openpkg -d URPM-%{V_urpm} configure build install
%{l_prefix}/bin/perl-openpkg -d urpmi-%{V_urpmi} configure build install
%{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
+
+ # determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} `cat perl-openpkg-files`
+ %{l_files_std} `cat perl-openpkg-files` \
+ '%dir %{l_prefix}/var/urpmi/*' \
+ '%not %dir %{l_prefix}/etc/urpmi' \
+ '%config %{l_prefix}/etc/urpmi/inst.list' \
+ '%config %{l_prefix}/etc/urpmi/skip.list'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+ # update media information
+ $RPM_INSTALL_PREFIX/bin/perl -Murpm -e '
+ if (-e "$ARGV[0]/etc/urpmi/urpmi.cfg") {
+ $urpm = new urpm;
+ $urpm->read_config;
+ $urpm->update_media(nolock => 1, nopubkey => 1);
+ }
+ ' $RPM_INSTALL_PREFIX
+ exit 0
+
+%preun
+ # remove database files on deinstallation
+ if [ ".$1" = .0 ]; then
+ ( cd $RPM_INSTALL_PREFIX/var/urpmi/lib || exit $?
+ rm -f compss provides depslist* descriptions.* *.cache hdlist.*
synthesis.hdlist.* list.* >/dev/null 2>&1 || true
+ ) || exit $?
+ ( cd $RPM_INSTALL_PREFIX/var/urpmi/cache || exit $?
+ rm -rf partial/* headers/* rpms/* >/dev/null 2>&1 || true
+ ) || exit $?
+ fi
+ exit 0
+
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]